File: debayer.vert

package info (click to toggle)
megapixels 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,876 kB
  • sloc: ansic: 6,530; python: 442; xml: 367; sh: 116; makefile: 3
file content (29 lines) | stat: -rw-r--r-- 669 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifdef GL_ES
#if defined(PRECISION_MEDIUM)
precision mediump float;
#elif defined(PRECISION_HIGH)
precision highp float;
#endif
#endif

attribute vec2 vert;
attribute vec2 tex_coord;

uniform mat3 transform;
uniform vec2 pixel_size;

varying vec2 top_left_uv;
varying vec2 top_right_uv;
varying vec2 bottom_left_uv;
varying vec2 bottom_right_uv;

void
main()
{
    top_left_uv = tex_coord - pixel_size / 2.0;
    bottom_right_uv = tex_coord + pixel_size / 2.0;
    top_right_uv = vec2(top_left_uv.x, bottom_right_uv.y); // FIXME: this is bottom right
    bottom_left_uv = vec2(bottom_right_uv.x, top_left_uv.y);

    gl_Position = vec4(transform * vec3(vert, 1), 1);
}