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.
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
{
shared_ptr<MagickImageProxy> proxy (new MagickImageProxy (private_data / "prophet_frame.tiff"));
shared_ptr<Image> raw = proxy->image();
- shared_ptr<Image> background = raw->scale (raw->size(), dcp::YUV_TO_RGB_REC709, format, true, false);
+ shared_ptr<Image> background = raw->convert_pixel_format (dcp::YUV_TO_RGB_REC709, format, true, false);
shared_ptr<Image> overlay (new Image (AV_PIX_FMT_RGBA, raw->size(), true));
overlay->make_transparent ();
background->alpha_blend (overlay, Position<int> (0, 0));
- shared_ptr<Image> save = background->scale (background->size(), dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGB24, false, false);
+ shared_ptr<Image> save = background->convert_pixel_format (dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGB24, false, false);
write_image (save, "build/test/image_test_" + suffix + ".png", "RGB");
check_image ("build/test/image_test_" + suffix + ".png", private_data / ("image_test_" + suffix + ".png"));