FilmLight E-Gamut / T-Log
Primaries are FilmLight's Enhanced Generic Display Primaries; T-Log is a Cineon-derived logarithmic curve, intended for use as a working colour space.
| x | y | |
|---|---|---|
| Red | 0.8000 | 0.3177 |
| Green | 0.1800 | 0.9000 |
| Blue | 0.0650 | -0.0805 |
| White (D65) | 0.3127 | 0.3290 |
Transfer function
| Curve | FilmLight-T-log |
|---|---|
| Black / white point (10-bit code values) | 0 / 1023 |
| Linear 0 → code | 0.0750 |
| 18% grey → code | 0.3966 |
| Linear 1.0 → code | 0.5525 |
Encoding: convertFromLinear
vec4 convertFromLinear(vec4 val, int clip)
{
float w = 128.0;
float g = 16.0;
float o = 0.075;
// Constants
float b = 1.0/(0.7107 + 1.2359*log(w*g));
float gs = g/(1.0 - o);
float C = b/gs;
float a = 1.0 - b*log(w+C);
float y0 = a + b*log(C);
float s = (1.0 - o)/(1.0 - y0);
float A = 1.0 + (a - 1.0)*s;
float B = b*s;
float G = gs*s;
val.r = val.r < 0.0 ? G*val.r + o : log(val.r + C)*B + A;
val.g = val.g < 0.0 ? G*val.g + o : log(val.g + C)*B + A;
val.b = val.b < 0.0 ? G*val.b + o : log(val.b + C)*B + A;
return val;
}Decoding: convertToLinear
vec4 convertToLinear(vec4 val)
{
float w = 128.0;
float g = 16.0;
float o = 0.075;
// Constants
float b = 1.0/(0.7107 + 1.2359*log(w*g));
float gs = g/(1.0 - o);
float C = b/gs;
float a = 1.0 - b*log(w+C);
float y0 = a + b*log(C);
float s = (1.0 - o)/(1.0 - y0);
float A = 1.0 + (a - 1.0)*s;
float B = b*s;
float G = gs*s;
// Clip so output fits half float limit
vec3 P = clamp(val.rgb, -60000.0, 1.86);
P.r = P.r < o ? (P.r-o)/G : exp((P.r -A)/B) - C;
P.g = P.g < o ? (P.g-o)/G : exp((P.g -A)/B) - C;
P.b = P.b < o ? (P.b-o)/G : exp((P.b -A)/B) - C;
return vec4(P, val.a);
}RGB → XYZ matrix
RGB → XYZ [ 0.705396850088 0.164041328310 0.081017748654 ] [ 0.280130724091 0.820206641550 -0.100337365641 ] [ -0.103781511569 -0.072907257027 1.265746519356 ]
Use this space Gamut compare ↗ Transfer compare ↗