summaryrefslogtreecommitdiffstats
path: root/src/qtmultimediaquicktools/shaders/yuyvvideo_core.frag
blob: 010c4a5f273ae48bf783aecfc4e016afe50f16f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#version 150 core
uniform sampler2D yTexture; // Y component passed as GL_LUMINANCE_ALPHA, in yuyv Y = r
uniform sampler2D uvTexture; // UV component passed as RGBA macropixel, in uyvy U = g, V = a
uniform mat4 colorMatrix;
uniform float opacity;
in vec2 qt_TexCoord;
out vec4 fragColor;

void main()
{
    vec3 YUV = vec3(texture(yTexture, qt_TexCoord).r, texture2D(uvTexture, qt_TexCoord).ga);
    fragColor = colorMatrix * vec4(YUV, 1.0) * opacity;
}