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 ColourConversion (dcp::ColourConversion);
41 ColourConversion (cxml::NodePtr, int version);
43 virtual void as_xml (xmlpp::Node *) const;
44 std::string identifier () const;
46 boost::optional<size_t> preset () const;
48 static boost::optional<ColourConversion> from_xml (cxml::NodePtr, int version);
51 class PresetColourConversion
54 PresetColourConversion ();
55 PresetColourConversion (std::string n, std::string i, dcp::ColourConversion);
56 PresetColourConversion (cxml::NodePtr node, int version);
58 ColourConversion conversion;
60 /** an internal short (non-internationalised) name for this preset */
63 static std::vector<PresetColourConversion> all () {
67 static PresetColourConversion from_id (std::string id);
69 static void setup_colour_conversion_presets ();
72 static std::vector<PresetColourConversion> _presets;
75 bool operator== (ColourConversion const &, ColourConversion const &);
76 bool operator!= (ColourConversion const &, ColourConversion const &);
77 bool operator== (PresetColourConversion const &, PresetColourConversion const &);