Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
Image_encodeToData.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Image_encodeToData, 256, 256, false, 3)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Image_encodeToData  ,
256  ,
256  ,
false  ,
 
)

Definition at line 5 of file Image_encodeToData.cpp.

5 {
6void draw(SkCanvas* canvas) {
7 canvas->scale(4, 4);
8 SkIRect subset = {0, 0, 16, 64};
9 int x = 0;
10 for (int quality : { 0, 10, 50, 100 } ) {
12 options.fQuality = quality;
15 makeSubset(nullptr, subset);
16 canvas->drawImage(filtered, x, 0);
17 x += 16;
18 }
19}
20} // END FIDDLE
const char * options
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void scale(SkScalar sx, SkScalar sy)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition SkCanvas.h:1528
T * get() const
Definition SkRefCnt.h:303
sk_sp< SkImage > image
Definition examples.cpp:29
double x
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_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switches.h:41
filtered(names, to_skip)
Definition zip_utils.py:20