diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-08-17 00:41:58 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-08-17 00:41:58 +0100 |
| commit | 502475a5001f580a8540e84880564d9e4c7502d4 (patch) | |
| tree | c6d65e730d749dc47ff3345882da989b5eba201e /src | |
| parent | d8883a2742d289c2eab3dd4ef92839435b37c95c (diff) | |
Remove unused Image::crop.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/image.cc | 28 | ||||
| -rw-r--r-- | src/lib/image.h | 1 |
2 files changed, 0 insertions, 29 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc index 30b997737..04771a24b 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -208,34 +208,6 @@ Image::scale (dcp::Size out_size, dcp::YUVToRGB yuv_to_rgb, AVPixelFormat out_fo return scaled; } -shared_ptr<Image> -Image::crop (Crop crop, bool aligned) const -{ - dcp::Size cropped_size = crop.apply (size ()); - shared_ptr<Image> out (new Image (pixel_format(), cropped_size, aligned)); - - for (int c = 0; c < components(); ++c) { - int const crop_left_in_bytes = bytes_per_pixel(c) * crop.left; - /* bytes_per_pixel() could be a fraction; in this case the stride will be rounded - up, and we need to make sure that we copy over the width (up to the stride) - rather than short of the width; hence the ceil() here. - */ - int const cropped_width_in_bytes = ceil (bytes_per_pixel(c) * cropped_size.width); - - /* Start of the source line, cropped from the top but not the left */ - uint8_t* in_p = data()[c] + (crop.top / out->line_factor(c)) * stride()[c]; - uint8_t* out_p = out->data()[c]; - - for (int y = 0; y < out->lines(c); ++y) { - memcpy (out_p, in_p + crop_left_in_bytes, cropped_width_in_bytes); - in_p += stride()[c]; - out_p += out->stride()[c]; - } - } - - return out; -} - /** Blacken a YUV image whose bits per pixel is rounded up to 16 */ void Image::yuv_16_black (uint16_t v, bool alpha) diff --git a/src/lib/image.h b/src/lib/image.h index 89cd98f7b..492f6212e 100644 --- a/src/lib/image.h +++ b/src/lib/image.h @@ -59,7 +59,6 @@ public: int lines (int) const; boost::shared_ptr<Image> scale (dcp::Size, dcp::YUVToRGB yuv_to_rgb, AVPixelFormat, bool aligned) const; - boost::shared_ptr<Image> crop (Crop c, bool aligned) const; boost::shared_ptr<Image> crop_scale_window (Crop c, dcp::Size, dcp::Size, dcp::YUVToRGB yuv_to_rgb, AVPixelFormat, bool aligned) const; void make_black (); |
