summaryrefslogtreecommitdiff
path: root/test/scaling_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-05-10 01:57:20 +0200
committerCarl Hetherington <cth@carlh.net>2020-05-11 22:02:49 +0200
commit15a83d720780d58f905d40f8493cdcb86596eaee (patch)
tree96edb81d905bed4231819efc5bd6292aefaf2c4c /test/scaling_test.cc
parentdd7c63112eda87f2e491261873075acff114396b (diff)
Change video content scaling so that it either:
1. scales the content up to fit the DCP container, preserving aspect ratio, or 2. stretches the content to a custom aspect ratio, or 3. scales the content to some custom size.
Diffstat (limited to 'test/scaling_test.cc')
-rw-r--r--test/scaling_test.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/scaling_test.cc b/test/scaling_test.cc
index 93c994741..dd3b6118e 100644
--- a/test/scaling_test.cc
+++ b/test/scaling_test.cc
@@ -34,9 +34,9 @@
using std::string;
using boost::shared_ptr;
-static void scaling_test_for (shared_ptr<Film> film, shared_ptr<Content> content, string image, string container)
+static void scaling_test_for (shared_ptr<Film> film, shared_ptr<Content> content, float ratio, std::string image, string container)
{
- content->video->set_scale (VideoContentScale (Ratio::from_id (image)));
+ content->video->set_custom_ratio (ratio);
film->set_container (Ratio::from_id (container));
film->set_interop (false);
film->make_dcp ();
@@ -71,16 +71,16 @@ BOOST_AUTO_TEST_CASE (scaling_test)
imc->video->set_length (1);
/* F-133: 133 image in a flat container */
- scaling_test_for (film, imc, "133", "185");
+ scaling_test_for (film, imc, 4.0 / 3, "133", "185");
/* F: flat image in a flat container */
- scaling_test_for (film, imc, "185", "185");
+ scaling_test_for (film, imc, 1.85, "185", "185");
/* F-S: scope image in a flat container */
- scaling_test_for (film, imc, "239", "185");
+ scaling_test_for (film, imc, 2.38695, "239", "185");
/* S-133: 133 image in a scope container */
- scaling_test_for (film, imc, "133", "239");
+ scaling_test_for (film, imc, 4.0 / 3, "133", "239");
/* S-F: flat image in a scope container */
- scaling_test_for (film, imc, "185", "239");
+ scaling_test_for (film, imc, 1.85, "185", "239");
/* S: scope image in a scope container */
- scaling_test_for (film, imc, "239", "239");
+ scaling_test_for (film, imc, 2.38695, "239", "239");
}