X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fimage.h;h=172250eb1bb253ffd6a87e9998951ca6b534a7c3;hb=a4d8e5d24beddb719180e75f1047ae317bef85a4;hp=6af74a8c5ee16e641c817f27361b4757118e1295;hpb=d6be9f27147113dc6355ed0de7c99d1312aaeebd;p=dcpomatic.git diff --git a/src/lib/image.h b/src/lib/image.h index 6af74a8c5..172250eb1 100644 --- a/src/lib/image.h +++ b/src/lib/image.h @@ -31,16 +31,17 @@ extern "C" { #include #include } -#include +#include #include "util.h" #include "position.h" +#include "position_image.h" class Scaler; -class Image : public libdcp::Image +class Image : public dcp::Image { public: - Image (AVPixelFormat, libdcp::Size, bool); + Image (AVPixelFormat, dcp::Size, bool); Image (AVFrame *); Image (Image const &); Image (boost::shared_ptr, bool); @@ -50,20 +51,23 @@ public: uint8_t ** data () const; int * line_size () const; int * stride () const; - libdcp::Size size () const; + dcp::Size size () const; bool aligned () const; int components () const; int line_factor (int) const; int lines (int) const; - boost::shared_ptr scale (libdcp::Size, Scaler const *, AVPixelFormat, bool aligned) const; - boost::shared_ptr post_process (std::string, bool aligned) const; - void alpha_blend (boost::shared_ptr image, Position pos); - void copy (boost::shared_ptr image, Position pos); + boost::shared_ptr scale (dcp::Size, Scaler const *, AVPixelFormat, bool aligned) const; boost::shared_ptr crop (Crop c, bool aligned) const; + + boost::shared_ptr crop_scale_window (Crop c, dcp::Size, dcp::Size, Scaler const *, AVPixelFormat, bool aligned) const; void make_black (); + void make_transparent (); + void alpha_blend (boost::shared_ptr image, Position pos); + void copy (boost::shared_ptr image, Position pos); + void fade (float); void read_from_socket (boost::shared_ptr); void write_to_socket (boost::shared_ptr) const; @@ -72,13 +76,15 @@ public: return _pixel_format; } + std::string digest () const; + private: - friend class pixel_formats_test; + friend struct pixel_formats_test; void allocate (); void swap (Image &); float bytes_per_pixel (int) const; - void yuv_16_black (uint16_t); + void yuv_16_black (uint16_t, bool); static uint16_t swap_16 (uint16_t); AVPixelFormat _pixel_format; ///< FFmpeg's way of describing the pixel format of this Image @@ -88,4 +94,7 @@ private: bool _aligned; }; +extern PositionImage merge (std::list images); +extern bool operator== (Image const & a, Image const & b); + #endif