slang-shaders/ntsc/shaders/maister/ntsc-rgbyuv.inc

21 lines
339 B
PHP
Raw Permalink Normal View History

const mat3 yiq2rgb_mat = mat3(
1.0, 0.956, 0.6210,
1.0, -0.2720, -0.6474,
1.0, -1.1060, 1.7046);
2016-07-13 14:38:02 +10:00
vec3 yiq2rgb(vec3 yiq)
{
return yiq * yiq2rgb_mat;
2016-07-13 14:38:02 +10:00
}
const mat3 yiq_mat = mat3(
0.2989, 0.5870, 0.1140,
0.5959, -0.2744, -0.3216,
0.2115, -0.5229, 0.3114
2016-07-13 14:38:02 +10:00
);
vec3 rgb2yiq(vec3 col)
{
return col * yiq_mat;
2016-07-13 14:38:02 +10:00
}