From 45f9912aa850546e319e32a4052517d67f4e3d8f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 15 Oct 2013 15:26:04 +0100 Subject: Allow no-stretch scaling of video content. --- src/lib/util.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/lib/util.cc') diff --git a/src/lib/util.cc b/src/lib/util.cc index b13d905bf..1c4347233 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -882,3 +882,12 @@ make_signer () return shared_ptr (new libdcp::Signer (chain, signer_key)); } +libdcp::Size +fit_ratio_within (float ratio, libdcp::Size full_frame) +{ + if (ratio < full_frame.ratio ()) { + return libdcp::Size (full_frame.height * ratio, full_frame.height); + } + + return libdcp::Size (full_frame.width, full_frame.width / ratio); +} -- cgit v1.2.3