summaryrefslogtreecommitdiff
path: root/src/qcam/assets/shader/bayer_8.frag
diff options
context:
space:
mode:
authorAndrey Konovalov <andrey.konovalov@linaro.org>2021-06-22 16:46:51 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-06-30 04:09:10 +0300
commit43fd7d0fc84035793639d6f432f621dba3c64ef8 (patch)
tree0082cba2630cff93f8de534335d6e07b37c42868 /src/qcam/assets/shader/bayer_8.frag
parente4be72d0ca1099173869e4aa1b9604773dcae7b8 (diff)
qcam: viewfinder_gl: Add support for RAW8 Bayer formats
This integrates the vertex and the fragment shaders by Morgan McGuire into qcam. Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/qcam/assets/shader/bayer_8.frag')
-rw-r--r--src/qcam/assets/shader/bayer_8.frag9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/qcam/assets/shader/bayer_8.frag b/src/qcam/assets/shader/bayer_8.frag
index a7d65e1d..4ece44ab 100644
--- a/src/qcam/assets/shader/bayer_8.frag
+++ b/src/qcam/assets/shader/bayer_8.frag
@@ -9,20 +9,23 @@ Morgan McGuire
This paper appears in issue Volume 13, Number 4.
---------------------------------------------------------
Copyright (c) 2008, Morgan McGuire. All rights reserved.
+
+Modified by Linaro Ltd to integrate it into libcamera.
+Copyright (C) 2021, Linaro
*/
//Pixel Shader
/** Monochrome RGBA or GL_LUMINANCE Bayer encoded texture.*/
-uniform sampler2D source;
+uniform sampler2D tex_y;
varying vec4 center;
varying vec4 yCoord;
varying vec4 xCoord;
void main(void) {
- #define fetch(x, y) texture2D(source, vec2(x, y)).r
+ #define fetch(x, y) texture2D(tex_y, vec2(x, y)).r
- float C = texture2D(source, center.xy).r; // ( 0, 0)
+ float C = texture2D(tex_y, center.xy).r; // ( 0, 0)
const vec4 kC = vec4( 4.0, 6.0, 5.0, 5.0) / 8.0;
// Determine which of four types of pixels we are on.