summaryrefslogtreecommitdiff
path: root/src/subtitle_image.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-07-07 23:16:45 +0100
committerCarl Hetherington <cth@carlh.net>2018-07-07 23:16:45 +0100
commitba5915461f1622715a69fa25579e5e27e64fb079 (patch)
tree221ce87dfbac455c32459e07beb92b6003243e89 /src/subtitle_image.cc
parenta4fb6290e31f7e197cc399c745d320442eb093d4 (diff)
SubtitleString -> shared_ptr<Subtitle>
Diffstat (limited to 'src/subtitle_image.cc')
-rw-r--r--src/subtitle_image.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/subtitle_image.cc b/src/subtitle_image.cc
index 90aadf29..974b496f 100644
--- a/src/subtitle_image.cc
+++ b/src/subtitle_image.cc
@@ -33,6 +33,7 @@
#include "subtitle_image.h"
+using std::ostream;
using namespace dcp;
SubtitleImage::SubtitleImage (
@@ -51,3 +52,36 @@ SubtitleImage::SubtitleImage (
{
}
+
+bool
+dcp::operator== (SubtitleImage const & a, SubtitleImage const & b)
+{
+ return (
+ a.png_image() == b.png_image(),
+ a.in() == b.in() &&
+ a.out() == b.out() &&
+ a.h_position() == b.h_position() &&
+ a.h_align() == b.h_align() &&
+ a.v_position() == b.v_position() &&
+ a.v_align() == b.v_align() &&
+ a.fade_up_time() == b.fade_up_time() &&
+ a.fade_down_time() == b.fade_down_time()
+ );
+}
+
+bool
+dcp::operator!= (SubtitleImage const & a, SubtitleImage const & b)
+{
+ return !(a == b);
+}
+
+ostream&
+dcp::operator<< (ostream& s, SubtitleImage const & sub)
+{
+ s << "\n[IMAGE] from " << sub.in() << " to " << sub.out() << ";\n"
+ << "fade up " << sub.fade_up_time() << ", fade down " << sub.fade_down_time() << ";\n"
+ << "v pos " << sub.v_position() << ", valign " << ((int) sub.v_align())
+ << ", hpos " << sub.h_position() << ", halign " << ((int) sub.h_align()) << "\n";
+
+ return s;
+}