mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:07:46 +00:00
LibGfx: Make unfilter_scanline() a static PNGImageDecoderPlugin method
That way, LibPDF will be able to call it. No behavior change.
This commit is contained in:
parent
0416a07d56
commit
5a70813d11
2 changed files with 5 additions and 3 deletions
|
@ -11,7 +11,6 @@
|
|||
#include <AK/Vector.h>
|
||||
#include <LibCompress/Zlib.h>
|
||||
#include <LibGfx/ImageFormats/PNGLoader.h>
|
||||
#include <LibGfx/ImageFormats/PNGShared.h>
|
||||
#include <LibGfx/Painter.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
@ -290,7 +289,7 @@ union [[gnu::packed]] Pixel {
|
|||
};
|
||||
static_assert(AssertSize<Pixel, 4>());
|
||||
|
||||
static void unfilter_scanline(PNG::FilterType filter, Bytes scanline_data, ReadonlyBytes previous_scanlines_data, u8 bytes_per_complete_pixel)
|
||||
void PNGImageDecoderPlugin::unfilter_scanline(PNG::FilterType filter, Bytes scanline_data, ReadonlyBytes previous_scanlines_data, u8 bytes_per_complete_pixel)
|
||||
{
|
||||
VERIFY(filter != PNG::FilterType::None);
|
||||
|
||||
|
@ -431,7 +430,7 @@ NEVER_INLINE FLATTEN static ErrorOr<void> unfilter(PNGLoadingContext& context)
|
|||
context.scanlines[y].data.copy_to(scanline_data_slice);
|
||||
context.scanlines[y].data = scanline_data_slice;
|
||||
|
||||
unfilter_scanline(context.scanlines[y].filter, scanline_data_slice, previous_scanlines_data, bytes_per_complete_pixel);
|
||||
PNGImageDecoderPlugin::unfilter_scanline(context.scanlines[y].filter, scanline_data_slice, previous_scanlines_data, bytes_per_complete_pixel);
|
||||
|
||||
data_start += bytes_per_scanline;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGfx/ImageFormats/ImageDecoder.h>
|
||||
#include <LibGfx/ImageFormats/PNGShared.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
|
@ -28,6 +29,8 @@ public:
|
|||
virtual ErrorOr<ImageFrameDescriptor> frame(size_t index, Optional<IntSize> ideal_size = {}) override;
|
||||
virtual ErrorOr<Optional<ReadonlyBytes>> icc_data() override;
|
||||
|
||||
static void unfilter_scanline(PNG::FilterType filter, Bytes scanline_data, ReadonlyBytes previous_scanlines_data, u8 bytes_per_complete_pixel);
|
||||
|
||||
private:
|
||||
PNGImageDecoderPlugin(u8 const*, size_t);
|
||||
bool ensure_image_data_chunk_was_decoded();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue