mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
LibGfx/ILBM: Add support for uncompressed files
This commit is contained in:
parent
80a78c4deb
commit
b8f8b22aa5
Notes:
sideshowbarker
2024-07-16 21:45:42 +09:00
Author: https://github.com/warpdesign
Commit: b8f8b22aa5
Pull-request: https://github.com/SerenityOS/serenity/pull/21025
Reviewed-by: https://github.com/AtkinsSJ ✅
3 changed files with 21 additions and 8 deletions
|
@ -193,17 +193,17 @@ static ErrorOr<void> decode_body_chunk(Chunk body_chunk, ILBMLoadingContext& con
|
|||
{
|
||||
dbgln_if(ILBM_DEBUG, "decode_body_chunk {}", body_chunk.data.size());
|
||||
|
||||
if (context.bm_header.compression == CompressionType::ByteRun) {
|
||||
// these are the uncompressed interleaved bitmap planes
|
||||
auto plane_data = TRY(uncompress_byte_run(body_chunk.data, context));
|
||||
// that we need to convert to chunky pixel data
|
||||
auto pixel_data = TRY(planar_to_chunky(plane_data, context));
|
||||
ByteBuffer pixel_data;
|
||||
|
||||
context.bitmap = TRY(chunky_to_bitmap(context, pixel_data));
|
||||
if (context.bm_header.compression == CompressionType::ByteRun) {
|
||||
auto plane_data = TRY(uncompress_byte_run(body_chunk.data, context));
|
||||
pixel_data = TRY(planar_to_chunky(plane_data, context));
|
||||
} else {
|
||||
return Error::from_string_literal("Uncompress body not supported yet");
|
||||
pixel_data = TRY(planar_to_chunky(body_chunk.data, context));
|
||||
}
|
||||
|
||||
context.bitmap = TRY(chunky_to_bitmap(context, pixel_data));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue