Hello,
I am quite new to Skia,
I have yuv image 3 byte arrays. I want to delegate the conversion( to rgb) of the image to gpu if it is possible. I have tried this shader code.
var src = @" uniform shader yImage;
uniform shader uImage;
uniform shader vImage;
uniform float3 canvasResolution;
uniform float3 frameResolution;
half4 main(float2 coord) {
float2 scale = frameResolution.xy / canvasResolution.xy;
half y = sample(yImage,coord * scale).r - 0.0625;
half u = sample(uImage,coord * scale).r - 0.5;
half v = sample(vImage,coord * scale).r - 0.5;
half r = y + 1.596 * v;
half g = y - 0.813 * v - 0.391 * u;
half b = y + 2.018 * u;
return half4(r,g,b,1.0);
}";
this is giving an output as you see below.
I use single channel. I have tried Alpha8 and GrayScale, but same result. what can be wrong any idea about it? Cause same math formula works when i try it on opengl.