29#include <Gfx/Graph/decoders/GPUVideoDecoder.hpp>
30#include <Gfx/Graph/decoders/Bayer.hpp>
33#include <libavformat/avformat.h>
44 static const constexpr auto oes_filter = R
"_(#version 450
48layout(binding=3) uniform sampler2D tex;
50layout(location = 0) in vec2 v_texcoord;
51layout(location = 0) out vec4 fragColor;
57 vec2 tp = v_texcoord * ts;
58 vec2 base = floor(tp) + 0.5;
59 ivec2 ip = ivec2(floor(tp));
61 // (0,0) marks the red site; the other three cells follow from its parity.
62 ivec2 c = (ip + ivec2(%1, %2)) & 1;
64 float ctr = texture(tex, base * inv).r;
65 float n = texture(tex, (base + vec2( 0.0,-1.0)) * inv).r;
66 float s = texture(tex, (base + vec2( 0.0, 1.0)) * inv).r;
67 float w = texture(tex, (base + vec2(-1.0, 0.0)) * inv).r;
68 float e = texture(tex, (base + vec2( 1.0, 0.0)) * inv).r;
69 float nw = texture(tex, (base + vec2(-1.0,-1.0)) * inv).r;
70 float ne = texture(tex, (base + vec2( 1.0,-1.0)) * inv).r;
71 float sw = texture(tex, (base + vec2(-1.0, 1.0)) * inv).r;
72 float se = texture(tex, (base + vec2( 1.0, 1.0)) * inv).r;
74 float cross4 = (n + s + w + e) * 0.25;
75 float diag4 = (nw + ne + sw + se) * 0.25;
76 float horz2 = (w + e) * 0.5;
77 float vert2 = (n + s) * 0.5;
80 if(c.x == 0 && c.y == 0)
81 rgb = vec3(ctr, cross4, diag4);
82 else if(c.x == 1 && c.y == 1)
83 rgb = vec3(diag4, cross4, ctr);
84 else if(c.x == 1 && c.y == 0)
85 rgb = vec3(horz2, ctr, vert2);
87 rgb = vec3(vert2, ctr, horz2);
89 fragColor = vec4(adjustCapture(rgb * %3), 1.0);
97 , sampleScale{sampleScale}
103 double sampleScale{1.0};
105 std::pair<QShader, QShader> init(
RenderList& r)
override;
The sensor corrections, as shader source shared by every demosaicer.
#define SCORE_GFX_CAPTURE_ADJUST_FN
Definition CaptureAdjustGLSL.hpp:48
#define SCORE_GFX_CAPTURE_UNIFORMS
Definition CaptureAdjustGLSL.hpp:30
Processes and renders a video frame on the GPU.
Definition GPUVideoDecoder.hpp:90
List of nodes to be rendered to an output.
Definition RenderList.hpp:30
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:11
Phase
Definition Bayer.hpp:44
Definition BayerExternalOES.hpp:40
void exec(RenderList &, QRhiResourceUpdateBatch &, AVFrame &) override
Definition BayerExternalOES.hpp:112