diff --git a/Raylib-cs/interop/Raylib.cs b/Raylib-cs/interop/Raylib.cs index 9bb32fd..b93a37a 100644 --- a/Raylib-cs/interop/Raylib.cs +++ b/Raylib-cs/interop/Raylib.cs @@ -1568,6 +1568,10 @@ public static unsafe partial class Raylib [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageBlurGaussian(Image* image, int blurSize); + // Apply custom square convolution kernel to image + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void ImageKernelConvolution(Image* image, float* kernel, int kernelSize); + /// Resize image (Bicubic scaling algorithm) [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageResize(Image* image, int newWidth, int newHeight); diff --git a/Raylib-cs/types/Raylib.Utils.cs b/Raylib-cs/types/Raylib.Utils.cs index 5220316..97608ab 100644 --- a/Raylib-cs/types/Raylib.Utils.cs +++ b/Raylib-cs/types/Raylib.Utils.cs @@ -507,6 +507,18 @@ public static unsafe partial class Raylib } } + // Apply custom square convolution kernel to image + public static void ImageKernelConvolution(ref Image image, float[] kernel) + { + fixed (Image* imagePtr = &image) + { + fixed (float* kernelPtr = kernel) + { + ImageKernelConvolution(imagePtr, kernelPtr, kernel.Length); + } + } + } + /// Crop an image to a defined rectangle public static void ImageCrop(ref Image image, Rectangle crop) {