mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 09:18:11 +00:00
LibGfx/ILBMLoader: Properly display images with a bitplane mask
Images with a display mask ("stencil" as it's called in DPaint) add an extra bitplane which acts as a mask. For now, at least skip it properly. Later we should render masked pixels as transparent, but this requires some refactoring.
This commit is contained in:
parent
45181e8eaf
commit
534eeb6c4b
3 changed files with 21 additions and 5 deletions
|
@ -265,6 +265,17 @@ TEST_CASE(test_small_24bit)
|
|||
EXPECT_EQ(frame.image->get_pixel(0, 4), Gfx::Color(1, 0, 1, 255));
|
||||
}
|
||||
|
||||
TEST_CASE(test_stencil_mask)
|
||||
{
|
||||
auto file = TRY_OR_FAIL(Core::MappedFile::map(TEST_INPUT("ilbm/test-stencil.iff"sv)));
|
||||
EXPECT(Gfx::ILBMImageDecoderPlugin::sniff(file->bytes()));
|
||||
auto plugin_decoder = TRY_OR_FAIL(Gfx::ILBMImageDecoderPlugin::create(file->bytes()));
|
||||
|
||||
auto frame = TRY_OR_FAIL(expect_single_frame_of_size(*plugin_decoder, { 320, 200 }));
|
||||
|
||||
EXPECT_EQ(frame.image->get_pixel(0, 4), Gfx::Color(0, 0, 0, 255));
|
||||
}
|
||||
|
||||
TEST_CASE(test_ilbm_malformed_header)
|
||||
{
|
||||
Array test_inputs = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue