2 Copyright (C) 2013 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/>.
21 #ifndef DCPOMATIC_COLOUR_CONVERSION_H
22 #define DCPOMATIC_COLOUR_CONVERSION_H
24 /* Hack for OS X compile failure; see https://bugs.launchpad.net/hugin/+bug/910160 */
29 #include <dcp/colour_conversion.h>
30 #include <libcxml/cxml.h>
36 class ColourConversion : public dcp::ColourConversion
40 explicit ColourConversion (dcp::ColourConversion);
41 ColourConversion (cxml::NodePtr, int version);
42 virtual ~ColourConversion () {}
44 virtual void as_xml (xmlpp::Node *) const;
45 std::string identifier () const;
47 boost::optional<size_t> preset () const;
49 static boost::optional<ColourConversion> from_xml (cxml::NodePtr, int version);
52 class PresetColourConversion
55 PresetColourConversion ();
56 PresetColourConversion (std::string n, std::string i, dcp::ColourConversion);
57 PresetColourConversion (cxml::NodePtr node, int version);
59 ColourConversion conversion;
61 /** an internal short (non-internationalised) name for this preset */
64 static std::vector<PresetColourConversion> all () {
68 static PresetColourConversion from_id (std::string id);
70 static void setup_colour_conversion_presets ();
73 static std::vector<PresetColourConversion> _presets;
76 bool operator== (ColourConversion const &, ColourConversion const &);
77 bool operator!= (ColourConversion const &, ColourConversion const &);
78 bool operator== (PresetColourConversion const &, PresetColourConversion const &);