Flutter Engine
The Flutter Engine
|
#include <SkImageGenerator.h>
Classes | |
struct | Options |
Public Member Functions | |
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 |
Protected Member Functions | |
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 &) |
Protected Attributes | |
const SkImageInfo | fInfo |
Static Protected Attributes | |
static constexpr int | kNeedNewImageUniqueID = 0 |
Definition at line 28 of file SkImageGenerator.h.
|
inlinevirtual |
The PixelRef which takes ownership of this SkImageGenerator will call the image generator's destructor.
Definition at line 34 of file SkImageGenerator.h.
|
protected |
Definition at line 14 of file SkImageGenerator.cpp.
|
inline |
Return the ImageInfo associated with this generator.
Definition at line 52 of file SkImageGenerator.h.
bool SkImageGenerator::getPixels | ( | const SkImageInfo & | info, |
void * | pixels, | ||
size_t | rowBytes | ||
) |
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 19 of file SkImageGenerator.cpp.
|
inline |
Definition at line 93 of file SkImageGenerator.h.
bool SkImageGenerator::getYUVAPlanes | ( | const SkYUVAPixmaps & | yuvaPixmaps | ) |
Returns true on success and false on failure. This always attempts to perform a full decode. To get the planar configuration without decoding use queryYUVAInfo().
yuvaPixmaps | Contains preallocated pixmaps configured according to a successful call to queryYUVAInfo(). |
Definition at line 42 of file SkImageGenerator.cpp.
|
inline |
Will this generator produce protected content
Definition at line 65 of file SkImageGenerator.h.
|
inlinevirtual |
Reimplemented in GrTextureGenerator.
Definition at line 121 of file SkImageGenerator.h.
|
inline |
Can this generator be used to produce images that will be drawable to the specified context (or to CPU, if context is nullptr)?
Definition at line 58 of file SkImageGenerator.h.
|
inlineprotectedvirtual |
Reimplemented in SkPictureImageGenerator, RasterGenerator, TestImageGenerator, and SkCodecImageGenerator.
Definition at line 130 of file SkImageGenerator.h.
|
inlineprotectedvirtual |
Reimplemented in SkCodecImageGenerator.
Definition at line 135 of file SkImageGenerator.h.
|
inlineprotectedvirtual |
Reimplemented in GrBackendTextureImageGenerator.
Definition at line 132 of file SkImageGenerator.h.
|
inlineprotectedvirtual |
Reimplemented in GrBackendTextureImageGenerator.
Definition at line 131 of file SkImageGenerator.h.
|
inlineprotectedvirtual |
Reimplemented in SkCodecImageGenerator.
Definition at line 133 of file SkImageGenerator.h.
Reimplemented in SkCodecImageGenerator.
Definition at line 128 of file SkImageGenerator.h.
bool SkImageGenerator::queryYUVAInfo | ( | const SkYUVAPixmapInfo::SupportedDataTypes & | supportedDataTypes, |
SkYUVAPixmapInfo * | yuvaPixmapInfo | ||
) | const |
If decoding to YUV is supported, this returns true. Otherwise, this returns false and the caller will ignore output parameter yuvaPixmapInfo.
supportedDataTypes | Indicates the data type/planar config combinations that are supported by the caller. If the generator supports decoding to YUV(A), but not as a type in supportedDataTypes, this method returns false. |
yuvaPixmapInfo | Output parameter that specifies the planar configuration, subsampling, orientation, chroma siting, plane color types, and row bytes. |
Definition at line 34 of file SkImageGenerator.cpp.
Return a ref to the encoded (i.e. compressed) representation of this data.
If non-NULL is returned, the caller is responsible for calling unref() on the data when it is finished.
Definition at line 45 of file SkImageGenerator.h.
|
inline |
Definition at line 36 of file SkImageGenerator.h.
|
protected |
Definition at line 137 of file SkImageGenerator.h.
|
staticconstexprprotected |
Definition at line 124 of file SkImageGenerator.h.