summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-01-02 23:35:43 +0000
committerCarl Hetherington <cth@carlh.net>2018-01-02 23:35:43 +0000
commitd80e5a10e99b81bb4c19a8c776769b99fa927b4e (patch)
treef3705ccc03fba04680e2667510ae3c16d232cf03 /src/lib
parent911067769c1e5cf5b1ccc5a517826a32d4061e6b (diff)
Add convert_pixel_format convenience function.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/image.cc6
-rw-r--r--src/lib/image.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc
index a6354f2d1..4371c5997 100644
--- a/src/lib/image.cc
+++ b/src/lib/image.cc
@@ -220,6 +220,12 @@ Image::crop_scale_window (
return out;
}
+shared_ptr<Image>
+Image::convert_pixel_format (dcp::YUVToRGB yuv_to_rgb, AVPixelFormat out_format, bool out_aligned, bool fast) const
+{
+ return scale(size(), yuv_to_rgb, out_format, out_aligned, fast);
+}
+
/** @param out_size Size to scale to.
* @param yuv_to_rgb YUVToRGB transform transform to use, if required.
* @param out_format Output pixel format.
diff --git a/src/lib/image.h b/src/lib/image.h
index ce57c5317..8de0a2c69 100644
--- a/src/lib/image.h
+++ b/src/lib/image.h
@@ -59,6 +59,7 @@ public:
dcp::Size sample_size (int) const;
float bytes_per_pixel (int) const;
+ boost::shared_ptr<Image> convert_pixel_format (dcp::YUVToRGB yuv_to_rgb, AVPixelFormat out_format, bool aligned, bool fast) const;
boost::shared_ptr<Image> scale (dcp::Size out_size, dcp::YUVToRGB yuv_to_rgb, AVPixelFormat out_format, bool aligned, bool fast) const;
boost::shared_ptr<Image> crop_scale_window (
Crop crop, dcp::Size inter_size, dcp::Size out_size, dcp::YUVToRGB yuv_to_rgb, AVPixelFormat out_format, bool aligned, bool fast