From 429e42c019889e90c9e376170b08614654231337 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 14 Oct 2012 13:15:36 +0100 Subject: [PATCH] Remove believed-unnecessary PostProcessImage. --- src/lib/image.cc | 45 ++------------------------------------------- src/lib/image.h | 23 ++--------------------- 2 files changed, 4 insertions(+), 64 deletions(-) diff --git a/src/lib/image.cc b/src/lib/image.cc index 8fd43093d..98c5228a9 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -167,10 +167,10 @@ Image::scale_and_convert_to_rgb (Size out_size, int padding, Scaler const * scal * @param pp Flags for the required set of post processes. * @return Post-processed image. */ -shared_ptr +shared_ptr Image::post_process (string pp) const { - shared_ptr out (new PostProcessImage (PIX_FMT_YUV420P, size ())); + shared_ptr out (new SimpleImage (PIX_FMT_YUV420P, size ())); pp_mode* mode = pp_get_mode_by_name_and_quality (pp.c_str (), PP_QUALITY_MAX); pp_context* context = pp_get_context (size().width, size().height, PP_FORMAT_420 | PP_CPU_CAPS_MMX2); @@ -344,44 +344,3 @@ RGBFrameImage::size () const { return _size; } - -PostProcessImage::PostProcessImage (PixelFormat p, Size s) - : Image (p) - , _size (s) -{ - _data = new uint8_t*[4]; - _line_size = new int[4]; - - for (int i = 0; i < 4; ++i) { - _data[i] = (uint8_t *) av_malloc (s.width * s.height); - _line_size[i] = s.width; - } -} - -PostProcessImage::~PostProcessImage () -{ - for (int i = 0; i < 4; ++i) { - av_free (_data[i]); - } - - delete[] _data; - delete[] _line_size; -} - -uint8_t ** -PostProcessImage::data () const -{ - return _data; -} - -int * -PostProcessImage::line_size () const -{ - return _line_size; -} - -Size -PostProcessImage::size () const -{ - return _size; -} diff --git a/src/lib/image.h b/src/lib/image.h index d10bcae9e..e06a82b7f 100644 --- a/src/lib/image.h +++ b/src/lib/image.h @@ -34,7 +34,7 @@ extern "C" { class Scaler; class RGBFrameImage; -class PostProcessImage; +class SimpleImage; /** @class Image * @brief Parent class for wrappers of some image, in some format, that @@ -67,7 +67,7 @@ public: int lines (int) const; boost::shared_ptr scale_and_convert_to_rgb (Size, int, Scaler const *) const; boost::shared_ptr scale (Size, Scaler const *) const; - boost::shared_ptr post_process (std::string) const; + boost::shared_ptr post_process (std::string) const; void make_black (); @@ -137,23 +137,4 @@ private: uint8_t* _data; }; -/** @class PostProcessImage - * @brief An image that is the result of an FFmpeg post-processing run. - */ -class PostProcessImage : public Image -{ -public: - PostProcessImage (PixelFormat, Size); - ~PostProcessImage (); - - uint8_t ** data () const; - int * line_size () const; - Size size () const; - -private: - Size _size; - uint8_t** _data; - int* _line_size; -}; - #endif -- 2.30.2