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

LibGfx/TIFF: Parse the PhotometricInterpretation tag

This commit is contained in:
Lucas CHOLLET 2023-11-30 23:22:54 -05:00 committed by Andreas Kling
parent 73f7f33205
commit 64d7e386d2

View file

@ -50,6 +50,17 @@ class Compression(EnumWithExportName):
PackBits = 32773
class PhotometricInterpretation(EnumWithExportName):
WhiteIsZero = 0
BlackIsZero = 1
RGB = 2
RGBPalette = 3
TransparencyMask = 4
CMYK = 5
YCbCr = 6
CIELab = 8
tag_fields = ['id', 'types', 'counts', 'default', 'name', 'associated_enum']
Tag = namedtuple(
@ -64,6 +75,7 @@ known_tags: List[Tag] = [
Tag('257', [TIFFType.UnsignedShort, TIFFType.UnsignedLong], [1], None, "ImageHeight"),
Tag('258', [TIFFType.UnsignedShort], [], None, "BitsPerSample"),
Tag('259', [TIFFType.UnsignedShort], [1], None, "Compression", Compression),
Tag('262', [TIFFType.UnsignedShort], [1], None, "PhotometricInterpretation", PhotometricInterpretation),
Tag('273', [TIFFType.UnsignedShort, TIFFType.UnsignedLong], [], None, "StripOffsets"),
Tag('277', [TIFFType.UnsignedShort], [1], None, "SamplesPerPixel"),
Tag('278', [TIFFType.UnsignedShort, TIFFType.UnsignedLong], [1], None, "RowsPerStrip"),