From c7f45cd00b94393f6e15428a2ea256995f890412 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 26 Aug 2023 14:29:06 +0200 Subject: Cleanup: use some more vector instead of list. --- src/lib/render_text.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/lib/render_text.cc') diff --git a/src/lib/render_text.cc b/src/lib/render_text.cc index 9d154feca..84fc8414d 100644 --- a/src/lib/render_text.cc +++ b/src/lib/render_text.cc @@ -39,7 +39,6 @@ LIBDCP_ENABLE_WARNINGS using std::cerr; using std::cout; -using std::list; using std::make_pair; using std::make_shared; using std::max; @@ -47,6 +46,7 @@ using std::min; using std::pair; using std::shared_ptr; using std::string; +using std::vector; using boost::optional; using namespace dcpomatic; @@ -76,7 +76,7 @@ create_layout(string font_name, string markup) string -marked_up (list subtitles, int target_height, float fade_factor, string font_name) +marked_up(vector subtitles, int target_height, float fade_factor, string font_name) { auto constexpr pixels_to_1024ths_point = 72 * 1024 / 96; @@ -296,7 +296,7 @@ struct Layout * at the same time and with the same fade in/out. */ static Layout -setup_layout(list subtitles, dcp::Size target, DCPTime time, int frame_rate) +setup_layout(vector subtitles, dcp::Size target, DCPTime time, int frame_rate) { DCPOMATIC_ASSERT(!subtitles.empty()); auto const& first = subtitles.front(); @@ -314,7 +314,7 @@ setup_layout(list subtitles, dcp::Size target, DCPTime time, int fra * at the same time and with the same fade in/out. */ static PositionImage -render_line (list subtitles, dcp::Size target, DCPTime time, int frame_rate) +render_line(vector subtitles, dcp::Size target, DCPTime time, int frame_rate) { /* XXX: this method can only handle italic / bold changes mid-line, nothing else yet. @@ -401,11 +401,11 @@ render_line (list subtitles, dcp::Size target, DCPTime time, int fra * @param target Size of the container that this subtitle will end up in. * @param frame_rate DCP frame rate. */ -list -render_text (list subtitles, dcp::Size target, DCPTime time, int frame_rate) +vector +render_text(vector subtitles, dcp::Size target, DCPTime time, int frame_rate) { - list pending; - list images; + vector pending; + vector images; for (auto const& i: subtitles) { if (!pending.empty() && (i.v_align() != pending.back().v_align() || fabs(i.v_position() - pending.back().v_position()) > 1e-4)) { @@ -423,11 +423,11 @@ render_text (list subtitles, dcp::Size target, DCPTime time, int fra } -list> -bounding_box(list subtitles, dcp::Size target, optional override_standard) +vector> +bounding_box(vector subtitles, dcp::Size target, optional override_standard) { - list pending; - list> rects; + vector pending; + vector> rects; auto use_pending = [&pending, &rects, target, override_standard]() { auto const& subtitle = pending.front(); -- cgit v1.2.3