diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-01-20 23:53:54 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-02-18 00:41:34 +0100 |
| commit | 710cb2e6edf6583de0a2c92281143ba95a4d6bac (patch) | |
| tree | b5b82be4bc6df3dca3dc5b5f7b0617e4ae7d05e4 /src/lib | |
| parent | 16abbf1cc73fd81cc3118117e1f9119836f998a1 (diff) | |
Use bounding_box() instead of render_text() for speed.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/analyse_subtitles_job.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/analyse_subtitles_job.cc b/src/lib/analyse_subtitles_job.cc index d222ad3b8..f140f13d1 100644 --- a/src/lib/analyse_subtitles_job.cc +++ b/src/lib/analyse_subtitles_job.cc @@ -112,10 +112,10 @@ AnalyseSubtitlesJob::analyse(PlayerText const& text, TextType type) /* We can provide dummy values for time and frame rate here as they are only used to calculate fades */ dcp::Size const frame = _film->frame_size(); - for (auto i: render_text(text.string, frame, dcpomatic::DCPTime(), 24)) { + for (auto i: bounding_box(text.string, frame)) { dcpomatic::Rect<double> rect ( - double(i.position.x) / frame.width, double(i.position.y) / frame.height, - double(i.image->size().width) / frame.width, double(i.image->size().height) / frame.height + double(i.x) / frame.width, double(i.y) / frame.height, + double(i.width) / frame.width, double(i.height) / frame.height ); if (!_bounding_box) { _bounding_box = rect; |
