Fig. 1: Apple Log / Rec.2020 — CIE 1931 xy.Fig. 2: Apple Log / Rec.2020 encoding curve, L = 0.18 × 2^stops. | x | y |
|---|
| Red | 0.7080 | 0.2920 |
| Green | 0.1700 | 0.7970 |
| Blue | 0.1310 | 0.0460 |
| White (D65) | 0.3127 | 0.3290 |
Transfer function
| Curve | Apple-log |
|---|
| Black / white point (10-bit code values) | 0 / 1023 |
|---|
| Linear 0 → code | 0.1505 |
|---|
| 18% grey → code | 0.4883 |
|---|
| Linear 1.0 → code | 0.6946 |
|---|
Encoding: convertFromLinear
vec4 convertFromLinear(vec4 val, int clip)
{
float b = 0.00964052;
float c = 0.08550479;
float d = 0.69336945;
float e = 0.05641088;
float f = 47.28711236;
float o = 0.208555315954642;
float o2 = pow(o / f, 0.5) - e;
vec3 P = max(val.rgb,-e);
P.r = P.r > o2 ? c*log(P.r+b)/log(2.0)+d : (P.r + e) * (P.r + e) * f;
P.g = P.g > o2 ? c*log(P.g+b)/log(2.0)+d : (P.g + e) * (P.g + e) * f;
P.b = P.b > o2 ? c*log(P.b+b)/log(2.0)+d : (P.b + e) * (P.b + e) * f;
return vec4(P.rgb, val.a);
}Decoding: convertToLinear
vec4 convertToLinear(vec4 val)
{
float b = 0.00964052;
float c = 0.08550479;
float d = 0.69336945;
float e = 0.05641088;
float f = 47.28711236;
float o = 0.208555315954642;
vec3 P = max(val.rgb,vec3(0.0));
P.r = P.r > o ? (pow(2.0,((P.r - d) / c))) - b : pow(P.r / f, 0.5) - e ;
P.g = P.g > o ? (pow(2.0,((P.g - d) / c))) - b : pow(P.g / f, 0.5) - e ;
P.b = P.b > o ? (pow(2.0,((P.b - d) / c))) - b : pow(P.b / f, 0.5) - e ;
return vec4(P.rgb, val.a);
}RGB → XYZ matrix
RGB → XYZ
[ 0.636958048301 0.144616903586 0.168880975164 ]
[ 0.262700212011 0.677998071519 0.059301716470 ]
[ 0.000000000000 0.028072693049 1.060985057711 ]
Use this space
Gamut compare ↗
Transfer compare ↗
Sources
- Apple Developer: AVCaptureColorSpace.appleLog