2 Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
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.
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.
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/>.
22 #ifndef DCPOMATIC_COLOUR_CONVERSION_EDITOR_H
23 #define DCPOMATIC_COLOUR_CONVERSION_EDITOR_H
26 #include <dcp/warnings.h>
27 LIBDCP_DISABLE_WARNINGS
29 LIBDCP_ENABLE_WARNINGS
30 #include <boost/signals2.hpp>
33 class ColourConversion;
35 class wxSpinCtrlDouble;
38 class ColourConversionEditor : public wxPanel
41 ColourConversionEditor (wxWindow *, bool yuv);
43 void set (ColourConversion);
44 ColourConversion get () const;
46 boost::signals2::signal<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;
57 void set_text_ctrl (wxTextCtrl *, double);
58 void set_spin_ctrl (wxSpinCtrlDouble *, double);
60 static int const INPUT_GAMMA;
61 static int const INPUT_GAMMA_LINEARISED;
62 static int const INPUT_SGAMUT3;
64 std::map<wxSpinCtrlDouble*, double> _last_spin_ctrl_value;
65 bool _ignore_chromaticity_changed;
68 wxSpinCtrlDouble* _input_gamma;
69 wxSpinCtrlDouble* _input_power;
70 wxTextCtrl* _input_threshold;
73 wxChoice* _yuv_to_rgb;
82 CheckBox* _adjust_white;
83 wxTextCtrl* _adjusted_white_x;
84 wxTextCtrl* _adjusted_white_y;
86 wxStaticText* _rgb_to_xyz[3][3];
87 wxStaticText* _bradford[3][3];