1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

LibGfx/ILBMLoader: Add HAM6/HAM8 support

This commit is contained in:
Nicolas Ramz 2023-09-13 12:17:58 +02:00 committed by Andrew Kaster
parent 4699c81fc1
commit 8d68f94282
3 changed files with 67 additions and 6 deletions

View file

@ -138,6 +138,17 @@ TEST_CASE(test_ilbm_uncompressed)
EXPECT_EQ(frame.image->get_pixel(8, 0), Gfx::Color(0xee, 0xbb, 0, 255));
}
TEST_CASE(test_ilbm_ham6)
{
auto file = MUST(Core::MappedFile::map(TEST_INPUT("ilbm/ham6.iff"sv)));
EXPECT(Gfx::ILBMImageDecoderPlugin::sniff(file->bytes()));
auto plugin_decoder = MUST(Gfx::ILBMImageDecoderPlugin::create(file->bytes()));
auto frame = expect_single_frame_of_size(*plugin_decoder, { 256, 256 });
EXPECT_EQ(frame.image->get_pixel(77, 107), Gfx::Color(0xf0, 0x40, 0x40, 0xff));
}
TEST_CASE(test_ilbm_malformed_header)
{
Array test_inputs = {