100 {
102 {{-1.f, -1.f, -1.f, 1.0f}, {-1.f, -1.f, -1.f, 1.0f}},
103 {{1.0f, 1.0f, 1.0f, 1.0f}, {1.0f, 1.0f, 0.5f, 1.0f}},
104 {{1.0f, 0.5f, 1.0f, 1.0f}, {1.0f, 0.5f, 0.5f, 1.0f}},
105 {{0.5f, 1.0f, 1.0f, 1.0f}, {0.5f, 1.0f, 0.5f, 1.0f}},
106 {{0.5f, 0.5f, 1.0f, 1.0f}, {0.5f, 0.5f, 0.5f, 1.0f}},
107 };
109 sdrColors,
113
114
115
117 {{-1.f, -1.f, -1.f, 1.f}, {1.0f, 0.0f, 0.0f, 1.f}},
118 {{-1.f, -1.f, -1.f, 1.f}, {0.0f, 1.0f, 1.0f, 1.f}},
119 };
121 gainmapColors,
127
134
136 sdrImageRect,
138 gainmapImage,
139 gainmapImageRect,
141 gainmapInfo,
142 canvasRect,
146 paint.setShader(shader);
148 canvas.drawRect(canvasRect,
paint);
149
150
151
152 constexpr float k10G = 1.353256028586302f;
153
154 constexpr float k05G = 0.6858361015012847f;
155
156
157 constexpr float kR10G = 1.3234778541409058f;
158
159
160 constexpr float kR05G = 0.371934685412575f;
162 {{kR10G, 1.0f, 1.0f, 1.0f}, {kR10G, 1.0f, 0.5f, 1.0f}},
163 {{kR10G, 0.5f, 1.0f, 1.0f}, {kR10G, 0.5f, 0.5f, 1.0f}},
164 {{kR05G, k10G, k10G, 1.0f}, {kR05G, k10G, k05G, 1.0f}},
165 {{kR05G, k05G, k10G, 1.0f}, {kR05G, k05G, k05G, 1.0f}},
166 };
167 for (
int y = 0;
y < 4; ++
y) {
168 for (
int x = 0;
x < 2; ++
x) {
170 const auto& expected = expectedColors[
y][
x];
173 "color (%.3f %.3f %.3f %.3f) does not match expected color (%.3f %.3f "
174 "%.3f %.3f) at "
175 "pixel (%d, %d)",
180 expected.fR,
181 expected.fG,
182 expected.fB,
183 expected.fA,
186 }
187 }
188}