diff options
Diffstat (limited to 'Tests/LibGfx')
-rw-r--r-- | Tests/LibGfx/TestImageDecoder.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/LibGfx/TestImageDecoder.cpp b/Tests/LibGfx/TestImageDecoder.cpp index 564d0be3a0..74c5c40418 100644 --- a/Tests/LibGfx/TestImageDecoder.cpp +++ b/Tests/LibGfx/TestImageDecoder.cpp @@ -330,6 +330,22 @@ TEST_CASE(test_webp_extended_lossless) EXPECT(!plugin_decoder->loop_count()); EXPECT_EQ(plugin_decoder->size(), Gfx::IntSize(417, 223)); + + auto frame = MUST(plugin_decoder->frame(0)); + EXPECT_EQ(frame.image->size(), Gfx::IntSize(417, 223)); + + // Check some basic pixels. + EXPECT_EQ(frame.image->get_pixel(0, 0), Gfx::Color(0, 0, 0, 0)); + EXPECT_EQ(frame.image->get_pixel(43, 75), Gfx::Color(255, 0, 0, 255)); + EXPECT_EQ(frame.image->get_pixel(141, 75), Gfx::Color(0, 255, 0, 255)); + EXPECT_EQ(frame.image->get_pixel(235, 75), Gfx::Color(0, 0, 255, 255)); + EXPECT_EQ(frame.image->get_pixel(341, 75), Gfx::Color(0, 0, 0, 128)); + + // Check pixels using the color cache. + EXPECT_EQ(frame.image->get_pixel(94, 73), Gfx::Color(255, 0, 0, 255)); + EXPECT_EQ(frame.image->get_pixel(176, 115), Gfx::Color(0, 255, 0, 255)); + EXPECT_EQ(frame.image->get_pixel(290, 89), Gfx::Color(0, 0, 255, 255)); + EXPECT_EQ(frame.image->get_pixel(359, 73), Gfx::Color(0, 0, 0, 128)); } TEST_CASE(test_webp_extended_lossless_animated) |