23 srgb->toProfile(&srgb_profile);
25 dp3->toProfile(&dp3_profile);
29 0xffff0000, 0x7fff0000, 0x7f7f0000,
30 0xff00ff00, 0x7f00ff00, 0x7f007f00,
41 &via_skcms, f32,
premul, &dp3_profile,
46 float via_steps[4] = {
52 steps.
apply(via_steps);
60 float steps_to_skcms[4];
62 steps_to_skcms, f32,
premul, &srgb_profile,
65 float skcms_to_steps[4] = { via_skcms[0], via_skcms[1], via_skcms[2], via_skcms[3] };
68 inv_steps.
apply(skcms_to_steps);
70 REPORTER_ASSERT(r, fabsf(skcms_to_steps[0] - steps_to_skcms[0]) <= 0.005f);
71 REPORTER_ASSERT(r, fabsf(skcms_to_steps[1] - steps_to_skcms[1]) <= 0.005f);
72 REPORTER_ASSERT(r, fabsf(skcms_to_steps[2] - steps_to_skcms[2]) <= 0.005f);
73 REPORTER_ASSERT(r, fabsf(skcms_to_steps[3] - steps_to_skcms[3]) <= 0.0f);
DEF_TEST(SkColorSpaceXformSteps_vs_skcms, r)
static const uint32_t bgra[kNumPixels]
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
#define SkColorGetR(color)
#define SkColorGetG(color)
#define SkColorGetA(color)
#define SkColorGetB(color)
#define REPORTER_ASSERT(r, cond,...)
static uint32_t premul(uint32_t color)
static sk_sp< SkColorSpace > MakeSRGB()
static sk_sp< SkColorSpace > MakeRGB(const skcms_TransferFunction &transferFn, const skcms_Matrix3x3 &toXYZ)
static constexpr skcms_Matrix3x3 kDisplayP3
static constexpr skcms_TransferFunction kSRGB
PODArray< SkColor > colors
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)
@ skcms_PixelFormat_RGBA_ffff
@ skcms_PixelFormat_BGRA_8888
@ skcms_AlphaFormat_Unpremul
@ skcms_AlphaFormat_PremulAsEncoded