summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-07-26 13:21:40 +0100
committerCarl Hetherington <cth@carlh.net>2017-07-26 13:21:40 +0100
commitb395478cbb0706de2b6afa9a34fb33e49c61ee67 (patch)
treee773c3601c3c5f4d597d4786f4e0a99a44624817 /src
parentf0a9735731740bf9da24847294d9781f1bc3a331 (diff)
Rename some variables.
Diffstat (limited to 'src')
-rw-r--r--src/lib/j2k_image_proxy.cc24
-rw-r--r--src/lib/j2k_image_proxy.h4
2 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/j2k_image_proxy.cc b/src/lib/j2k_image_proxy.cc
index eea4b038a..f7e6dd5f4 100644
--- a/src/lib/j2k_image_proxy.cc
+++ b/src/lib/j2k_image_proxy.cc
@@ -96,7 +96,7 @@ J2KImageProxy::J2KImageProxy (shared_ptr<cxml::Node> xml, shared_ptr<Socket> soc
shared_ptr<Image>
J2KImageProxy::image (optional<dcp::NoteHandler>, optional<dcp::Size> target_size) const
{
- if (!_j2k || target_size != _j2k_target_size) {
+ if (!_decompressed || target_size != _target_size) {
int reduce = 0;
while (target_size && (_size.width / pow(2, reduce)) > target_size->width && (_size.height / pow(2, reduce)) > target_size->height) {
@@ -105,37 +105,37 @@ J2KImageProxy::image (optional<dcp::NoteHandler>, optional<dcp::Size> target_siz
--reduce;
reduce = max (0, reduce);
- _j2k = dcp::decompress_j2k (const_cast<uint8_t*> (_data.data().get()), _data.size (), reduce);
+ _decompressed = dcp::decompress_j2k (const_cast<uint8_t*> (_data.data().get()), _data.size (), reduce);
- if (_j2k->precision(0) < 12) {
- int const shift = 12 - _j2k->precision (0);
+ if (_decompressed->precision(0) < 12) {
+ int const shift = 12 - _decompressed->precision (0);
for (int c = 0; c < 3; ++c) {
- int* p = _j2k->data (c);
- for (int y = 0; y < _j2k->size().height; ++y) {
- for (int x = 0; x < _j2k->size().width; ++x) {
+ int* p = _decompressed->data (c);
+ for (int y = 0; y < _decompressed->size().height; ++y) {
+ for (int x = 0; x < _decompressed->size().width; ++x) {
*p++ <<= shift;
}
}
}
}
- _j2k_target_size = target_size;
+ _target_size = target_size;
}
- shared_ptr<Image> image (new Image (_pixel_format, _j2k->size(), true));
+ shared_ptr<Image> image (new Image (_pixel_format, _decompressed->size(), true));
/* Copy data in whatever format (sRGB or XYZ) into our Image; I'm assuming
the data is 12-bit either way.
*/
- int const width = _j2k->size().width;
+ int const width = _decompressed->size().width;
int p = 0;
- for (int y = 0; y < _j2k->size().height; ++y) {
+ for (int y = 0; y < _decompressed->size().height; ++y) {
uint16_t* q = (uint16_t *) (image->data()[0] + y * image->stride()[0]);
for (int x = 0; x < width; ++x) {
for (int c = 0; c < 3; ++c) {
- *q++ = _j2k->data(c)[p] << 4;
+ *q++ = _decompressed->data(c)[p] << 4;
}
++p;
}
diff --git a/src/lib/j2k_image_proxy.h b/src/lib/j2k_image_proxy.h
index 8fc9040d5..41d68588f 100644
--- a/src/lib/j2k_image_proxy.h
+++ b/src/lib/j2k_image_proxy.h
@@ -65,7 +65,7 @@ private:
dcp::Data _data;
dcp::Size _size;
boost::optional<dcp::Eye> _eye;
- mutable boost::shared_ptr<dcp::OpenJPEGImage> _j2k;
- mutable boost::optional<dcp::Size> _j2k_target_size;
+ mutable boost::shared_ptr<dcp::OpenJPEGImage> _decompressed;
+ mutable boost::optional<dcp::Size> _target_size;
AVPixelFormat _pixel_format;
};