summaryrefslogtreecommitdiff
path: root/test/image_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-12-18 21:26:05 +0100
committerCarl Hetherington <cth@carlh.net>2022-04-29 00:11:17 +0200
commit7ec6c86c913fba820870565ee757fdf43ae47433 (patch)
tree7cdc265ffd2048550afe90cf7a087175ea264364 /test/image_test.cc
parent4673b12dcf6340862f9f4f72fc6dca8553130b55 (diff)
Move Image::as_png() out to image_as_png().
Diffstat (limited to 'test/image_test.cc')
-rw-r--r--test/image_test.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/image_test.cc b/test/image_test.cc
index 7369bd24f..18d96d4fc 100644
--- a/test/image_test.cc
+++ b/test/image_test.cc
@@ -30,6 +30,7 @@
#include "lib/image.h"
#include "lib/image_content.h"
#include "lib/image_decoder.h"
+#include "lib/image_png.h"
#include "lib/ffmpeg_image_proxy.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
@@ -375,8 +376,8 @@ BOOST_AUTO_TEST_CASE (as_png_test)
auto proxy = make_shared<FFmpegImageProxy>("test/data/3d_test/000001.png");
auto image_rgb = proxy->image(Image::Alignment::PADDED).image;
auto image_bgr = image_rgb->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_BGRA, Image::Alignment::PADDED, false);
- image_rgb->as_png().write ("build/test/as_png_rgb.png");
- image_bgr->as_png().write ("build/test/as_png_bgr.png");
+ image_as_png(image_rgb).write ("build/test/as_png_rgb.png");
+ image_as_png(image_bgr).write ("build/test/as_png_bgr.png");
check_image ("test/data/3d_test/000001.png", "build/test/as_png_rgb.png");
check_image ("test/data/3d_test/000001.png", "build/test/as_png_bgr.png");
@@ -391,7 +392,7 @@ fade_test_format_black (AVPixelFormat f, string name)
yuv.make_black ();
yuv.fade (0);
string const filename = "fade_test_black_" + name + ".png";
- yuv.convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGBA, Image::Alignment::PADDED, false)->as_png().write("build/test/" + filename);
+ image_as_png(yuv.convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGBA, Image::Alignment::PADDED, false)).write("build/test/" + filename);
check_image ("test/data/" + filename, "build/test/" + filename);
}
@@ -404,7 +405,7 @@ fade_test_format_red (AVPixelFormat f, float amount, string name)
auto red = proxy->image(Image::Alignment::PADDED).image->convert_pixel_format(dcp::YUVToRGB::REC709, f, Image::Alignment::PADDED, false);
red->fade (amount);
string const filename = "fade_test_red_" + name + ".png";
- red->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGBA, Image::Alignment::PADDED, false)->as_png().write("build/test/" + filename);
+ image_as_png(red->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGBA, Image::Alignment::PADDED, false)).write("build/test/" + filename);
check_image ("test/data/" + filename, "build/test/" + filename);
}