diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-07-18 01:32:42 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-07-18 01:32:42 +0100 |
| commit | 62d7752eacb997e830c794e046a42faa1b2e438f (patch) | |
| tree | 3409b05cd96abb5c04ca2fcb99c9b38a54b2f467 | |
| parent | b7115454679f39c296c779eeb71d257e77efd62d (diff) | |
Add some asserts.
| -rw-r--r-- | src/lib/j2k_image_proxy.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/j2k_image_proxy.cc b/src/lib/j2k_image_proxy.cc index 9100414e4..a46cda13c 100644 --- a/src/lib/j2k_image_proxy.cc +++ b/src/lib/j2k_image_proxy.cc @@ -53,7 +53,8 @@ J2KImageProxy::J2KImageProxy (boost::filesystem::path path, dcp::Size size, AVPi , _size (size) , _pixel_format (pixel_format) { - + /* ::image assumes 16bpp */ + DCPOMATIC_ASSERT (_pixel_format == AV_PIX_FMT_RGB48 || _pixel_format == AV_PIX_FMT_XYZ12LE); } J2KImageProxy::J2KImageProxy ( @@ -67,6 +68,8 @@ J2KImageProxy::J2KImageProxy ( , _pixel_format (pixel_format) , _forced_reduction (forced_reduction) { + /* ::image assumes 16bpp */ + DCPOMATIC_ASSERT (_pixel_format == AV_PIX_FMT_RGB48 || _pixel_format == AV_PIX_FMT_XYZ12LE); memcpy (_data.data().get(), frame->j2k_data(), _data.size ()); } @@ -82,6 +85,8 @@ J2KImageProxy::J2KImageProxy ( , _pixel_format (pixel_format) , _forced_reduction (forced_reduction) { + /* ::image assumes 16bpp */ + DCPOMATIC_ASSERT (_pixel_format == AV_PIX_FMT_RGB48 || _pixel_format == AV_PIX_FMT_XYZ12LE); switch (eye) { case dcp::EYE_LEFT: _data = Data (frame->left_j2k_size ()); @@ -217,7 +222,8 @@ J2KImageProxy::J2KImageProxy (Data data, dcp::Size size, AVPixelFormat pixel_for , _size (size) , _pixel_format (pixel_format) { - + /* ::image assumes 16bpp */ + DCPOMATIC_ASSERT (_pixel_format == AV_PIX_FMT_RGB48 || _pixel_format == AV_PIX_FMT_XYZ12LE); } size_t |
