X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Ftest.cc;fp=test%2Ftest.cc;h=049d74676fd3742a40ac97e897e5ff6b21cdc2a1;hb=0efeb7c04566961b7d2d0745b63bc92f7f5b3b61;hp=02b567237b01dd20f9d4251686172872689af442;hpb=452e4844326048da0f1fdc8dbf623b43cb400798;p=dcpomatic.git diff --git a/test/test.cc b/test/test.cc index 02b567237..049d74676 100644 --- a/test/test.cc +++ b/test/test.cc @@ -1004,3 +1004,19 @@ Editor::replace(string a, string b) boost::algorithm::replace_all(_content, a, b); BOOST_REQUIRE(_content != old_content); } + + +void +write_openjpeg_image(shared_ptr image, boost::filesystem::path path) +{ + dcp::File output(path, "wb"); + + auto size = image->size(); + output.checked_write(&size.width, sizeof(size.width)); + output.checked_write(&size.height, sizeof(size.height)); + + for (int c = 0; c < 3; ++c) { + output.checked_write(image->data(c), size.width * size.height * sizeof(int)); + } +} +