diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-09-15 23:36:21 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-09-27 13:41:46 +0200 |
| commit | 3799e91d126d243d41c44dcb0ca1bfa66b53a57e (patch) | |
| tree | 74348b18d5ac0ef81bbebb27fe32862b22baa0b2 /src/lib/j2k_image_proxy.cc | |
| parent | 9bfa07293928c371d59db2091ba2b7e715ce5994 (diff) | |
Replace aligned bool with enum Alignment.
Diffstat (limited to 'src/lib/j2k_image_proxy.cc')
| -rw-r--r-- | src/lib/j2k_image_proxy.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/j2k_image_proxy.cc b/src/lib/j2k_image_proxy.cc index 21507ca15..00d3cf2ef 100644 --- a/src/lib/j2k_image_proxy.cc +++ b/src/lib/j2k_image_proxy.cc @@ -42,10 +42,8 @@ DCPOMATIC_ENABLE_WARNINGS using std::cout; using std::dynamic_pointer_cast; -using std::make_pair; using std::make_shared; using std::max; -using std::pair; using std::shared_ptr; using std::string; using boost::optional; @@ -120,7 +118,7 @@ J2KImageProxy::J2KImageProxy (shared_ptr<cxml::Node> xml, shared_ptr<Socket> soc int -J2KImageProxy::prepare (bool aligned, optional<dcp::Size> target_size) const +J2KImageProxy::prepare (Image::Alignment alignment, optional<dcp::Size> target_size) const { boost::mutex::scoped_lock lm (_mutex); @@ -145,7 +143,7 @@ J2KImageProxy::prepare (bool aligned, optional<dcp::Size> target_size) const try { /* XXX: should check that potentially trashing _data here doesn't matter */ auto decompressed = dcp::decompress_j2k (const_cast<uint8_t*>(_data->data()), _data->size(), reduce); - _image = make_shared<Image>(_pixel_format, decompressed->size(), aligned); + _image = make_shared<Image>(_pixel_format, decompressed->size(), alignment); int const shift = 16 - decompressed->precision (0); @@ -169,7 +167,7 @@ J2KImageProxy::prepare (bool aligned, optional<dcp::Size> target_size) const } } } catch (dcp::J2KDecompressionError& e) { - _image = make_shared<Image>(_pixel_format, _size, aligned); + _image = make_shared<Image>(_pixel_format, _size, alignment); _image->make_black (); _error = true; } @@ -182,9 +180,9 @@ J2KImageProxy::prepare (bool aligned, optional<dcp::Size> target_size) const ImageProxy::Result -J2KImageProxy::image (bool aligned, optional<dcp::Size> target_size) const +J2KImageProxy::image (Image::Alignment alignment, optional<dcp::Size> target_size) const { - int const r = prepare (aligned, target_size); + int const r = prepare (alignment, target_size); /* I think this is safe without a lock on mutex. _image is guaranteed to be set up when prepare() has happened. |
