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