129 static const char* ResultToString(Result);
186 std::unique_ptr<SkStream>,
190 SelectionPolicy selectionPolicy = SelectionPolicy::kPreferStillImage);
193 std::unique_ptr<SkStream>,
196 SelectionPolicy selectionPolicy = SelectionPolicy::kPreferStillImage);
239 return this->getEncodedInfo().profile();
258 if (desiredScale <= 0.0f) {
264 if (desiredScale >= 1.0f) {
265 return this->dimensions();
267 return this->onGetScaledDimensions(desiredScale);
286 return this->onGetValidSubset(desiredSubset);
298 virtual std::unique_ptr<SkStream> getEncodedData()
const;
323 : fZeroInitialized(kNo_ZeroInitialized)
326 , fPriorFrame(kNoFrame)
413 return this->getPixels(
info, pixels, rowBytes,
nullptr);
425 const Options* opts =
nullptr);
468 Result startIncrementalDecode(
const SkImageInfo& dstInfo,
void*
dst,
size_t rowBytes,
472 return this->startIncrementalDecode(dstInfo,
dst, rowBytes,
nullptr);
499 if (!fStartedIncrementalDecode) {
500 return kInvalidParameters;
502 return this->onIncrementalDecode(rowsDecoded);
532 return this->startScanlineDecode(dstInfo,
nullptr);
549 int getScanlines(
void*
dst,
int countLines,
size_t rowBytes);
568 bool skipScanlines(
int countLines);
624 int nextScanline()
const {
return this->outputScanline(fCurrScanline); }
634 int outputScanline(
int inputScanline)
const;
642 return this->onGetFrameCount();
650 static constexpr int kNoFrame = -1;
653#ifdef SK_LEGACY_SKCODEC_NONE_ENUM
654 static constexpr int kNone = kNoFrame;
743 return this->onGetFrameInfo(index,
info);
757 std::vector<FrameInfo> getFrameInfo();
759 static constexpr int kRepetitionCountInfinite = -1;
776 return this->onGetRepetitionCount();
784 bool (*peek)(
const void*,
size_t),
794 std::unique_ptr<SkStream>,
800 return fSrcXformFormat;
807 return this->dimensions();
828 void* pixels,
size_t rowBytes,
const Options&,
829 int* rowsDecoded) = 0;
851 [[nodiscard]]
bool rewindIfNeeded();
866 return fStream.get();
890 virtual int onOutputScanline(
int inputScanline)
const;
897 virtual bool conversionSupported(
const SkImageInfo&
dst,
bool srcIsOpaque,
898 bool needsColorXform);
904 void applyColorXform(
void*
dst,
const void*
src,
int count)
const;
906 bool colorXform()
const {
return fXformTime != kNo_XformTime; }
923 XformFormat fSrcXformFormat;
924 std::unique_ptr<SkStream> fStream;
925 bool fNeedsRewind =
false;
934 kDecodeRow_XformTime,
936 XformTime fXformTime;
937 XformFormat fDstXformFormat;
942 int fCurrScanline = -1;
944 bool fStartedIncrementalDecode =
false;
948 bool fUsingCallbackForHandleFrameIndex =
false;
961 bool dimensionsSupported(
const SkISize& dim) {
962 return dim == this->dimensions() || this->onDimensionsSupported(dim);
977 size_t rowBytes,
const Options& opts,
987 Result handleFrameIndex(
const SkImageInfo&,
void* pixels,
size_t rowBytes,
const Options&,
988 GetPixelsCallback =
nullptr);
993 return kUnimplemented;
998 return kUnimplemented;
1002 return kUnimplemented;
1024 void fillIncompleteImage(
const SkImageInfo& dstInfo,
void*
dst,
size_t rowBytes,
1025 ZeroInitialized zeroInit,
int linesRequested,
int linesDecoded);
1082 std::optional<SkAlphaType> alphaType = std::nullopt);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kTopLeft_SkEncodedOrigin
bool getFrameInfo(int index, FrameInfo *info) const
virtual Result onGetPixels(const SkImageInfo &info, void *pixels, size_t rowBytes, const Options &, int *rowsDecoded)=0
virtual Result onStartScanlineDecode(const SkImageInfo &, const Options &)
bool getValidSubset(SkIRect *desiredSubset) const
const skcms_ICCProfile * getICCProfile() const
virtual SkEncodedImageFormat onGetEncodedFormat() const =0
SkISize dimensions() const
const SkImageInfo & dstInfo() const
virtual bool onGetFrameInfo(int, FrameInfo *) const
bool xformOnDecode() const
virtual bool onDimensionsSupported(const SkISize &)
virtual SkScanlineOrder onGetScanlineOrder() const
static constexpr size_t MinBufferedBytesNeeded()
virtual Result onGetYUVAPlanes(const SkYUVAPixmaps &)
virtual Result onStartIncrementalDecode(const SkImageInfo &, void *, size_t, const Options &)
Result getPixels(const SkImageInfo &info, void *pixels, size_t rowBytes)
virtual int onGetRepetitionCount()
Result getPixels(const SkPixmap &pm, const Options *opts=nullptr)
@ kBottomUp_SkScanlineOrder
@ kTopDown_SkScanlineOrder
virtual bool onSkipScanlines(int)
static void Register(bool(*peek)(const void *, size_t), std::unique_ptr< SkCodec >(*make)(std::unique_ptr< SkStream >, SkCodec::Result *))
virtual int onGetFrameCount()
const SkEncodedInfo & getEncodedInfo() const
SkScanlineOrder getScanlineOrder() const
virtual SkSampler * getSampler(bool)
Result incrementalDecode(int *rowsDecoded=nullptr)
virtual const SkFrameHolder * getFrameHolder() const
virtual bool usesColorXform() const
SkEncodedImageFormat getEncodedFormat() const
virtual SkISize onGetScaledDimensions(float) const
virtual bool onQueryYUVAInfo(const SkYUVAPixmapInfo::SupportedDataTypes &, SkYUVAPixmapInfo *) const
SkISize getScaledDimensions(float desiredScale) const
Result startIncrementalDecode(const SkImageInfo &dstInfo, void *dst, size_t rowBytes)
Result startScanlineDecode(const SkImageInfo &dstInfo)
virtual int onGetScanlines(void *, int, size_t)
SkEncodedOrigin getOrigin() const
virtual bool onGetValidSubset(SkIRect *) const
XformFormat getSrcXformFormat() const
virtual Result onIncrementalDecode(int *)
SkImageInfo getInfo() const
virtual bool onGetGainmapInfo(SkGainmapInfo *, std::unique_ptr< SkStream > *)
const Options & options() const
const SkImageInfo & info() const
void * writable_addr() const
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Dart_NativeFunction function
void SK_API Register(Decoder d)
std::unique_ptr< SkCodec >(*)(std::unique_ptr< SkStream >, SkCodec::Result *, DecodeContext) MakeFromStreamCallback
bool(*)(const void *data, size_t len) IsFormatCallback
SK_API sk_sp< SkImage > DeferredImage(std::unique_ptr< SkCodec > codec, std::optional< SkAlphaType > alphaType=std::nullopt)
std::unique_ptr< SkCodec > MakeFromStream(std::unique_ptr< SkStream > stream, SkCodec::SelectionPolicy selectionPolicy, SkCodec::Result *result)
static void make(SkBitmap *bitmap, SkColorType colorType, SkAlphaType alphaType, sk_sp< SkColorSpace > colorSpace)
SkCodecAnimation::DisposalMethod fDisposalMethod
SkCodecAnimation::Blend fBlend
bool fHasAlphaWithinBounds
ZeroInitialized fZeroInitialized
IsFormatCallback isFormat
MakeFromStreamCallback makeFromStream
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static constexpr SkISize Make(int32_t w, int32_t h)
constexpr int32_t width() const
std::shared_ptr< const fml::Mapping > data