17 float in[256],
out[256];
18 for (
int i = 0;
i < 256;
i++) {
27 p.append(SkRasterPipelineOp::load_f32, &ip);
28 p.appendTransferFunction(fn);
29 p.append(SkRasterPipelineOp::store_f32, &op);
34 for (
int i = 0;
i < 256;
i++) {
35 float want = (in[
i] <= fn.
d) ? fn.
c * in[
i] + fn.
f
36 : powf(in[
i] * fn.
a + fn.
b, fn.
g) + fn.
e;
40 float err = fabsf(
out[
i] - want);
42 ERRORF(r,
"At %d, error was %g (got %g, want %g)",
i, err,
out[
i], want);
DEF_TEST(Parametric_sRGB, r)
static void check_error(skiatest::Reporter *r, float limit, skcms_TransferFunction fn)