Accessor for ClosedCaptionsDialog.
[dcpomatic.git] / src / wx / colour_conversion_editor.h
1 /*
2     Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21 #ifndef DCPOMATIC_COLOUR_CONVERSION_EDITOR_H
22 #define DCPOMATIC_COLOUR_CONVERSION_EDITOR_H
23
24 #include <boost/signals2.hpp>
25 #include <wx/wx.h>
26
27 class wxSpinCtrlDouble;
28 class ColourConversion;
29
30 class ColourConversionEditor : public wxPanel
31 {
32 public:
33         ColourConversionEditor (wxWindow *, bool yuv);
34
35         void set (ColourConversion);
36         ColourConversion get () const;
37
38         boost::signals2::signal<void ()> Changed;
39
40 private:
41         void changed ();
42         void changed (wxSpinCtrlDouble *);
43         void chromaticity_changed ();
44         void adjusted_white_changed ();
45         void update_rgb_to_xyz ();
46         void update_bradford ();
47         wxStaticText* subhead (wxGridBagSizer* sizer, wxWindow* parent, wxString text, int& row) const;
48
49         void set_text_ctrl (wxTextCtrl *, double);
50         void set_spin_ctrl (wxSpinCtrlDouble *, double);
51
52         static int const INPUT_GAMMA;
53         static int const INPUT_GAMMA_LINEARISED;
54         static int const INPUT_SGAMUT3;
55
56         std::map<wxSpinCtrlDouble*, double> _last_spin_ctrl_value;
57         bool _ignore_chromaticity_changed;
58
59         wxChoice* _input;
60         wxSpinCtrlDouble* _input_gamma;
61         wxSpinCtrlDouble* _input_power;
62         wxTextCtrl* _input_threshold;
63         wxTextCtrl* _input_A;
64         wxTextCtrl* _input_B;
65         wxChoice* _yuv_to_rgb;
66         wxTextCtrl* _red_x;
67         wxTextCtrl* _red_y;
68         wxTextCtrl* _green_x;
69         wxTextCtrl* _green_y;
70         wxTextCtrl* _blue_x;
71         wxTextCtrl* _blue_y;
72         wxTextCtrl* _white_x;
73         wxTextCtrl* _white_y;
74         wxCheckBox* _adjust_white;
75         wxTextCtrl* _adjusted_white_x;
76         wxTextCtrl* _adjusted_white_y;
77         wxCheckBox* _output;
78         wxStaticText* _rgb_to_xyz[3][3];
79         wxStaticText* _bradford[3][3];
80 };
81
82 #endif