31#include <initializer_list>
64 uint8_t spectrum[256];
65 for (
int y = 0;
y < 256; ++
y) {
68 for (
int y = 0;
y < 128; ++
y) {
90 const double sqrt_3_over_2 = 0.8660254037844387;
111 for (
int i = 0;
i <
N; ++
i) {
112 if (array[
i] == item) {
133 p.setAntiAlias(
true);
178 #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
180 #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
183 static_assert(ct != kN32_SkColorType,
"BRGA!=RGBA");
193 canvas->drawImage(notN32image.
get(), 0.0f, 0.0f);
202 uint32_t alpha = 0x00;
204 if ((
x -
R) * (
x -
R) + (
y -
R) * (
y -
R) <
R *
R) {
217 SK_ABORT(
"Should not get here - invalid alpha type");
219 return alpha << 24 | component;
234 for (
int x = 0;
x < pm.
width();
x++) {
254 canvas->drawImage(bm.
asImage(), 0.0f, 0.0f);
255 canvas->translate(
SCALE + 10, 0.0f);
258 canvas->translate(0.0f,
SCALE + 10);
261 canvas->translate(2 * (
SCALE + 10), 0.0f);
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
@ kOpaque_SkAlphaType
pixel is opaque
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
#define SK_ABORT(message,...)
@ kARGB_4444_SkColorType
pixel with 4 bits for alpha, red, green, blue; in 16-bit word
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
@ kAlpha_8_SkColorType
pixel with alpha in 8-bit byte
@ kGray_8_SkColorType
pixel with grayscale level in 8-bit byte
@ kRGB_565_SkColorType
pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorLTGRAY
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorTRANSPARENT
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
@ kUTF8
uses bytes to represent UTF-8 or ASCII
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
#define SkDoubleToScalar(x)
static void copy(void *dst, const uint8_t *src, int width, int bpp, int deltaSrc, int offset, const SkPMColor ctable[])
static SkBitmap copy_bitmap(const SkBitmap &src, SkColorType colorType)
static SkBitmap make_bitmap(SkColorType ct)
static void draw_center_letter(char c, const SkFont &font, SkColor color, SkScalar x, SkScalar y, SkCanvas *canvas)
int find(T *array, int N, T item)
static void draw(SkCanvas *canvas, const SkPaint &p, const SkFont &font, const SkBitmap &src, SkColorType colorType, const char text[])
static void color_wheel_native(SkCanvas *canvas)
static void make_color_test_bitmap_variant(SkColorType colorType, SkAlphaType alphaType, sk_sp< SkColorSpace > colorSpace, SkBitmap *bm)
DEF_SIMPLE_GM(all_bitmap_configs, canvas, SCALE, 6 *SCALE)
sk_sp< SkImage > make_not_native32_color_wheel()
static uint32_t make_pixel(int x, int y, SkAlphaType alphaType)
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
uint8_t * getAddr8(int x, int y) const
const SkPixmap & pixmap() const
SkColorType colorType() const
void allocN32Pixels(int width, int height, bool isOpaque=false)
bool setAlphaType(SkAlphaType alphaType)
void eraseColor(SkColor4f) const
void drawSimpleText(const void *text, size_t byteLength, SkTextEncoding encoding, SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
static sk_sp< SkColorSpace > MakeSRGB()
static constexpr SkFontStyle Bold()
@ kAlias
no transparent pixels on glyph edges
uint32_t * writable_addr32(int x, int y) const
constexpr SkColor4f kWhite
constexpr SkColor4f kBlack
Optional< SkRect > bounds
font
Font Metadata and Metrics.
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static SkImageInfo MakeA8(int width, int height)