Use enum class for the things in types.h
[libdcp.git] / src / mono_picture_frame.h
index 87c5d6ab6c04c80ac565dd47c70ac704d67cb23a..67784509a7ba7d9169e79b95fe286c2add2238d3 100644 (file)
     files in the program, then also delete it here.
 */
 
+#ifndef LIBDCP_MONO_PICTURE_FRAME_H
+#define LIBDCP_MONO_PICTURE_FRAME_H
+
 /** @file  src/mono_picture_frame.h
  *  @brief MonoPictureFrame class.
  */
 
 #include "types.h"
-#include "mono_picture_asset_reader.h"
-#include <boost/shared_ptr.hpp>
+#include "asset_reader.h"
+#include <memory>
 #include <boost/noncopyable.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/optional.hpp>
@@ -55,30 +58,33 @@ namespace ASDCP {
 namespace dcp {
 
 class OpenJPEGImage;
-class DecryptionContext;
 
 /** @class MonoPictureFrame
  *  @brief A single frame of a 2D (monoscopic) picture asset.
  */
-class MonoPictureFrame : public boost::noncopyable
+class MonoPictureFrame : public Data, public boost::noncopyable
 {
 public:
        explicit MonoPictureFrame (boost::filesystem::path path);
        MonoPictureFrame (uint8_t const * data, int size);
-       ~MonoPictureFrame ();
 
-       boost::shared_ptr<OpenJPEGImage> xyz_image (int reduce = 0) const;
+       std::shared_ptr<OpenJPEGImage> xyz_image (int reduce = 0) const;
 
-       uint8_t const * j2k_data () const;
-       uint8_t* j2k_data ();
-       int j2k_size () const;
+       uint8_t const * data () const;
+       uint8_t* data ();
+       int size () const;
 
 private:
-       friend MonoPictureAssetReader;
+       /* XXX: this is a bit of a shame, but I tried friend MonoPictureAssetReader and it's
+          rejected by some (seemingly older) GCCs.
+       */
+       friend class AssetReader<ASDCP::JP2K::MXFReader, MonoPictureFrame>;
 
-       MonoPictureFrame (ASDCP::JP2K::MXFReader* reader, int n, boost::shared_ptr<DecryptionContext>);
+       MonoPictureFrame (ASDCP::JP2K::MXFReader* reader, int n, std::shared_ptr<DecryptionContext>);
 
-       ASDCP::JP2K::FrameBuffer* _buffer;
+       std::shared_ptr<ASDCP::JP2K::FrameBuffer> _buffer;
 };
 
 }
+
+#endif