18 : fSize(
bitmap.info().dimensions()) {
20 switch (
bitmap.alphaType()) {
22
26 }
27
29 switch (
bitmap.colorType()) {
31
42
48
55
63 }
64
66 if (
auto cs =
bitmap.colorSpace()) {
67 cs->toProfile(&srcProfile);
68 }
69
70
71
76 }
77
78
79
80
81
86
88 fPixels.reset(
new uint64_t[
N]);
89
91 void*
dst = fPixels.get();
95 dst, dstFmt, dstAlpha, &dstProfile, todo)) {
97 fPixels.reset(nullptr);
98 break;
99 }
101 dst = (
char*)
dst + todo*
sizeof(uint64_t);
103 }
104}
static sk_sp< SkColorSpace > rec2020()
@ kUnknown_SkAlphaType
uninitialized
@ kOpaque_SkAlphaType
pixel is opaque
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kR16G16B16A16_unorm_SkColorType
pixel with a little endian uint16_t for red, green, blue
@ kRGBA_10x6_SkColorType
pixel with 10 used bits (most significant) followed by 6 unused
@ kBGR_101010x_SkColorType
pixel with 10 bits each for blue, green, red; in 32-bit word
@ kARGB_4444_SkColorType
pixel with 4 bits for alpha, red, green, blue; in 16-bit word
@ kR8G8_unorm_SkColorType
pixel with a uint8_t for red and green
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
@ kA16_unorm_SkColorType
pixel with a little endian uint16_t for alpha
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
@ kAlpha_8_SkColorType
pixel with alpha in 8-bit byte
@ kRGB_101010x_SkColorType
pixel with 10 bits each for red, green, blue; in 32-bit word
@ kSRGBA_8888_SkColorType
@ 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
@ kBGRA_10101010_XR_SkColorType
pixel with 10 bits each for blue, green, red, alpha; in 64-bit word, extended range
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
@ kRGB_888x_SkColorType
pixel with 8 bits each for red, green, blue; in 32-bit word
@ kBGRA_1010102_SkColorType
10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
@ kA16_float_SkColorType
pixel with a half float for alpha
@ kRGBA_F32_SkColorType
pixel using C float for red, green, blue, alpha; in 128-bit word
@ kRGBA_1010102_SkColorType
10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
@ kBGR_101010x_XR_SkColorType
pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
@ kR16G16_unorm_SkColorType
pixel with a little endian uint16_t for red and green
@ kRGBA_F16Norm_SkColorType
pixel with half floats in [0,1] for red, green, blue, alpha;
@ kUnknown_SkColorType
uninitialized
@ kR16G16_float_SkColorType
pixel with a half float for red and green
SK_API int SkColorTypeBytesPerPixel(SkColorType ct)
void toProfile(skcms_ICCProfile *) const
static float min(float r, float g, float b)
bool skcms_Transform(const void *src, skcms_PixelFormat srcFmt, skcms_AlphaFormat srcAlpha, const skcms_ICCProfile *srcProfile, void *dst, skcms_PixelFormat dstFmt, skcms_AlphaFormat dstAlpha, const skcms_ICCProfile *dstProfile, size_t nz)
const skcms_ICCProfile * skcms_sRGB_profile()
@ skcms_PixelFormat_RGBA_8888_sRGB
@ skcms_PixelFormat_RGBA_16161616BE
@ skcms_PixelFormat_BGR_101010x_XR
@ skcms_PixelFormat_RGBA_ffff
@ skcms_PixelFormat_RGBA_1010102
@ skcms_PixelFormat_BGRA_8888
@ skcms_PixelFormat_RGBA_hhhh
@ skcms_PixelFormat_RGBA_8888
@ skcms_PixelFormat_BGR_565
@ skcms_PixelFormat_ABGR_4444
@ skcms_PixelFormat_BGRA_1010102
@ skcms_PixelFormat_RGBA_16161616LE
@ skcms_AlphaFormat_Unpremul
@ skcms_AlphaFormat_PremulAsEncoded
@ skcms_AlphaFormat_Opaque
constexpr int32_t width() const
constexpr int32_t height() const