Use convert_pixel_format a little.
authorCarl Hetherington <cth@carlh.net>
Wed, 3 Jan 2018 00:00:06 +0000 (00:00 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 3 Jan 2018 00:00:06 +0000 (00:00 +0000)
src/lib/image.cc

index 4371c5997ce22207a2411e9cbf1786dee05334fd..989187c12fb64b0862c8495930d7292bd09dcc97 100644 (file)
@@ -585,7 +585,7 @@ Image::alpha_blend (shared_ptr<const Image> other, Position<int> position)
        }
        case AV_PIX_FMT_YUV420P:
        {
-               shared_ptr<Image> yuv = other->scale (other->size(), dcp::YUV_TO_RGB_REC709, _pixel_format, false, false);
+               shared_ptr<Image> yuv = other->convert_pixel_format (dcp::YUV_TO_RGB_REC709, _pixel_format, false, false);
                component<uint8_t> (0, this, yuv, other, start_tx, start_ty, start_ox, start_oy);
                component<uint8_t> (1, this, yuv, other, start_tx, start_ty, start_ox, start_oy);
                component<uint8_t> (2, this, yuv, other, start_tx, start_ty, start_ox, start_oy);
@@ -594,7 +594,7 @@ Image::alpha_blend (shared_ptr<const Image> other, Position<int> position)
        case AV_PIX_FMT_YUV420P10:
        case AV_PIX_FMT_YUV422P10LE:
        {
-               shared_ptr<Image> yuv = other->scale (other->size(), dcp::YUV_TO_RGB_REC709, _pixel_format, false, false);
+               shared_ptr<Image> yuv = other->convert_pixel_format (dcp::YUV_TO_RGB_REC709, _pixel_format, false, false);
                component<uint16_t> (0, this, yuv, other, start_tx, start_ty, start_ox, start_oy);
                component<uint8_t>  (1, this, yuv, other, start_tx, start_ty, start_ox, start_oy);
                component<uint8_t>  (2, this, yuv, other, start_tx, start_ty, start_ox, start_oy);