From e1e7de8d73bedd0c741e7df0390068c67867e09f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 24 Jan 2021 22:56:33 +0100 Subject: Tidying. --- src/subtitle_string.cc | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/subtitle_string.cc') diff --git a/src/subtitle_string.cc b/src/subtitle_string.cc index 0f89291e..28c02114 100644 --- a/src/subtitle_string.cc +++ b/src/subtitle_string.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2016 Carl Hetherington + Copyright (C) 2012-2021 Carl Hetherington This file is part of libdcp. @@ -31,16 +31,25 @@ files in the program, then also delete it here. */ + +/** @file src/subtitle_string.cc + * @brief SubtitleString class + */ + + #include "subtitle_string.h" #include "xml.h" #include -using std::string; + +using std::max; +using std::min; using std::ostream; +using std::string; using boost::optional; using namespace dcp; -/** @param v_position Vertical position as a fraction of the screen height (between 0 and 1) from v_align */ + SubtitleString::SubtitleString ( optional font, bool italic, @@ -75,9 +84,10 @@ SubtitleString::SubtitleString ( , _effect (effect) , _effect_colour (effect_colour) { - + _aspect_adjust = max(min(_aspect_adjust, 4.0), 0.25); } + int SubtitleString::size_in_pixels (int screen_height) const { @@ -89,6 +99,7 @@ SubtitleString::size_in_pixels (int screen_height) const return _size * screen_height / (11 * 72); } + bool dcp::operator== (SubtitleString const & a, SubtitleString const & b) { @@ -115,12 +126,14 @@ dcp::operator== (SubtitleString const & a, SubtitleString const & b) ); } + bool dcp::operator!= (SubtitleString const & a, SubtitleString const & b) { return !(a == b); } + ostream& dcp::operator<< (ostream& s, SubtitleString const & sub) { -- cgit v1.2.3