summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-12-13 21:22:30 +0100
committerCarl Hetherington <cth@carlh.net>2021-01-17 20:13:22 +0100
commit7701297decde2568e11feddede28177077e164cc (patch)
tree7e8b954131ec7b0acea562d00161e4b32e831a3f
parent5382d3e0e587b1882ea39be146bbd9dd5700c3bb (diff)
Extent black_image() to make images of any size.
-rw-r--r--test/test.cc6
-rw-r--r--test/test.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/test/test.cc b/test/test.cc
index af005e50..8092df4f 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -448,10 +448,10 @@ make_simple_with_smpte_ccaps (boost::filesystem::path path)
shared_ptr<dcp::OpenJPEGImage>
-black_image ()
+black_image (dcp::Size size)
{
- shared_ptr<dcp::OpenJPEGImage> image(new dcp::OpenJPEGImage(dcp::Size(1998, 1080)));
- int const pixels = 1998 * 1080;
+ shared_ptr<dcp::OpenJPEGImage> image(new dcp::OpenJPEGImage(size));
+ int const pixels = size.width * size.height;
for (int i = 0; i < 3; ++i) {
memset (image->data(i), 0, pixels * sizeof(int));
}
diff --git a/test/test.h b/test/test.h
index 1368973a..1d9cd921 100644
--- a/test/test.h
+++ b/test/test.h
@@ -50,7 +50,7 @@ extern std::shared_ptr<dcp::DCP> make_simple_with_interop_subs (boost::filesyste
extern std::shared_ptr<dcp::DCP> make_simple_with_smpte_subs (boost::filesystem::path path);
extern std::shared_ptr<dcp::DCP> make_simple_with_interop_ccaps (boost::filesystem::path path);
extern std::shared_ptr<dcp::DCP> make_simple_with_smpte_ccaps (boost::filesystem::path path);
-extern std::shared_ptr<dcp::OpenJPEGImage> black_image ();
+extern std::shared_ptr<dcp::OpenJPEGImage> black_image (dcp::Size size = dcp::Size(1998, 1080));
extern std::shared_ptr<dcp::ReelAsset> black_picture_asset (boost::filesystem::path dir, int frames = 24);
/** Creating an object of this class will make asdcplib's random number generation