ImageKernelConvolution function added

This commit is contained in:
JupiterRider 2024-11-24 12:39:13 +01:00
parent bf03596ee4
commit 19bdd59547
2 changed files with 14 additions and 0 deletions

View file

@ -381,6 +381,13 @@ func ImageBlurGaussian(image *Image, blurSize int32) {
C.ImageBlurGaussian(cimage, cblurSize)
}
// ImageKernelConvolution - Apply custom square convolution kernel to image
func ImageKernelConvolution(image *Image, kernel []float32) {
cimage := image.cptr()
ckernel := (*C.float)(unsafe.Pointer(&kernel[0]))
C.ImageKernelConvolution(cimage, ckernel, C.int(len(kernel)))
}
// ImageResize - Resize an image (bilinear filtering)
func ImageResize(image *Image, newWidth, newHeight int32) {
cimage := image.cptr()