From 85bd14f4e7dcbfb2005969575788dbfb303bf846 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 8 Jul 2018 00:19:42 +0100 Subject: Basic interop bitmap writing. --- src/interop_subtitle_asset.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/interop_subtitle_asset.cc') diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc index 7d3114c3..02e2d75b 100644 --- a/src/interop_subtitle_asset.cc +++ b/src/interop_subtitle_asset.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington + Copyright (C) 2012-2018 Carl Hetherington This file is part of libdcp. @@ -33,11 +33,13 @@ #include "interop_subtitle_asset.h" #include "interop_load_font_node.h" +#include "subtitle_asset_internal.h" #include "xml.h" #include "raw_convert.h" #include "util.h" #include "font_asset.h" #include "dcp_assert.h" +#include "subtitle_image.h" #include #include #include @@ -63,7 +65,7 @@ InteropSubtitleAsset::InteropSubtitleAsset (boost::filesystem::path file) _reel_number = xml->string_child ("ReelNumber"); _language = xml->string_child ("Language"); _movie_title = xml->string_child ("MovieTitle"); - _load_font_nodes = type_children (xml, "LoadFont"); + _load_font_nodes = type_children (xml, "LoadFont"); /* Now we need to drop down to xmlpp */ @@ -174,6 +176,16 @@ InteropSubtitleAsset::write (boost::filesystem::path p) const _file = p; + /* Image subtitles */ + int n = 0; + BOOST_FOREACH (shared_ptr i, _subtitles) { + shared_ptr im = dynamic_pointer_cast (i); + if (im) { + im->png_image().write (p.parent_path() / image_subtitle_file (n++)); + } + } + + /* Fonts */ BOOST_FOREACH (shared_ptr i, _load_font_nodes) { boost::filesystem::path file = p.parent_path() / i->uri; FILE* f = fopen_boost (file, "wb"); -- cgit v1.2.3