32 src->readPixels(
nullptr, *
dst, 0, 0, SkImage::CachingHint::kDisallow_CachingHint);
39 options.fAlphaOption = alphaOption;
56 *errorMsg =
"Could not load images/rainbow-gradient.png. "
57 "Did you forget to set the resourcePath?";
105 using INHERITED =
GM;
108DEF_GM(
return new EncodeJpegAlphaOptsGM; )
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
SK_API int SkColorTypeBytesPerPixel(SkColorType ct)
SkImageInfo imageInfo() const
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
static sk_sp< SkColorSpace > MakeSRGB()
T * reset(size_t count=0)
SkString getName() const override
SkISize getISize() override
DrawResult onDraw(SkCanvas *canvas, SkString *errorMsg) override
GM(SkColor backgroundColor=SK_ColorWHITE)
SK_API sk_sp< SkImage > DeferredFromEncodedData(sk_sp< SkData > encoded, std::optional< SkAlphaType > alphaType=std::nullopt)
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
static sk_sp< SkImage > encode_pixmap_and_make_image(const SkPixmap &src, SkJpegEncoder::AlphaOption alphaOption)
static void read_into_pixmap(SkPixmap *dst, SkImageInfo dstInfo, void *dstPixels, sk_sp< SkImage > src)
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
size_t minRowBytes() const
SkColorSpace * colorSpace() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)