49 using boost::optional;
54 optional<string> font,
75 :
Subtitle (in, out, h_position, h_align, v_position, v_align, fade_up_time, fade_down_time)
79 , _underline (underline)
82 , _aspect_adjust (aspect_adjust)
83 , _direction (direction)
86 , _effect_colour (effect_colour)
87 , _space_before (space_before)
89 _aspect_adjust = max(min(_aspect_adjust, 4.0f), 0.25f);
94 SubtitleString::size_in_pixels (
int screen_height)
const
101 return _size * screen_height / (11 * 72);
110 a.italic() == b.italic() &&
111 a.bold() == b.bold() &&
112 a.underline() == b.underline() &&
113 a.colour() == b.colour() &&
114 a.size() == b.size() &&
118 a.h_position() == b.h_position() &&
119 a.h_align() == b.h_align() &&
121 a.v_align() == b.v_align() &&
122 a.direction() == b.direction() &&
123 a.text() == b.text() &&
124 a.effect() == b.effect() &&
125 a.effect_colour() == b.effect_colour() &&
126 a.fade_up_time() == b.fade_up_time() &&
127 a.fade_down_time() == b.fade_down_time() &&
143 s <<
"\n`" << sub.text() <<
"' from " << sub.
in() <<
" to " << sub.
out() <<
";\n"
144 <<
"fade up " << sub.fade_up_time() <<
", fade down " << sub.fade_down_time() <<
";\n"
145 <<
"font " << sub.
font().get_value_or (
"[default]") <<
", ";
159 if (sub.underline()) {
163 s <<
"size " << sub.size() <<
", aspect " << sub.
aspect_adjust()
164 <<
", colour (" << sub.colour().
r <<
", " << sub.colour().
g <<
", " << sub.colour().
b <<
")"
165 <<
", vpos " << sub.
v_position() <<
", valign " << ((int) sub.v_align())
166 <<
", hpos " << sub.h_position() <<
", halign " << ((int) sub.h_align())
167 <<
", direction " << ((
int) sub.direction())
168 <<
", effect " << ((
int) sub.effect())
169 <<
", effect colour (" << sub.effect_colour().
r <<
", " << sub.effect_colour().
g <<
", " << sub.effect_colour().
b <<
")"
170 <<
", space before " << sub.space_before();
int g
green component, from 0 to 255
int b
blue component, from 0 to 255
int r
red component, from 0 to 255
A single line of subtitle text with all the associated attributes.
SubtitleString(boost::optional< std::string > font, bool italic, bool bold, bool underline, Colour colour, int size, float aspect_adjust, Time in, Time out, float h_position, HAlign h_align, float v_position, VAlign v_align, Direction direction, std::string text, Effect effect, Colour effect_colour, Time fade_up_time, Time fade_down_time, float space_before)
float aspect_adjust() const
boost::optional< std::string > font() const
A representation of time within a DCP.
Namespace for everything in libdcp.
constexpr float SPACE_BEFORE_EPSILON
constexpr float ASPECT_ADJUST_EPSILON
Helpers for XML reading with libcxml.