mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 11:37:44 +00:00
LibGfx/TIFF+CCITT: Start to decode CCITT Group 3 images
We currently only support 1D Group 3, but that's a start. The test case was generated with GIMP (it happens to be 1D by chance).
This commit is contained in:
parent
1cc10a6245
commit
75d87ccf5f
5 changed files with 66 additions and 0 deletions
|
@ -314,6 +314,20 @@ private:
|
|||
TRY(loop_over_pixels(move(decode_ccitt_rle_strip)));
|
||||
break;
|
||||
}
|
||||
case Compression::Group3Fax: {
|
||||
TRY(ensure_tags_are_correct_for_ccitt());
|
||||
|
||||
auto const parameters = parse_t4_options(*m_metadata.t4_options());
|
||||
ByteBuffer decoded_bytes {};
|
||||
auto decode_group3_strip = [&](u32 num_bytes, u32 strip_height) -> ErrorOr<ReadonlyBytes> {
|
||||
auto const encoded_bytes = TRY(m_stream->read_in_place<u8 const>(num_bytes));
|
||||
decoded_bytes = TRY(CCITT::decode_ccitt_group3(encoded_bytes, *m_metadata.image_width(), strip_height, parameters));
|
||||
return decoded_bytes;
|
||||
};
|
||||
|
||||
TRY(loop_over_pixels(move(decode_group3_strip)));
|
||||
break;
|
||||
}
|
||||
case Compression::LZW: {
|
||||
ByteBuffer decoded_bytes {};
|
||||
auto decode_lzw_strip = [&](u32 num_bytes, u32) -> ErrorOr<ReadonlyBytes> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue