X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fj2k_image_proxy.h;h=ec99e71a938c19c0b39d9af4c26d4a9baccf8f78;hb=3b31d2d8a129ae6d8d267427bd6b5bc444b40b2a;hp=c20d89340318b2040bf3fc60a6c26b8d95e70845;hpb=0253b4e45c71a1c2e2a8bffaf1c3cb84a0a3e41a;p=dcpomatic.git diff --git a/src/lib/j2k_image_proxy.h b/src/lib/j2k_image_proxy.h index c20d89340..ec99e71a9 100644 --- a/src/lib/j2k_image_proxy.h +++ b/src/lib/j2k_image_proxy.h @@ -50,8 +50,7 @@ public: J2KImageProxy (boost::shared_ptr xml, boost::shared_ptr socket); - boost::shared_ptr image ( - boost::optional note = boost::optional (), + Result image ( boost::optional size = boost::optional () ) const; @@ -59,10 +58,7 @@ public: 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; - void prepare (boost::optional = boost::optional()) const; - AVPixelFormat pixel_format () const { - return _pixel_format; - } + int prepare (boost::optional = boost::optional()) const; dcp::Data j2k () const { return _data; @@ -72,6 +68,8 @@ public: return _size; } + size_t memory_used () const; + private: friend struct client_server_test_j2k; @@ -81,8 +79,9 @@ private: dcp::Data _data; dcp::Size _size; boost::optional _eye; - mutable boost::shared_ptr _decompressed; + mutable boost::shared_ptr _image; mutable boost::optional _target_size; + mutable boost::optional _reduce; AVPixelFormat _pixel_format; mutable boost::mutex _mutex; boost::optional _forced_reduction;