diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-01-25 01:21:51 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-01-25 01:21:51 +0000 |
| commit | 103c20d48c22f0c604e402de41bce7336ef9b386 (patch) | |
| tree | 67d9483b0a1133cc115765a84d2265290ade9447 | |
| parent | dcdd532760f8970505b7fa5c83f86fbe39a73148 (diff) | |
Allow changing of MXF directory / filename; un-expose ASDCP frame buffer classes in the API.
| -rw-r--r-- | src/asset.h | 8 | ||||
| -rw-r--r-- | src/picture_asset.cc | 12 | ||||
| -rw-r--r-- | src/picture_frame.cc | 36 | ||||
| -rw-r--r-- | src/picture_frame.h | 12 |
4 files changed, 56 insertions, 12 deletions
diff --git a/src/asset.h b/src/asset.h index 3ba0a0cf..436e8b41 100644 --- a/src/asset.h +++ b/src/asset.h @@ -71,6 +71,14 @@ public: } boost::filesystem::path path () const; + + void set_directory (std::string d) { + _directory = d; + } + + void set_file_name (std::string f) { + _file_name = f; + } virtual bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, std::list<std::string>& notes) const = 0; diff --git a/src/picture_asset.cc b/src/picture_asset.cc index c3b49668..cd6dd4dc 100644 --- a/src/picture_asset.cc +++ b/src/picture_asset.cc @@ -260,8 +260,8 @@ MonoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, li if (!frame_buffer_equals ( i, opt, notes, - frame_A->j2k_frame()->RoData(), frame_A->j2k_frame()->Size(), - frame_B->j2k_frame()->RoData(), frame_B->j2k_frame()->Size() + frame_A->j2k_data(), frame_A->j2k_size(), + frame_B->j2k_data(), frame_B->j2k_size() )) { return false; } @@ -286,16 +286,16 @@ StereoPictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, if (!frame_buffer_equals ( i, opt, notes, - frame_A->j2k_frame()->Left.RoData(), frame_A->j2k_frame()->Left.Size(), - frame_B->j2k_frame()->Left.RoData(), frame_B->j2k_frame()->Left.Size() + frame_A->left_j2k_data(), frame_A->left_j2k_size(), + frame_B->left_j2k_data(), frame_B->left_j2k_size() )) { return false; } if (!frame_buffer_equals ( i, opt, notes, - frame_A->j2k_frame()->Right.RoData(), frame_A->j2k_frame()->Right.Size(), - frame_B->j2k_frame()->Right.RoData(), frame_B->j2k_frame()->Right.Size() + frame_A->right_j2k_data(), frame_A->right_j2k_size(), + frame_B->right_j2k_data(), frame_B->right_j2k_size() )) { return false; } diff --git a/src/picture_frame.cc b/src/picture_frame.cc index a2b90a0b..907f70ab 100644 --- a/src/picture_frame.cc +++ b/src/picture_frame.cc @@ -54,6 +54,18 @@ MonoPictureFrame::~MonoPictureFrame () delete _buffer; } +uint8_t const * +MonoPictureFrame::j2k_data () const +{ + return _buffer->RoData (); +} + +int +MonoPictureFrame::j2k_size () const +{ + return _buffer->Size (); +} + /** @param reduce a factor by which to reduce the resolution * of the image, expressed as a power of two (pass 0 for no * reduction). @@ -127,3 +139,27 @@ StereoPictureFrame::argb_frame (Eye eye, int reduce) const opj_image_destroy (xyz_frame); return f; } + +uint8_t const * +StereoPictureFrame::left_j2k_data () const +{ + return _buffer->Left.RoData (); +} + +int +StereoPictureFrame::left_j2k_size () const +{ + return _buffer->Left.Size (); +} + +uint8_t const * +StereoPictureFrame::right_j2k_data () const +{ + return _buffer->Right.RoData (); +} + +int +StereoPictureFrame::right_j2k_size () const +{ + return _buffer->Right.Size (); +} diff --git a/src/picture_frame.h b/src/picture_frame.h index ad51abed..20ce069e 100644 --- a/src/picture_frame.h +++ b/src/picture_frame.h @@ -41,9 +41,8 @@ public: ~MonoPictureFrame (); boost::shared_ptr<ARGBFrame> argb_frame (int reduce = 0) const; - ASDCP::JP2K::FrameBuffer* j2k_frame () const { - return _buffer; - } + uint8_t const * j2k_data () const; + int j2k_size () const; private: ASDCP::JP2K::FrameBuffer* _buffer; @@ -57,9 +56,10 @@ public: ~StereoPictureFrame (); boost::shared_ptr<ARGBFrame> argb_frame (Eye eye, int reduce = 0) const; - ASDCP::JP2K::SFrameBuffer* j2k_frame () const { - return _buffer; - } + uint8_t const * left_j2k_data () const; + int left_j2k_size () const; + uint8_t const * right_j2k_data () const; + int right_j2k_size () const; private: ASDCP::JP2K::SFrameBuffer* _buffer; |
