ImageKernelConvolution added
This commit is contained in:
parent
4c4fef33bd
commit
09979569bb
2 changed files with 16 additions and 0 deletions
|
|
@ -1568,6 +1568,10 @@ public static unsafe partial class Raylib
|
||||||
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void ImageBlurGaussian(Image* image, int blurSize);
|
public static extern void ImageBlurGaussian(Image* image, int blurSize);
|
||||||
|
|
||||||
|
// <summary>Apply custom square convolution kernel to image</summary>
|
||||||
|
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void ImageKernelConvolution(Image* image, float* kernel, int kernelSize);
|
||||||
|
|
||||||
/// <summary>Resize image (Bicubic scaling algorithm)</summary>
|
/// <summary>Resize image (Bicubic scaling algorithm)</summary>
|
||||||
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void ImageResize(Image* image, int newWidth, int newHeight);
|
public static extern void ImageResize(Image* image, int newWidth, int newHeight);
|
||||||
|
|
|
||||||
|
|
@ -507,6 +507,18 @@ public static unsafe partial class Raylib
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// <summary>Apply custom square convolution kernel to image</summary>
|
||||||
|
public static void ImageKernelConvolution(ref Image image, float[] kernel)
|
||||||
|
{
|
||||||
|
fixed (Image* imagePtr = &image)
|
||||||
|
{
|
||||||
|
fixed (float* kernelPtr = kernel)
|
||||||
|
{
|
||||||
|
ImageKernelConvolution(imagePtr, kernelPtr, kernel.Length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>Crop an image to a defined rectangle</summary>
|
/// <summary>Crop an image to a defined rectangle</summary>
|
||||||
public static void ImageCrop(ref Image image, Rectangle crop)
|
public static void ImageCrop(ref Image image, Rectangle crop)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue