X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fj2k_image_proxy.h;h=1d34e7f84e1a218ebc40b052e78a1b6b1cb1feb6;hb=3b932abd0c7634483911e1d5361e12b2d094ae6f;hp=d7b5c83fc443d36e2c79b98b641067fea695c924;hpb=04eebe07e2f64bd15f6887a10ab51fb92c52901a;p=dcpomatic.git diff --git a/src/lib/j2k_image_proxy.h b/src/lib/j2k_image_proxy.h index d7b5c83fc..1d34e7f84 100644 --- a/src/lib/j2k_image_proxy.h +++ b/src/lib/j2k_image_proxy.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,30 +17,49 @@ */ -#include #include "image_proxy.h" +#include "data.h" +#include -class EncodedData; +namespace dcp { + class MonoPictureFrame; + class StereoPictureFrame; +} + +class Data; class J2KImageProxy : public ImageProxy { public: - J2KImageProxy (boost::shared_ptr frame, dcp::Size, boost::shared_ptr log); - J2KImageProxy (boost::shared_ptr frame, dcp::Size, dcp::Eye, boost::shared_ptr log); - J2KImageProxy (boost::shared_ptr xml, boost::shared_ptr socket, boost::shared_ptr log); + J2KImageProxy (boost::filesystem::path path, dcp::Size); + J2KImageProxy (boost::shared_ptr frame, dcp::Size); + J2KImageProxy (boost::shared_ptr frame, dcp::Size, dcp::Eye); + J2KImageProxy (boost::shared_ptr xml, boost::shared_ptr socket); - boost::shared_ptr image () const; + boost::shared_ptr image (boost::optional note = boost::optional ()) const; void add_metadata (xmlpp::Node *) const; void send_binary (boost::shared_ptr) const; + /** @return true if our image is definitely the same as another, false if it is probably not */ + bool same (boost::shared_ptr) const; + AVPixelFormat pixel_format () const; + + Data j2k () const { + return _data; + } - boost::shared_ptr j2k () const; dcp::Size size () const { return _size; } - + private: - boost::shared_ptr _mono; - boost::shared_ptr _stereo; + friend struct client_server_test_j2k; + + /* For tests */ + J2KImageProxy (Data data, dcp::Size size); + void ensure_j2k () const; + + Data _data; dcp::Size _size; - dcp::Eye _eye; + boost::optional _eye; + mutable boost::shared_ptr _j2k; };