Go to the source code of this file.
|
static void | check_error (skiatest::Reporter *r, float limit, skcms_TransferFunction fn) |
|
static void | check_error (skiatest::Reporter *r, float limit, float gamma) |
|
| DEF_TEST (Parametric_sRGB, r) |
|
| DEF_TEST (Parametric_1dot0, r) |
|
| DEF_TEST (Parametric_1dot2, r) |
|
| DEF_TEST (Parametric_1dot4, r) |
|
| DEF_TEST (Parametric_1dot8, r) |
|
| DEF_TEST (Parametric_2dot0, r) |
|
| DEF_TEST (Parametric_2dot2, r) |
|
| DEF_TEST (Parametric_2dot4, r) |
|
| DEF_TEST (Parametric_inv_1dot2, r) |
|
| DEF_TEST (Parametric_inv_1dot4, r) |
|
| DEF_TEST (Parametric_inv_1dot8, r) |
|
| DEF_TEST (Parametric_inv_2dot0, r) |
|
| DEF_TEST (Parametric_inv_2dot2, r) |
|
| DEF_TEST (Parametric_inv_2dot4, r) |
|
◆ check_error() [1/2]
Definition at line 47 of file ParametricStageTest.cpp.
47 {
52}
static void check_error(skiatest::Reporter *r, float limit, skcms_TransferFunction fn)
◆ check_error() [2/2]
Definition at line 16 of file ParametricStageTest.cpp.
16 {
17 float in[256],
out[256];
18 for (
int i = 0;
i < 256;
i++) {
21 }
22
25
27 p.append(SkRasterPipelineOp::load_f32, &ip);
28 p.appendTransferFunction(fn);
29 p.append(SkRasterPipelineOp::store_f32, &op);
30
32
33
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;
39 }
40 float err = fabsf(
out[
i] - want);
41 if (err > limit) {
42 ERRORF(r,
"At %d, error was %g (got %g, want %g)",
i, err,
out[
i], want);
43 }
44 }
45}
◆ DEF_TEST() [1/14]
DEF_TEST |
( |
Parametric_1dot0 |
, |
|
|
r |
|
|
) |
| |
◆ DEF_TEST() [2/14]
DEF_TEST |
( |
Parametric_1dot2 |
, |
|
|
r |
|
|
) |
| |
◆ DEF_TEST() [3/14]
DEF_TEST |
( |
Parametric_1dot4 |
, |
|
|
r |
|
|
) |
| |
◆ DEF_TEST() [4/14]
DEF_TEST |
( |
Parametric_1dot8 |
, |
|
|
r |
|
|
) |
| |
◆ DEF_TEST() [5/14]
DEF_TEST |
( |
Parametric_2dot0 |
, |
|
|
r |
|
|
) |
| |
◆ DEF_TEST() [6/14]
DEF_TEST |
( |
Parametric_2dot2 |
, |
|
|
r |
|
|
) |
| |
◆ DEF_TEST() [7/14]
DEF_TEST |
( |
Parametric_2dot4 |
, |
|
|
r |
|
|
) |
| |
◆ DEF_TEST() [8/14]
DEF_TEST |
( |
Parametric_inv_1dot2 |
, |
|
|
r |
|
|
) |
| |
◆ DEF_TEST() [9/14]
DEF_TEST |
( |
Parametric_inv_1dot4 |
, |
|
|
r |
|
|
) |
| |
◆ DEF_TEST() [10/14]
DEF_TEST |
( |
Parametric_inv_1dot8 |
, |
|
|
r |
|
|
) |
| |
◆ DEF_TEST() [11/14]
DEF_TEST |
( |
Parametric_inv_2dot0 |
, |
|
|
r |
|
|
) |
| |
◆ DEF_TEST() [12/14]
DEF_TEST |
( |
Parametric_inv_2dot2 |
, |
|
|
r |
|
|
) |
| |
◆ DEF_TEST() [13/14]
DEF_TEST |
( |
Parametric_inv_2dot4 |
, |
|
|
r |
|
|
) |
| |
◆ DEF_TEST() [14/14]
DEF_TEST |
( |
Parametric_sRGB |
, |
|
|
r |
|
|
) |
| |
Definition at line 54 of file ParametricStageTest.cpp.
54 {
55
57 2.4f,
58 1.0f / 1.055f,
59 0.055f / 1.055f,
60 1.0f / 12.92f,
61 0.04045f,
62 0.0f,
63 0.0f,
64 });
65}