8 #ifndef SkImageGenerator_DEFINED
9 #define SkImageGenerator_DEFINED
13 #include "SkImageInfo.h"
14 #include "SkYUVSizeInfo.h"
26 #ifdef SK_SUPPORT_LEGACY_REFENCODEDDATA_NOCTX
27 #define SK_REFENCODEDDATA_CTXPARAM
29 #define SK_REFENCODEDDATA_CTXPARAM GrContext* ctx
56 SK_API
bool SkDEPRECATED_InstallDiscardablePixelRef(
SkData* encoded,
SkBitmap* destination);
70 uint32_t uniqueID()
const {
return fUniqueID; }
82 #ifdef SK_SUPPORT_LEGACY_REFENCODEDDATA_NOCTX
83 return this->onRefEncodedData();
85 return this->onRefEncodedData(ctx);
123 bool getPixels(
const SkImageInfo& info,
void* pixels,
size_t rowBytes,
130 bool getPixels(
const SkImageInfo& info,
void* pixels,
size_t rowBytes);
140 bool queryYUV8(
SkYUVSizeInfo* sizeInfo, SkYUVColorSpace* colorSpace)
const;
152 bool getYUV8Planes(
const SkYUVSizeInfo& sizeInfo,
void* planes[3]);
212 bool generateScaledPixels(
const SkISize& scaledSize,
const SkIPoint& subsetOrigin,
215 bool generateScaledPixels(
const SkPixmap& scaledPixels) {
216 return this->generateScaledPixels(SkISize::Make(scaledPixels.width(),
217 scaledPixels.height()),
218 SkIPoint::Make(0, 0), scaledPixels);
236 bool tryGenerateBitmap(
SkBitmap* bm) {
237 return this->tryGenerateBitmap(bm,
nullptr,
nullptr);
240 return this->tryGenerateBitmap(bm, &info, allocator);
243 if (!this->tryGenerateBitmap(bm,
nullptr,
nullptr)) {
248 if (!this->tryGenerateBitmap(bm, &info,
nullptr)) {
255 kNeedNewImageUniqueID = 0
260 virtual SkData* onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM);
262 virtual bool onGetPixels(
const SkImageInfo& info,
void* pixels,
size_t rowBytes,
265 virtual bool onQueryYUV8(
SkYUVSizeInfo*, SkYUVColorSpace*)
const {
268 virtual bool onGetYUV8Planes(
const SkYUVSizeInfo&,
void*[3] ) {
276 virtual bool onComputeScaledDimensions(SkScalar, SupportedSizes*) {
287 const uint32_t fUniqueID;
295 #endif // SkImageGenerator_DEFINED
Describe an image's dimensions and pixel type.
Definition: SkImageInfo.h:181
Definition: SkBitmap.h:703
SkData * refEncodedData(GrContext *ctx=nullptr)
Return a ref to the encoded (i.e.
Definition: SkImageGenerator.h:81
An interface that allows a purgeable PixelRef (such as a SkDiscardablePixelRef) to decode and re-deco...
Definition: SkImageGenerator.h:62
Pairs SkImageInfo with actual pixels and rowbytes.
Definition: SkPixmap.h:23
Represents the filtering and tile modes used to access a texture.
Definition: GrTextureParams.h:17
The SkMatrix class holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:26
The SkPaint class holds the style and color information about how to draw geometries, text and bitmaps.
Definition: SkPaint.h:46
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
Definition: SkImageGenerator.h:178
The SkBitmap class specifies a raster bitmap.
Definition: SkBitmap.h:41
Definition: SkYUVSizeInfo.h:11
Definition: GrContext.h:48
uint32_t SkPMColor
32 bit ARGB color value, premultiplied.
Definition: SkColor.h:147
const SkImageInfo & getInfo() const
Return the ImageInfo associated with this generator.
Definition: SkImageGenerator.h:92
virtual ~SkImageGenerator()
The PixelRef which takes ownership of this SkImageGenerator will call the image generator's destructo...
Definition: SkImageGenerator.h:68
SkIRect holds four 32 bit integer coordinates for a rectangle.
Definition: SkRect.h:20
Definition: GrTexture.h:19
SkIPoint holds two 32 bit integer coordinates.
Definition: SkPoint.h:40
Types and macros for colors.