Supporters update.
[dcpomatic.git] / src / wx / colour_conversion_editor.h
1 /*
2     Copyright (C) 2013-2021 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
22 #ifndef DCPOMATIC_COLOUR_CONVERSION_EDITOR_H
23 #define DCPOMATIC_COLOUR_CONVERSION_EDITOR_H
24
25
26 #include <dcp/warnings.h>
27 LIBDCP_DISABLE_WARNINGS
28 #include <wx/wx.h>
29 LIBDCP_ENABLE_WARNINGS
30 #include <boost/signals2.hpp>
31
32
33 class ColourConversion;
34 class wxGridBagSizer;
35 class wxSpinCtrlDouble;
36
37
38 class ColourConversionEditor : public wxPanel
39 {
40 public:
41         ColourConversionEditor (wxWindow *, bool yuv);
42
43         void set (ColourConversion);
44         ColourConversion get () const;
45
46         boost::signals2::signal<void ()> Changed;
47
48 private:
49         void changed ();
50         void spin_ctrl_changed(wxSpinCtrlDouble *);
51         void chromaticity_changed ();
52         void adjusted_white_changed ();
53         void update_rgb_to_xyz ();
54         void update_bradford ();
55         wxStaticText* subhead (wxGridBagSizer* sizer, wxWindow* parent, wxString text, int& row) const;
56
57         void set_text_ctrl (wxTextCtrl *, double);
58         void set_spin_ctrl (wxSpinCtrlDouble *, double);
59
60         static int const INPUT_GAMMA;
61         static int const INPUT_GAMMA_LINEARISED;
62         static int const INPUT_SGAMUT3;
63
64         std::map<wxSpinCtrlDouble*, double> _last_spin_ctrl_value;
65         bool _ignore_chromaticity_changed;
66
67         wxChoice* _input;
68         wxSpinCtrlDouble* _input_gamma;
69         wxSpinCtrlDouble* _input_power;
70         wxTextCtrl* _input_threshold;
71         wxTextCtrl* _input_A;
72         wxTextCtrl* _input_B;
73         wxChoice* _yuv_to_rgb;
74         wxTextCtrl* _red_x;
75         wxTextCtrl* _red_y;
76         wxTextCtrl* _green_x;
77         wxTextCtrl* _green_y;
78         wxTextCtrl* _blue_x;
79         wxTextCtrl* _blue_y;
80         wxTextCtrl* _white_x;
81         wxTextCtrl* _white_y;
82         CheckBox* _adjust_white;
83         wxTextCtrl* _adjusted_white_x;
84         wxTextCtrl* _adjusted_white_y;
85         CheckBox* _output;
86         wxStaticText* _rgb_to_xyz[3][3];
87         wxStaticText* _bradford[3][3];
88 };
89
90
91 #endif
92