Use a struct rather than a std::pair as the return type from ImageProxy::image.
[dcpomatic.git] / src / lib / j2k_image_proxy.cc
index 698943922a204920930ac8d8d04ec3fa5fa495e3..da3e23caf7bf64fd621fd74ee4cdfc8fe356b245 100644 (file)
@@ -137,7 +137,6 @@ J2KImageProxy::prepare (optional<dcp::Size> target_size) const
        }
 
        shared_ptr<dcp::OpenJPEGImage> decompressed = dcp::decompress_j2k (const_cast<uint8_t*> (_data.data().get()), _data.size (), reduce);
-
        _image.reset (new Image (_pixel_format, decompressed->size(), true));
 
        int const shift = 16 - decompressed->precision (0);
@@ -168,14 +167,15 @@ J2KImageProxy::prepare (optional<dcp::Size> target_size) const
        return reduce;
 }
 
-pair<shared_ptr<Image>, int>
-J2KImageProxy::image (optional<dcp::NoteHandler>, optional<dcp::Size> target_size) const
+
+ImageProxy::Result
+J2KImageProxy::image (optional<dcp::Size> target_size) const
 {
        int const r = prepare (target_size);
        /* I think this is safe without a lock on mutex.  _image is guaranteed to be
           set up when prepare() has happened.
        */
-       return make_pair (_image, r);
+       return Result (_image, r);
 }
 
 void