mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 10:09:14 +00:00
LibGfx/TIFF: Support WhiteIsZero parameter for grayscale images
PhotometricInterpretation::WhiteIsZero is used to inverse black and white on bilevel and grayscale images.
This commit is contained in:
parent
64d7e386d2
commit
3ae29fdeec
Notes:
sideshowbarker
2024-07-16 21:42:29 +09:00
Author: https://github.com/LucasChollet
Commit: 3ae29fdeec
Pull-request: https://github.com/SerenityOS/serenity/pull/22207
Reviewed-by: https://github.com/nico ✅
1 changed files with 5 additions and 1 deletions
|
@ -97,7 +97,11 @@ private:
|
|||
}
|
||||
|
||||
if (*m_metadata.samples_per_pixel() == 1) {
|
||||
auto const luminosity = TRY(read_component(stream, bits_per_sample[0]));
|
||||
auto luminosity = TRY(read_component(stream, bits_per_sample[0]));
|
||||
|
||||
if (m_metadata.photometric_interpretation() == PhotometricInterpretation::WhiteIsZero)
|
||||
luminosity = ~luminosity;
|
||||
|
||||
return Color(luminosity, luminosity, luminosity);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue