7#ifndef SkPngCodec_DEFINED
8#define SkPngCodec_DEFINED
29 static bool IsPng(
const void*,
size_t);
47 operator T*()
const {
return (
T*)
fPtr; }
49 explicit operator bool()
const {
return fPtr !=
nullptr; }
100 kSwizzleOnly_XformMode,
103 kColorOnly_XformMode,
106 kSwizzleColor_XformMode,
112 void initializeSwizzler(
const SkImageInfo&
dstInfo,
const Options&,
bool skipFormatConversion);
114 void destroyReadStruct();
117 virtual void setRange(
int firstRow,
int lastRow,
void*
dst,
size_t rowBytes) = 0;
120 XformMode fXformMode;
const SkImageInfo & dstInfo() const
SkCodec(SkEncodedInfo &&, XformFormat srcFormat, std::unique_ptr< SkStream >, SkEncodedOrigin=kTopLeft_SkEncodedOrigin)
SkPngCodec(SkEncodedInfo &&, std::unique_ptr< SkStream >, SkPngChunkReader *, void *png_ptr, void *info_ptr, int bitDepth)
void applyXformRow(void *dst, const void *src)
SkSampler * getSampler(bool createIfNecessary) override
skia_private::AutoTMalloc< uint8_t > fStorage
static std::unique_ptr< SkCodec > MakeFromStream(std::unique_ptr< SkStream >, Result *, SkPngChunkReader *=nullptr)
virtual Result decode(int *rowsDecoded)=0
Result onGetPixels(const SkImageInfo &, void *, size_t, const Options &, int *) override
Result onStartIncrementalDecode(const SkImageInfo &dstInfo, void *pixels, size_t rowBytes, const SkCodec::Options &) override
virtual Result decodeAllRows(void *dst, size_t rowBytes, int *rowsDecoded)=0
void initializeXformParams()
Result onIncrementalDecode(int *) override
std::unique_ptr< SkSwizzler > fSwizzler
sk_sp< SkPngChunkReader > fPngChunkReader
virtual void setRange(int firstRow, int lastRow, void *dst, size_t rowBytes)=0
sk_sp< SkColorPalette > fColorTable
SkEncodedImageFormat onGetEncodedFormat() const override
static bool IsPng(const void *, size_t)
void setIdatLength(size_t len)