diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-03 16:09:24 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-03 16:09:24 +0100 |
| commit | 4b0ece8d964961598ce4734ce25bb0aed66dbf7a (patch) | |
| tree | e13cc114733d155353e8e20c73d96627a5ceb1a0 /src/subtitle_string.cc | |
| parent | 5e4c87ae58f1ed73b9ef19cd75210963599fa546 (diff) | |
Add AspectAdjust to subtitles.
Diffstat (limited to 'src/subtitle_string.cc')
| -rw-r--r-- | src/subtitle_string.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/subtitle_string.cc b/src/subtitle_string.cc index 15131873..c4358381 100644 --- a/src/subtitle_string.cc +++ b/src/subtitle_string.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,6 +19,7 @@ #include "subtitle_string.h" #include "xml.h" +#include <cmath> using std::string; using std::ostream; @@ -31,6 +32,7 @@ SubtitleString::SubtitleString ( bool italic, Colour colour, int size, + float aspect_adjust, Time in, Time out, float v_position, @@ -45,6 +47,7 @@ SubtitleString::SubtitleString ( , _italic (italic) , _colour (colour) , _size (size) + , _aspect_adjust (aspect_adjust) , _in (in) , _out (out) , _v_position (v_position) @@ -77,6 +80,7 @@ dcp::operator== (SubtitleString const & a, SubtitleString const & b) a.italic() == b.italic() && a.colour() == b.colour() && a.size() == b.size() && + fabs (a.aspect_adjust() - b.aspect_adjust()) < ASPECT_ADJUST_EPSILON && a.in() == b.in() && a.out() == b.out() && a.v_position() == b.v_position() && @@ -102,7 +106,8 @@ dcp::operator<< (ostream& s, SubtitleString const & sub) s << "non-italic"; } - s << ", size " << sub.size() << ", colour " << sub.colour() << ", vpos " << sub.v_position() << ", valign " << ((int) sub.v_align()) << ";\n" + s << ", size " << sub.size() << ", aspect " << sub.aspect_adjust() << ", colour " << sub.colour() + << ", vpos " << sub.v_position() << ", valign " << ((int) sub.v_align()) << ";\n" << "effect " << ((int) sub.effect()) << ", effect colour " << sub.effect_colour(); return s; |
