diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-01-16 18:02:20 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-01-16 18:02:20 +0000 |
| commit | 76d7b8bd0de121a8015b595681844a5aec938d64 (patch) | |
| tree | 0c1b9455f071317960bfbe18477a2a44acbe8cd2 | |
| parent | eabc6fda9eaf2467e7130641bd8cf874a8886cd6 (diff) | |
Change default MonoPictureFrame constructor to something more useful.
| -rw-r--r-- | src/mono_picture_frame.cc | 6 | ||||
| -rw-r--r-- | src/mono_picture_frame.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/mono_picture_frame.cc b/src/mono_picture_frame.cc index 357bb849..143d447c 100644 --- a/src/mono_picture_frame.cc +++ b/src/mono_picture_frame.cc @@ -76,9 +76,11 @@ MonoPictureFrame::MonoPictureFrame (boost::filesystem::path path, int n, ASDCP:: } } -MonoPictureFrame::MonoPictureFrame () +MonoPictureFrame::MonoPictureFrame (uint8_t const * data, int size) { - _buffer = new ASDCP::JP2K::FrameBuffer (4 * Kumu::Megabyte); + _buffer = new ASDCP::JP2K::FrameBuffer (size); + _buffer->Size (size); + memcpy (_buffer->Data(), data, size); } /** MonoPictureFrame destructor */ diff --git a/src/mono_picture_frame.h b/src/mono_picture_frame.h index 68e4edf8..9e7a9926 100644 --- a/src/mono_picture_frame.h +++ b/src/mono_picture_frame.h @@ -48,7 +48,7 @@ class MonoPictureFrame : public boost::noncopyable public: MonoPictureFrame (boost::filesystem::path path, int n, ASDCP::AESDecContext *); MonoPictureFrame (boost::filesystem::path path); - MonoPictureFrame (); + MonoPictureFrame (uint8_t const * data, int size); ~MonoPictureFrame (); boost::shared_ptr<OpenJPEGImage> xyz_image (int reduce = 0) const; |
