+void
+FilmViewer::raw_to_display ()
+{
+ if (!_raw_frame || _out_size.width < 64 || _out_size.height < 64 || !_film) {
+ return;
+ }
+
+ shared_ptr<Image> input = _raw_frame;
+
+ pair<string, string> const s = Filter::ffmpeg_strings (_film->filters());
+ if (!s.second.empty ()) {
+ input = input->post_process (s.second, true);
+ }
+
+ /* Get a compacted image as we have to feed it to wxWidgets */
+ _display_frame = input->scale_and_convert_to_rgb (_film_size, 0, _film->scaler(), false);
+
+ if (_raw_sub) {
+
+ /* Our output is already cropped by the decoder, so we need to account for that
+ when working out the scale that we are applying.
+ */
+
+ Size const cropped_size = _film->cropped_size (_film->video_size ());
+
+ Rect tx = subtitle_transformed_area (
+ float (_film_size.width) / cropped_size.width,
+ float (_film_size.height) / cropped_size.height,
+ _raw_sub->area(), _film->subtitle_offset(), _film->subtitle_scale()
+ );
+
+ _display_sub.reset (new RGBPlusAlphaImage (_raw_sub->image()->scale (tx.size(), _film->scaler(), false)));
+ _display_sub_position = tx.position();
+ _display_sub_position.x += _display_frame_x;
+ } else {
+ _display_sub.reset ();
+ }
+}
+