No-op; fix GPL address and use the explicit-program-name version.
[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         ColourConversion (dcp::ColourConversion);
41         ColourConversion (cxml::NodePtr, int version);
42
43         virtual void as_xml (xmlpp::Node *) const;
44         std::string identifier () const;
45
46         boost::optional<size_t> preset () const;
47
48         static boost::optional<ColourConversion> from_xml (cxml::NodePtr, int version);
49 };
50
51 class PresetColourConversion
52 {
53 public:
54         PresetColourConversion ();
55         PresetColourConversion (std::string n, std::string i, dcp::ColourConversion);
56         PresetColourConversion (cxml::NodePtr node, int version);
57
58         ColourConversion conversion;
59         std::string name;
60         /** an internal short (non-internationalised) name for this preset */
61         std::string id;
62
63         static std::vector<PresetColourConversion> all () {
64                 return _presets;
65         }
66
67         static PresetColourConversion from_id (std::string id);
68
69         static void setup_colour_conversion_presets ();
70
71 private:
72         static std::vector<PresetColourConversion> _presets;
73 };
74
75 bool operator== (ColourConversion const &, ColourConversion const &);
76 bool operator!= (ColourConversion const &, ColourConversion const &);
77 bool operator== (PresetColourConversion const &, PresetColourConversion const &);
78
79 #endif