1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:27:35 +00:00

LibGfx/TIFF: Parse the T4Options CCITT field

This field is described in: Section 11: CCITT Bilevel Encodings.
This commit is contained in:
Lucas CHOLLET 2024-01-14 15:03:54 -05:00 committed by Andreas Kling
parent edffdc35a9
commit 26494600c4
3 changed files with 42 additions and 0 deletions

View file

@ -18,6 +18,25 @@
namespace Gfx {
namespace {
CCITT::Group3Options parse_t4_options(u32 bit_field)
{
// Section 11: CCITT Bilevel Encodings
CCITT::Group3Options options {};
if (bit_field & 0b001)
options.dimensions = CCITT::Group3Options::Mode::TwoDimensions;
if (bit_field & 0b010)
options.compression = CCITT::Group3Options::Compression::Uncompressed;
if (bit_field & 0b100)
options.use_fill_bits = CCITT::Group3Options::UseFillBits::Yes;
return options;
}
}
namespace TIFF {
class TIFFLoadingContext {