- /* To DCP */
-
- // Flat in flat container
- test (
- dcp::Size (400, 200),
- dcp::Size (1998, 1080),
- dcp::Size (1998, 1080),
- Crop (0, 0, 0, 0),
- Ratio::from_id ("185"),
- true,
- dcp::Size (1998, 1080)
- );
-
- // Scope in flat container
- test (
- dcp::Size (400, 200),
- dcp::Size (1998, 1080),
- dcp::Size (1998, 1080),
- Crop (0, 0, 0, 0),
- Ratio::from_id ("239"),
- true,
- dcp::Size (1998, 837)
- );
-
- // Flat in scope container
- test (
- dcp::Size (400, 200),
- dcp::Size (2048, 858),
- dcp::Size (2048, 858),
- Crop (0, 0, 0, 0),
- Ratio::from_id ("185"),
- true,
- dcp::Size (1587, 858)
- );
-
-
- /* To player */
-
- // Flat in flat container
- test (
- dcp::Size (400, 200),
- dcp::Size (185, 100),
- dcp::Size (1998, 1080),
- Crop (0, 0, 0, 0),
- Ratio::from_id ("185"),
- true,
- dcp::Size (185, 100)
- );
-
- // Scope in flat container
- test (
- dcp::Size (400, 200),
- dcp::Size (185, 100),
- dcp::Size (1998, 1080),
- Crop (0, 0, 0, 0),
- Ratio::from_id ("239"),
- true,
- dcp::Size (185, 78)
- );
-
- // Flat in scope container
- test (
- dcp::Size (400, 200),
- dcp::Size (239, 100),
- dcp::Size (2048, 858),
- Crop (0, 0, 0, 0),
- Ratio::from_id ("185"),
- true,
- dcp::Size (185, 100)
- );
+ VideoContent vc (0);
+
+ vc._sample_aspect_ratio = 2;
+
+ /* Images at full size and in DCP-approved sizes that will not be scaled */
+ // Flat/scope content into flat/scope container
+ vc._size = dcp::Size (1998 / 2, 1080);
+ BOOST_CHECK_EQUAL (vc.scaled_size(FLAT), FLAT);
+ vc._size = dcp::Size (2048 / 2, 858);
+ BOOST_CHECK_EQUAL (vc.scaled_size(SCOPE), SCOPE);
+ // 1.33:1 into flat container
+ vc._size = dcp::Size (1436 / 2, 1080);
+ BOOST_CHECK_EQUAL (vc.scaled_size(FLAT), dcp::Size(FOUR_TO_THREE));
+ // Scope into flat container
+ vc._size = dcp::Size (2048 / 2, 858);
+ BOOST_CHECK_EQUAL (vc.scaled_size(FLAT), dcp::Size(1998, 837));
+
+ /* Smaller images but in the same ratios */
+ vc._size = dcp::Size(185, 200);
+ BOOST_CHECK_EQUAL (vc.scaled_size(FLAT), FLAT);
+ vc._size = dcp::Size(955, 800);
+ BOOST_CHECK_EQUAL (vc.scaled_size(SCOPE), SCOPE);
+ // 4:3 into flat container
+ vc._size = dcp::Size(133, 200);
+ BOOST_CHECK_EQUAL (vc.scaled_size(FLAT), dcp::Size(FOUR_TO_THREE));
+ // Scope into flat container
+ vc._size = dcp::Size(239, 200);
+ BOOST_CHECK_EQUAL (vc.scaled_size(FLAT), dcp::Size(1998, 836));
+
+ /* Images at full size that are not DCP-approved but will still remain unscaled */
+ vc._size = dcp::Size(600 / 2, 1080);
+ BOOST_CHECK_EQUAL (vc.scaled_size(FLAT), dcp::Size(600, 1080));
+ vc._size = dcp::Size(1700 / 2, 1080);
+ BOOST_CHECK_EQUAL (vc.scaled_size(FLAT), dcp::Size(1700, 1080));
+
+ /* Image at full size that is too big for the container and will be shrunk */
+ vc._size = dcp::Size(3000 / 2, 1080);
+ BOOST_CHECK_EQUAL (vc.scaled_size(FLAT), dcp::Size(1998, 719));