Home | History | Annotate | Download | only in tests

Lines Matching full:srgb

20 /** convert 0..1 srgb value to 0..1 linear */
21 float srgb_to_linear(float srgb) {
22 if (srgb <= 0.04045f) {
23 return srgb / 12.92f;
25 return powf((srgb + 0.055f) / 1.055f, 2.4f);
29 /** convert 0..1 linear value to 0..1 srgb */
99 static bool check_srgb_to_linear_conversion(uint32_t srgb, uint32_t linear, float error) {
100 return check_conversion<srgb_to_linear>(srgb, linear, error);
103 static bool check_linear_to_srgb_conversion(uint32_t linear, uint32_t srgb, float error) {
104 return check_conversion<linear_to_srgb>(linear, srgb, error);
180 case Encoding::kSRGB: return "sRGB";
259 // are sRGB, linear, or untagged RGBA_8888.
268 // For the all-sRGB case, we allow a small error only for devices that have
269 // precision variation because the sRGB data gets converted to linear and back in
274 // Write sRGB data to a sRGB context - no conversion on the write.
276 // back to sRGB no conversion
279 // Untagged read from sRGB is treated as a conversion back to linear. TODO: Fail or don't
289 // Write untagged data to a sRGB context - Currently this treats the untagged data as
290 // linear and converts to sRGB during the write. TODO: Fail or passthrough?
292 // read back to srgb, no additional conversion
307 // Write linear data to a sRGB context. It gets converted to sRGB on write. The reads
321 // The read from untagged to sRGB also does no conversion. TODO: Should it just fail?
333 // Write sRGB data to a linear context - converts to sRGB on the write.
335 // converts back to sRGB on read.
350 // Reading to sRGB does a conversion.
367 // Reading to sRGB does a conversion.