diff options
Diffstat (limited to 'libraries/evas/src/modules/engines/gl_common/shader')
4 files changed, 44 insertions, 28 deletions
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.h index de9acf8..87f4095 100644 --- a/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.h +++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.h | |||
@@ -10,11 +10,15 @@ | |||
10 | "varying vec2 tex_c, tex_c2, tex_c3;\n" | 10 | "varying vec2 tex_c, tex_c2, tex_c3;\n" |
11 | "void main()\n" | 11 | "void main()\n" |
12 | "{\n" | 12 | "{\n" |
13 | " const mat4 yuv2rgb = mat4( 1.16400, 1.16400, 1.16400, 0.00000,\n" | 13 | " float r, g, b, y, u, v;\n" |
14 | " 0.00000, -0.34410, 1.77200, 0.00000,\n" | 14 | " y = texture2D(tex, tex_c.xy).r;\n" |
15 | " 1.40200, -0.71410, 0.00000, 0.00000,\n" | 15 | " u = texture2D(texu, tex_c2.xy).r;\n" |
16 | " -0.77380, 0.45630, -0.95880, 1.00000);\n" | 16 | " v = texture2D(texv, tex_c3.xy).r;\n" |
17 | " gl_FragColor = (yuv2rgb * vec4(texture2D(tex, tex_c.xy).r,\n" | 17 | " y = (y - 0.0625) * 1.164;\n" |
18 | " texture2D(texu, tex_c2.xy).r,\n" | 18 | " u = u - 0.5;\n" |
19 | " texture2D(texv, tex_c3.xy).r, 1.0)) * col;\n" | 19 | " v = v - 0.5;\n" |
20 | " r = y + (1.402 * v);\n" | ||
21 | " g = y - (0.34414 * u) - (0.71414 * v);\n" | ||
22 | " b = y + (1.772 * u);\n" | ||
23 | " gl_FragColor = vec4(r, g, b, 1.0) * col;\n" | ||
20 | "}\n" | 24 | "}\n" |
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.shd index 8e55d14..367fb55 100644 --- a/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.shd +++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.shd | |||
@@ -10,11 +10,15 @@ varying vec4 col; | |||
10 | varying vec2 tex_c, tex_c2, tex_c3; | 10 | varying vec2 tex_c, tex_c2, tex_c3; |
11 | void main() | 11 | void main() |
12 | { | 12 | { |
13 | const mat4 yuv2rgb = mat4( 1.16400, 1.16400, 1.16400, 0.00000, | 13 | float r, g, b, y, u, v; |
14 | 0.00000, -0.34410, 1.77200, 0.00000, | 14 | y = texture2D(tex, tex_c.xy).r; |
15 | 1.40200, -0.71410, 0.00000, 0.00000, | 15 | u = texture2D(texu, tex_c2.xy).r; |
16 | -0.77380, 0.45630, -0.95880, 1.00000); | 16 | v = texture2D(texv, tex_c3.xy).r; |
17 | gl_FragColor = (yuv2rgb * vec4(texture2D(tex, tex_c.xy).r, | 17 | y = (y - 0.0625) * 1.164; |
18 | texture2D(texu, tex_c2.xy).r, | 18 | u = u - 0.5; |
19 | texture2D(texv, tex_c3.xy).r, 1.0)) * col; | 19 | v = v - 0.5; |
20 | r = y + (1.402 * v); | ||
21 | g = y - (0.34414 * u) - (0.71414 * v); | ||
22 | b = y + (1.772 * u); | ||
23 | gl_FragColor = vec4(r, g, b, 1.0) * col; | ||
20 | } | 24 | } |
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.h index ee5855c..0df4b97 100644 --- a/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.h +++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.h | |||
@@ -9,11 +9,15 @@ | |||
9 | "varying vec2 tex_c, tex_c2, tex_c3;\n" | 9 | "varying vec2 tex_c, tex_c2, tex_c3;\n" |
10 | "void main()\n" | 10 | "void main()\n" |
11 | "{\n" | 11 | "{\n" |
12 | " const mat4 yuv2rgb = mat4( 1.16400, 1.16400, 1.16400, 0.00000,\n" | 12 | " float r, g, b, y, u, v;\n" |
13 | " 0.00000, -0.34410, 1.77200, 0.00000,\n" | 13 | " y = texture2D(tex, tex_c.xy).r;\n" |
14 | " 1.40200, -0.71410, 0.00000, 0.00000,\n" | 14 | " u = texture2D(texu, tex_c2.xy).r;\n" |
15 | " -0.77380, 0.45630, -0.95880, 1.00000);\n" | 15 | " v = texture2D(texv, tex_c3.xy).r;\n" |
16 | " gl_FragColor = yuv2rgb * vec4(texture2D(tex, tex_c.xy).r,\n" | 16 | " y = (y - 0.0625) * 1.164;\n" |
17 | " texture2D(texu, tex_c2.xy).r,\n" | 17 | " u = u - 0.5;\n" |
18 | " texture2D(texv, tex_c3.xy).r, 1.0);\n" | 18 | " v = v - 0.5;\n" |
19 | " r = y + (1.402 * v);\n" | ||
20 | " g = y - (0.34414 * u) - (0.71414 * v);\n" | ||
21 | " b = y + (1.772 * u);\n" | ||
22 | " gl_FragColor = vec4(r, g, b, 1.0);\n" | ||
19 | "}\n" | 23 | "}\n" |
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.shd index 3ec4311..ce24622 100644 --- a/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.shd +++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.shd | |||
@@ -9,11 +9,15 @@ uniform sampler2D tex, texu, texv; | |||
9 | varying vec2 tex_c, tex_c2, tex_c3; | 9 | varying vec2 tex_c, tex_c2, tex_c3; |
10 | void main() | 10 | void main() |
11 | { | 11 | { |
12 | const mat4 yuv2rgb = mat4( 1.16400, 1.16400, 1.16400, 0.00000, | 12 | float r, g, b, y, u, v; |
13 | 0.00000, -0.34410, 1.77200, 0.00000, | 13 | y = texture2D(tex, tex_c.xy).r; |
14 | 1.40200, -0.71410, 0.00000, 0.00000, | 14 | u = texture2D(texu, tex_c2.xy).r; |
15 | -0.77380, 0.45630, -0.95880, 1.00000); | 15 | v = texture2D(texv, tex_c3.xy).r; |
16 | gl_FragColor = yuv2rgb * vec4(texture2D(tex, tex_c.xy).r, | 16 | y = (y - 0.0625) * 1.164; |
17 | texture2D(texu, tex_c2.xy).r, | 17 | u = u - 0.5; |
18 | texture2D(texv, tex_c3.xy).r, 1.0); | 18 | v = v - 0.5; |
19 | r = y + (1.402 * v); | ||
20 | g = y - (0.34414 * u) - (0.71414 * v); | ||
21 | b = y + (1.772 * u); | ||
22 | gl_FragColor = vec4(r, g, b, 1.0); | ||
19 | } | 23 | } |