Try removing the DCI companding from the xyz->rgb conversion.
[libdcp.git] / src / picture_asset.h
index 71900200ac52b15ccc6b8867ec1fad1438cfbd95..d3fabbbd902c7cd2f76b094a2ce9d47de45aaabe 100644 (file)
@@ -17,6 +17,9 @@
 
 */
 
+#ifndef LIBDCP_PICTURE_ASSET_H
+#define LIBDCP_PICTURE_ASSET_H
+
 /** @file  src/picture_asset.h
  *  @brief An asset made up of JPEG2000 files
  */
@@ -79,6 +82,23 @@ protected:
 
 class MonoPictureAsset;
 
+struct FrameInfo
+{
+       FrameInfo (uint64_t o, uint64_t s, std::string h)
+               : offset (o)
+               , size (s)
+               , hash (h)
+       {}
+
+       FrameInfo (std::istream& s);
+
+       void write (std::ostream& s);
+       
+       uint64_t offset;
+       uint64_t size;
+       std::string hash;
+};
+
 /** A helper class for writing to MonoPictureAssets progressively (i.e. writing frame-by-frame,
  *  rather than giving libdcp all the frames in one go).
  *
@@ -94,13 +114,15 @@ class MonoPictureAssetWriter
 public:
        ~MonoPictureAssetWriter ();
 
-       void write (uint8_t* data, int size);
+       FrameInfo write (uint8_t* data, int size);
+       void fake_write (int size);
        void finalize ();
 
 private:
        friend class MonoPictureAsset;
 
-       MonoPictureAssetWriter (MonoPictureAsset *);
+       MonoPictureAssetWriter (MonoPictureAsset *, bool);
+       void start (uint8_t *, int);
 
        /* no copy construction */
        MonoPictureAssetWriter (MonoPictureAssetWriter const &);
@@ -116,8 +138,10 @@ private:
        MonoPictureAsset* _asset;
        /** Number of picture frames written to the asset so far */
        int _frames_written;
+       bool _started;
        /** true if finalize() has been called */
        bool _finalized;
+       bool _overwrite;
 };
 
 /** A 2D (monoscopic) picture asset */
@@ -183,7 +207,7 @@ public:
        MonoPictureAsset (std::string directory, std::string mxf_name, int fps, Size size);
 
        /** Start a progressive write to a MonoPictureAsset */
-       boost::shared_ptr<MonoPictureAssetWriter> start_write ();
+       boost::shared_ptr<MonoPictureAssetWriter> start_write (bool);
 
        boost::shared_ptr<const MonoPictureFrame> get_frame (int n) const;
        bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, std::list<std::string>& notes) const;
@@ -205,3 +229,5 @@ public:
        
 
 }
+
+#endif