mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +00:00
LibGfx: Allow passing FilterType::None to unfilter_scanline()
Makes calling this in LibPDF less awkward, and there's no reason not to allow this.
This commit is contained in:
parent
574357ef00
commit
000d9da73c
1 changed files with 2 additions and 4 deletions
|
@ -291,9 +291,9 @@ static_assert(AssertSize<Pixel, 4>());
|
|||
|
||||
void PNGImageDecoderPlugin::unfilter_scanline(PNG::FilterType filter, Bytes scanline_data, ReadonlyBytes previous_scanlines_data, u8 bytes_per_complete_pixel)
|
||||
{
|
||||
VERIFY(filter != PNG::FilterType::None);
|
||||
|
||||
switch (filter) {
|
||||
case PNG::FilterType::None:
|
||||
break;
|
||||
case PNG::FilterType::Sub:
|
||||
// This loop starts at bytes_per_complete_pixel because all bytes before that are
|
||||
// guaranteed to have no valid byte at index (i - bytes_per_complete pixel).
|
||||
|
@ -327,8 +327,6 @@ void PNGImageDecoderPlugin::unfilter_scanline(PNG::FilterType filter, Bytes scan
|
|||
scanline_data[i] += PNG::paeth_predictor(left, above, upper_left);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue