summaryrefslogtreecommitdiff
path: root/src/subtitle_asset.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-07-08 00:19:42 +0100
committerCarl Hetherington <cth@carlh.net>2018-07-08 00:19:42 +0100
commit85bd14f4e7dcbfb2005969575788dbfb303bf846 (patch)
treebd3d938a75e7a2e7ffedad845dfc2dfde459682a /src/subtitle_asset.cc
parentba5915461f1622715a69fa25579e5e27e64fb079 (diff)
Basic interop bitmap writing.
Diffstat (limited to 'src/subtitle_asset.cc')
-rw-r--r--src/subtitle_asset.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc
index 3ecd16a7..f93ffa85 100644
--- a/src/subtitle_asset.cc
+++ b/src/subtitle_asset.cc
@@ -549,7 +549,6 @@ SubtitleAsset::subtitles_as_xml (xmlpp::Element* xml_root, int time_code_rate, S
}
shared_ptr<SubtitleString> is = dynamic_pointer_cast<SubtitleString>(i);
-
if (is) {
if (!text ||
last_h_align != is->h_align() ||
@@ -571,7 +570,13 @@ SubtitleAsset::subtitles_as_xml (xmlpp::Element* xml_root, int time_code_rate, S
text->children.push_back (shared_ptr<order::String> (new order::String (text, order::Font (is, standard), is->text())));
}
- /* XXX: image */
+ shared_ptr<SubtitleImage> ii = dynamic_pointer_cast<SubtitleImage>(i);
+ if (ii) {
+ text.reset ();
+ subtitle->children.push_back (
+ shared_ptr<order::Image> (new order::Image (subtitle, ii->png_image(), ii->h_align(), ii->h_position(), ii->v_align(), ii->v_position()))
+ );
+ }
}
/* Pull font changes as high up the hierarchy as we can */
@@ -584,6 +589,7 @@ SubtitleAsset::subtitles_as_xml (xmlpp::Element* xml_root, int time_code_rate, S
context.time_code_rate = time_code_rate;
context.standard = standard;
context.spot_number = 1;
+ context.image_number = 0;
root->write_xml (xml_root, context);
}