8 #ifndef SkImageGenerator_DEFINED
9 #define SkImageGenerator_DEFINED
14 #include "SkImageInfo.h"
15 #include "SkYUVSizeInfo.h"
35 uint32_t uniqueID()
const {
return fUniqueID; }
45 return this->onRefEncodedData();
58 return this->onIsValid(context);
87 : fBehavior(SkTransferFunctionBehavior::kIgnore)
90 SkTransferFunctionBehavior fBehavior;
92 bool getPixels(
const SkImageInfo& info,
void* pixels,
size_t rowBytes,
const Options* options);
97 bool getPixels(
const SkImageInfo& info,
void* pixels,
size_t rowBytes);
107 bool queryYUV8(
SkYUVSizeInfo* sizeInfo, SkYUVColorSpace* colorSpace)
const;
119 bool getYUV8Planes(
const SkYUVSizeInfo& sizeInfo,
void* planes[3]);
153 static std::unique_ptr<SkImageGenerator> MakeFromEncoded(
sk_sp<SkData>);
167 kNeedNewImageUniqueID = 0
172 virtual SkData* onRefEncodedData() {
return nullptr; }
173 virtual bool onGetPixels(
const SkImageInfo&,
void*,
size_t,
const Options&) {
return false; }
174 virtual bool onIsValid(
GrContext*)
const {
return true; }
175 virtual bool onQueryYUV8(
SkYUVSizeInfo*, SkYUVColorSpace*)
const {
return false; }
176 virtual bool onGetYUV8Planes(
const SkYUVSizeInfo&,
void*[3] ) {
return false; }
179 enum class TexGenType {
185 virtual TexGenType onCanGenerateTexture()
const {
return TexGenType::kNone; }
192 const uint32_t fUniqueID;
194 friend class SkImage_Lazy;
199 static std::unique_ptr<SkImageGenerator> MakeFromEncodedImpl(
sk_sp<SkData>);
202 #endif // SkImageGenerator_DEFINED
Describe an image's dimensions and pixel type.
Definition: SkImageInfo.h:181
Definition: SkImageGenerator.h:27
Represents the filtering and tile modes used to access a texture.
Definition: GrSamplerParams.h:17
The SkMatrix class holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:28
The SkPaint class holds the style and color information about how to draw geometries, text and bitmaps.
Definition: SkPaint.h:45
An SkPicture records drawing commands made to a canvas to be played back at a later time...
Definition: SkPicture.h:38
SkData holds an immutable data buffer.
Definition: SkData.h:22
The SkBitmap class specifies a raster bitmap.
Definition: SkBitmap.h:37
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:246
Definition: SkYUVSizeInfo.h:13
Definition: GrContext.h:47
const SkImageInfo & getInfo() const
Return the ImageInfo associated with this generator.
Definition: SkImageGenerator.h:51
bool isValid(GrContext *context) const
Can this generator be used to produce images that will be drawable to the specified context (or to CP...
Definition: SkImageGenerator.h:57
SkData * refEncodedData()
Return a ref to the encoded (i.e.
Definition: SkImageGenerator.h:44
virtual ~SkImageGenerator()
The PixelRef which takes ownership of this SkImageGenerator will call the image generator's destructo...
Definition: SkImageGenerator.h:33
Decode into the given pixels, a block of memory of size at least (info.fHeight - 1) * rowBytes + (inf...
Definition: SkImageGenerator.h:85
SkIPoint holds two 32 bit integer coordinates.
Definition: SkPoint.h:40
Types and macros for colors.
Can be used to perform actions related to the generating GrContext in a thread safe manner...
Definition: GrContext.h:361