summaryrefslogtreecommitdiff
path: root/src/stereo_picture_frame.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-07-09 10:00:34 +0100
committerCarl Hetherington <cth@carlh.net>2014-07-09 10:00:34 +0100
commit205fd96fc2592d5b50c91871fe0f2bd9d79783c5 (patch)
treeea646bc640e68d5cb9bf9248f1b3bd7c20191bf9 /src/stereo_picture_frame.cc
parent7c386ee3f400d80f043bc0b271a0184e35a08169 (diff)
Add method to return frames as RGB to a given buffer.
Diffstat (limited to 'src/stereo_picture_frame.cc')
-rw-r--r--src/stereo_picture_frame.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/stereo_picture_frame.cc b/src/stereo_picture_frame.cc
index 293573bd..9d9bef7d 100644
--- a/src/stereo_picture_frame.cc
+++ b/src/stereo_picture_frame.cc
@@ -87,6 +87,22 @@ StereoPictureFrame::argb_frame (Eye eye, int reduce, float srgb_gamma) const
return xyz_to_rgba (xyz_frame, GammaLUT::cache.get (12, DCI_GAMMA, false), GammaLUT::cache.get (12, 1 / srgb_gamma, false));
}
+void
+StereoPictureFrame::rgb_frame (Eye eye, uint8_t* buffer) const
+{
+ shared_ptr<XYZFrame> xyz_frame;
+ switch (eye) {
+ case LEFT:
+ xyz_frame = decompress_j2k (const_cast<uint8_t*> (_buffer->Left.RoData()), _buffer->Left.Size(), 0);
+ break;
+ case RIGHT:
+ xyz_frame = decompress_j2k (const_cast<uint8_t*> (_buffer->Right.RoData()), _buffer->Right.Size(), 0);
+ break;
+ }
+
+ return xyz_to_rgb (xyz_frame, GammaLUT::cache.get (12, DCI_GAMMA, false), GammaLUT::cache.get (12, 1 / 2.4, false), buffer);
+}
+
uint8_t const *
StereoPictureFrame::left_j2k_data () const
{