summaryrefslogtreecommitdiff
path: root/src/mono_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/mono_picture_frame.cc
parent7c386ee3f400d80f043bc0b271a0184e35a08169 (diff)
Add method to return frames as RGB to a given buffer.
Diffstat (limited to 'src/mono_picture_frame.cc')
-rw-r--r--src/mono_picture_frame.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mono_picture_frame.cc b/src/mono_picture_frame.cc
index ec60104d..c2503a64 100644
--- a/src/mono_picture_frame.cc
+++ b/src/mono_picture_frame.cc
@@ -96,3 +96,13 @@ MonoPictureFrame::argb_frame (int reduce, float srgb_gamma) const
GammaLUT::cache.get (12, DCI_GAMMA, false), GammaLUT::cache.get (12, 1 / srgb_gamma, false)
);
}
+
+void
+MonoPictureFrame::rgb_frame (uint8_t* buffer) const
+{
+ xyz_to_rgb (
+ decompress_j2k (const_cast<uint8_t*> (_buffer->RoData()), _buffer->Size(), 0),
+ GammaLUT::cache.get (12, DCI_GAMMA, false), GammaLUT::cache.get (12, 1 / 2.4, false),
+ buffer
+ );
+}