Accessor for ClosedCaptionsDialog.
[dcpomatic.git] / src / lib / colour_conversion.h
1 /*
2     Copyright (C) 2013 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_H
22 #define DCPOMATIC_COLOUR_CONVERSION_H
23
24 /* Hack for OS X compile failure; see https://bugs.launchpad.net/hugin/+bug/910160 */
25 #ifdef check
26 #undef check
27 #endif
28
29 #include <dcp/colour_conversion.h>
30 #include <libcxml/cxml.h>
31
32 namespace xmlpp {
33         class Node;
34 }
35
36 class ColourConversion : public dcp::ColourConversion
37 {
38 public:
39         ColourConversion ();
40         explicit ColourConversion (dcp::ColourConversion);
41         ColourConversion (cxml::NodePtr, int version);
42         virtual ~ColourConversion () {}
43
44         virtual void as_xml (xmlpp::Node *) const;
45         std::string identifier () const;
46
47         boost::optional<size_t> preset () const;
48
49         static boost::optional<ColourConversion> from_xml (cxml::NodePtr, int version);
50 };
51
52 class PresetColourConversion
53 {
54 public:
55         PresetColourConversion ();
56         PresetColourConversion (std::string n, std::string i, dcp::ColourConversion);
57         PresetColourConversion (cxml::NodePtr node, int version);
58
59         ColourConversion conversion;
60         std::string name;
61         /** an internal short (non-internationalised) name for this preset */
62         std::string id;
63
64         static std::vector<PresetColourConversion> all () {
65                 return _presets;
66         }
67
68         static PresetColourConversion from_id (std::string id);
69
70         static void setup_colour_conversion_presets ();
71
72 private:
73         static std::vector<PresetColourConversion> _presets;
74 };
75
76 bool operator== (ColourConversion const &, ColourConversion const &);
77 bool operator!= (ColourConversion const &, ColourConversion const &);
78 bool operator== (PresetColourConversion const &, PresetColourConversion const &);
79
80 #endif