video.image,
content_video->actual_crop(),
content_video->fade(film, video.frame),
- scale_for_display(
- content_video->scaled_size(film->frame_size()),
- _video_container_size,
- film->frame_size(),
- content_video->pixel_quanta()
- ),
+ content_video->scaled_size(_video_container_size),
_video_container_size,
eyes,
video.part,
_crop = content->video->actual_crop();
_fade = content->video->fade(film, _video_frame.get());
- _inter_size = scale_for_display(
- content->video->scaled_size(film->frame_size()),
- player_video_container_size,
- film->frame_size(),
- content->video->pixel_quanta()
- );
+ _inter_size = content->video->scaled_size(player_video_container_size);
_out_size = player_video_container_size;
_colour_conversion = content->video->colour_conversion();
_video_range = content->video->range();
}
-dcp::Size
-scale_for_display (dcp::Size s, dcp::Size display_container, dcp::Size film_container, PixelQuanta quanta)
-{
- /* Now scale it down if the display container is smaller than the film container */
- if (display_container != film_container) {
- float const scale = min (
- float (display_container.width) / film_container.width,
- float (display_container.height) / film_container.height
- );
-
- s.width = lrintf (s.width * scale);
- s.height = lrintf (s.height * scale);
- s = quanta.round (s);
- }
-
- return s;
-}
-
-
dcp::DecryptedKDM
decrypt_kdm_with_helpful_error (dcp::EncryptedKDM kdm)
{
extern size_t utf8_strlen (std::string s);
extern void emit_subtitle_image (dcpomatic::ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size size, std::shared_ptr<TextDecoder> decoder);
extern void copy_in_bits (boost::filesystem::path from, boost::filesystem::path to, std::function<void (float)>);
-extern dcp::Size scale_for_display (dcp::Size s, dcp::Size display_container, dcp::Size film_container, PixelQuanta quanta);
extern dcp::DecryptedKDM decrypt_kdm_with_helpful_error (dcp::EncryptedKDM kdm);
extern boost::filesystem::path default_font_file ();
extern void start_of_thread (std::string name);