Flutter Engine
The Flutter Engine
|
#include <SkCodecImageGenerator.h>
Public Member Functions | |
SkISize | getScaledDimensions (float desiredScale) const |
bool | getPixels (const SkImageInfo &info, void *pixels, size_t rowBytes, const SkCodec::Options *options=nullptr) |
int | getFrameCount () |
bool | getFrameInfo (int index, SkCodec::FrameInfo *info) const |
int | getRepetitionCount () |
Public Member Functions inherited from SkImageGenerator | |
virtual | ~SkImageGenerator () |
uint32_t | uniqueID () const |
sk_sp< SkData > | refEncodedData () |
const SkImageInfo & | getInfo () const |
bool | isValid (GrRecordingContext *context) const |
bool | isProtected () const |
bool | getPixels (const SkImageInfo &info, void *pixels, size_t rowBytes) |
bool | getPixels (const SkPixmap &pm) |
bool | queryYUVAInfo (const SkYUVAPixmapInfo::SupportedDataTypes &supportedDataTypes, SkYUVAPixmapInfo *yuvaPixmapInfo) const |
bool | getYUVAPlanes (const SkYUVAPixmaps &yuvaPixmaps) |
virtual bool | isTextureGenerator () const |
Static Public Member Functions | |
static std::unique_ptr< SkImageGenerator > | MakeFromEncodedCodec (sk_sp< SkData >, std::optional< SkAlphaType >=std::nullopt) |
static std::unique_ptr< SkImageGenerator > | MakeFromCodec (std::unique_ptr< SkCodec >, std::optional< SkAlphaType >=std::nullopt) |
Protected Member Functions | |
sk_sp< SkData > | onRefEncodedData () override |
bool | onGetPixels (const SkImageInfo &info, void *pixels, size_t rowBytes, const Options &opts) override |
bool | onQueryYUVAInfo (const SkYUVAPixmapInfo::SupportedDataTypes &, SkYUVAPixmapInfo *) const override |
bool | onGetYUVAPlanes (const SkYUVAPixmaps &yuvaPixmaps) override |
Protected Member Functions inherited from SkImageGenerator | |
SkImageGenerator (const SkImageInfo &info, uint32_t uniqueId=kNeedNewImageUniqueID) | |
virtual sk_sp< SkData > | onRefEncodedData () |
virtual bool | onGetPixels (const SkImageInfo &, void *, size_t, const Options &) |
virtual bool | onIsValid (GrRecordingContext *) const |
virtual bool | onIsProtected () const |
virtual bool | onQueryYUVAInfo (const SkYUVAPixmapInfo::SupportedDataTypes &, SkYUVAPixmapInfo *) const |
virtual bool | onGetYUVAPlanes (const SkYUVAPixmaps &) |
Additional Inherited Members | |
Protected Attributes inherited from SkImageGenerator | |
const SkImageInfo | fInfo |
Static Protected Attributes inherited from SkImageGenerator | |
static constexpr int | kNeedNewImageUniqueID = 0 |
Definition at line 24 of file SkCodecImageGenerator.h.
|
inline |
Return the number of frames in the image.
May require reading through the stream.
Definition at line 76 of file SkCodecImageGenerator.h.
|
inline |
Return info about a single frame.
Only supported by multi-frame images. Does not read through the stream, so it should be called after getFrameCount() to parse any frames that have not already been parsed.
Definition at line 85 of file SkCodecImageGenerator.h.
bool SkCodecImageGenerator::getPixels | ( | const SkImageInfo & | info, |
void * | pixels, | ||
size_t | rowBytes, | ||
const SkCodec::Options * | options = nullptr |
||
) |
Decode into the given pixels, a block of memory of size at least (info.fHeight - 1) * rowBytes + (info.fWidth * bytesPerPixel)
Repeated calls to this function should give the same results, allowing the PixelRef to be immutable.
info | A description of the format expected by the caller. This can simply be identical to the info returned by getInfo(). |
This contract also allows the caller to specify different output-configs, which the implementation can decide to support or not.
A size that does not match getInfo() implies a request to scale. If the generator cannot perform this scale, it will return false.
Definition at line 71 of file SkCodecImageGenerator.cpp.
|
inline |
Return the number of times to repeat, if this image is animated. This number does not include the first play through of each frame. For example, a repetition count of 4 means that each frame is played 5 times and then the animation stops.
It can return kRepetitionCountInfinite, a negative number, meaning that the animation should loop forever.
May require reading the stream to find the repetition count.
As such, future decoding calls may require a rewind.
For still (non-animated) image codecs, this will return 0.
Definition at line 103 of file SkCodecImageGenerator.h.
SkISize SkCodecImageGenerator::getScaledDimensions | ( | float | desiredScale | ) | const |
Return a size that approximately supports the desired scale factor. The codec may not be able to scale efficiently to the exact scale factor requested, so return a size that approximates that scale. The returned value is the codec's suggestion for the closest valid scale that it can natively support.
This is similar to SkCodec::getScaledDimensions, but adjusts the returned dimensions based on the image's EXIF orientation.
Definition at line 111 of file SkCodecImageGenerator.cpp.
|
static |
Definition at line 31 of file SkCodecImageGenerator.cpp.
|
static |
Definition at line 21 of file SkCodecImageGenerator.cpp.
|
overrideprotectedvirtual |
Reimplemented from SkImageGenerator.
Definition at line 89 of file SkCodecImageGenerator.cpp.
|
overrideprotectedvirtual |
Reimplemented from SkImageGenerator.
Definition at line 100 of file SkCodecImageGenerator.cpp.
|
overrideprotectedvirtual |
Reimplemented from SkImageGenerator.
Definition at line 94 of file SkCodecImageGenerator.cpp.
Reimplemented from SkImageGenerator.
Definition at line 58 of file SkCodecImageGenerator.cpp.