You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am using SkiaSharp 2.88.3.
There is a function called ToColorFilter(uniforms, children) however I cannot understand how it is supposed to work.
The only example I found in SKRuntimeEffectTest.cs is not working and cf1 is null.
var src = @"
uniform shader input;
half4 main() {
return sample(input);
}";
using var img = SKImage.FromEncodedData(Path.Combine(PathToImages, "baboon.jpg"));
canvas.DrawImage(img, 0, 0);
using var effect = SKRuntimeEffect.Create(src, out var errorText);
Assert.Null(errorText);
Assert.NotNull(effect);
var cf1 = effect.ToColorFilter();
I can only get a non-null ColorFilter using this Shader... but it is very useful.
half4 main(float2 p) {
return half4(0);
}
I suppose there are limitations but what are they?
I need to access to the main image (input?), and possibly to other images to combine them, or textures to use as Look-up tables.
Can I do that using a custom color filter?
Thanks for helping.
The text was updated successfully, but these errors were encountered:
As of today, SKRuntimeEffect is not supported on a raster/bitmap canvas and only on the GPU.
Hi @mattleibow
Thank you for your answer, however this one is not about rendering in bitmap, but how to SKRuntimeEffect's ToColorFilter function.
I implemented Lut3D effect in a shader and I use it with DrawRect, but I would like to convert it to ColorFilter to use it with DrawImage. With shader, as I am using a LUT, I am forced to use Low interpolation (no-mipmap) sampling, instead of Medium (mipmaps) for the drawing image which do not look as great as medium.
ghost
locked as resolved and limited conversation to collaborators
Aug 31, 2023
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I am using SkiaSharp 2.88.3.
There is a function called ToColorFilter(uniforms, children) however I cannot understand how it is supposed to work.
The only example I found in SKRuntimeEffectTest.cs is not working and cf1 is null.
I can only get a non-null ColorFilter using this Shader... but it is very useful.
I suppose there are limitations but what are they?
I need to access to the main image (input?), and possibly to other images to combine them, or textures to use as Look-up tables.
Can I do that using a custom color filter?
Thanks for helping.
The text was updated successfully, but these errors were encountered: