/** Construct a J2KImageProxy from a JPEG2000 file */
J2KImageProxy::J2KImageProxy (boost::filesystem::path path, dcp::Size size, AVPixelFormat pixel_format)
: _data (new dcp::ArrayData(path))
/** Construct a J2KImageProxy from a JPEG2000 file */
J2KImageProxy::J2KImageProxy (boost::filesystem::path path, dcp::Size size, AVPixelFormat pixel_format)
: _data (new dcp::ArrayData(path))
- _size = dcp::Size (xml->number_child<int> ("Width"), xml->number_child<int> ("Height"));
- if (xml->optional_number_child<int> ("Eye")) {
- _eye = static_cast<dcp::Eye> (xml->number_child<int> ("Eye"));
+ _size = dcp::Size (xml->number_child<int>("Width"), xml->number_child<int>("Height"));
+ if (xml->optional_number_child<int>("Eye")) {
+ _eye = static_cast<dcp::Eye>(xml->number_child<int>("Eye"));
}
shared_ptr<ArrayData> data(new ArrayData(xml->number_child<int>("Size")));
/* This only matters when we are using J2KImageProxy for the preview, which
}
shared_ptr<ArrayData> data(new ArrayData(xml->number_child<int>("Size")));
/* This only matters when we are using J2KImageProxy for the preview, which
- shared_ptr<dcp::OpenJPEGImage> decompressed = dcp::decompress_j2k (const_cast<uint8_t*>(_data->data()), _data->size(), reduce);
+ auto decompressed = dcp::decompress_j2k (const_cast<uint8_t*>(_data->data()), _data->size(), reduce);
_image.reset (new Image (_pixel_format, decompressed->size(), true));
int const shift = 16 - decompressed->precision (0);
_image.reset (new Image (_pixel_format, decompressed->size(), true));
int const shift = 16 - decompressed->precision (0);
int* decomp_1 = decompressed->data (1);
int* decomp_2 = decompressed->data (2);
for (int y = 0; y < decompressed->size().height; ++y) {
int* decomp_1 = decompressed->data (1);
int* decomp_2 = decompressed->data (2);
for (int y = 0; y < decompressed->size().height; ++y) {
for (int x = 0; x < width; ++x) {
*q++ = decomp_0[p] << shift;
*q++ = decomp_1[p] << shift;
for (int x = 0; x < width; ++x) {
*q++ = decomp_0[p] << shift;
*q++ = decomp_1[p] << shift;
- node->add_child("Type")->add_child_text (N_("J2K"));
- node->add_child("Width")->add_child_text (raw_convert<string> (_size.width));
- node->add_child("Height")->add_child_text (raw_convert<string> (_size.height));
+ node->add_child("Type")->add_child_text(N_("J2K"));
+ node->add_child("Width")->add_child_text(raw_convert<string>(_size.width));
+ node->add_child("Height")->add_child_text(raw_convert<string>(_size.height));
void
J2KImageProxy::write_to_socket (shared_ptr<Socket> socket) const
{
socket->write (_data->data(), _data->size());
}
void
J2KImageProxy::write_to_socket (shared_ptr<Socket> socket) const
{
socket->write (_data->data(), _data->size());
}
J2KImageProxy::J2KImageProxy (ArrayData data, dcp::Size size, AVPixelFormat pixel_format)
: _data (new ArrayData(data))
, _size (size)
J2KImageProxy::J2KImageProxy (ArrayData data, dcp::Size size, AVPixelFormat pixel_format)
: _data (new ArrayData(data))
, _size (size)