2 Copyright (C) 2013-2017 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 #include "ffmpeg_subtitle_stream.h"
22 #include <dcp/raw_convert.h>
23 #include <libxml++/libxml++.h>
24 #include <boost/foreach.hpp>
32 using dcp::raw_convert;
34 /** Construct a SubtitleStream from a value returned from to_string().
35 * @param node String returned from to_string().
36 * @param version State file version.
38 FFmpegSubtitleStream::FFmpegSubtitleStream (cxml::ConstNodePtr node, int version)
42 BOOST_FOREACH (cxml::NodePtr i, node->node_children ("Colour")) {
43 _colours[RGBA(i->node_child("From"))] = RGBA (i->node_child("To"));
49 FFmpegSubtitleStream::as_xml (xmlpp::Node* root) const
51 FFmpegStream::as_xml (root);
53 for (map<RGBA, RGBA>::const_iterator i = _colours.begin(); i != _colours.end(); ++i) {
54 xmlpp::Node* node = root->add_child("Colour");
55 i->first.as_xml (node->add_child("From"));
56 i->second.as_xml (node->add_child("To"));
61 FFmpegSubtitleStream::colours () const
67 FFmpegSubtitleStream::set_colour (RGBA from, RGBA to)