5 {
10 bitmap.allocPixels(imageInfo);
14 auto pack888 = [](
unsigned r,
unsigned g,
unsigned b) -> uint32_t {
15 return (r << 0) | (g << 8) | (
b << 16);
16 };
17 uint32_t red888[] = { pack888(0xFF, 0x00, 0x00), pack888(0xbb, 0x00, 0x00),
18 pack888(0x77, 0x00, 0x00), pack888(0x33, 0x00, 0x00) };
19 uint32_t blue888[] = { pack888(0x00, 0x00, 0xFF), pack888(0x00, 0x00, 0xbb),
20 pack888(0x00, 0x00, 0x77), pack888(0x00, 0x00, 0x33) };
23 }
26 }
27}
28}
@ kOpaque_SkAlphaType
pixel is opaque
@ kRGB_888x_SkColorType
pixel with 8 bits each for red, green, blue; in 32-bit word
constexpr SkColor SK_ColorGREEN
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
void scale(SkScalar sx, SkScalar sy)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
size_t minRowBytes() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)