X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fimage.h;h=16fbd28c24b93c4064045368cf87e171444c16c9;hb=fdd63a4c9925f0339089dce3a52f0d6ed0d97880;hp=f40ea92809a476babadefbbef113a86504c26828;hpb=62365221dd3cd80d6b771e9bf22b4f9365ee096a;p=dcpomatic.git diff --git a/src/lib/image.h b/src/lib/image.h index f40ea9280..16fbd28c2 100644 --- a/src/lib/image.h +++ b/src/lib/image.h @@ -32,7 +32,6 @@ extern "C" { #include } #include "util.h" -#include "ffmpeg_compatibility.h" class Scaler; class RGBFrameImage; @@ -92,18 +91,23 @@ protected: virtual void swap (Image &); float bytes_per_pixel (int) const; -private: + friend class pixel_formats_test; + +private: + void yuv_16_black (uint16_t); + static uint16_t swap_16 (uint16_t); + AVPixelFormat _pixel_format; ///< FFmpeg's way of describing the pixel format of this Image }; -/** @class FilterBufferImage - * @brief An Image that is held in an AVFilterBufferRef. +/** @class FrameImage + * @brief An Image that is held in an AVFrame. */ -class FilterBufferImage : public Image +class FrameImage : public Image { public: - FilterBufferImage (AVPixelFormat, AVFilterBufferRef *); - ~FilterBufferImage (); + FrameImage (AVFrame *, bool); + ~FrameImage (); uint8_t ** data () const; int * line_size () const; @@ -113,10 +117,11 @@ public: private: /* Not allowed */ - FilterBufferImage (FilterBufferImage const &); - FilterBufferImage& operator= (FilterBufferImage const &); + FrameImage (FrameImage const &); + FrameImage& operator= (FrameImage const &); - AVFilterBufferRef* _buffer; + AVFrame* _frame; + bool _own; int* _line_size; }; @@ -128,6 +133,7 @@ class SimpleImage : public Image public: SimpleImage (AVPixelFormat, libdcp::Size, bool); SimpleImage (SimpleImage const &); + SimpleImage (boost::shared_ptr); SimpleImage& operator= (SimpleImage const &); ~SimpleImage ();