ImageKernelConvolution function added
This commit is contained in:
parent
bf03596ee4
commit
19bdd59547
2 changed files with 14 additions and 0 deletions
|
@ -287,6 +287,7 @@ var imageAlphaClear func(image *Image, col uintptr, threshold float32)
|
||||||
var imageAlphaMask func(image *Image, alphaMask uintptr)
|
var imageAlphaMask func(image *Image, alphaMask uintptr)
|
||||||
var imageAlphaPremultiply func(image *Image)
|
var imageAlphaPremultiply func(image *Image)
|
||||||
var imageBlurGaussian func(image *Image, blurSize int32)
|
var imageBlurGaussian func(image *Image, blurSize int32)
|
||||||
|
var imageKernelConvolution func(image *Image, kernel []float32, kernelSize int32)
|
||||||
var imageResize func(image *Image, newWidth int32, newHeight int32)
|
var imageResize func(image *Image, newWidth int32, newHeight int32)
|
||||||
var imageResizeNN func(image *Image, newWidth int32, newHeight int32)
|
var imageResizeNN func(image *Image, newWidth int32, newHeight int32)
|
||||||
var imageResizeCanvas func(image *Image, newWidth int32, newHeight int32, offsetX int32, offsetY int32, fill uintptr)
|
var imageResizeCanvas func(image *Image, newWidth int32, newHeight int32, offsetX int32, offsetY int32, fill uintptr)
|
||||||
|
@ -792,6 +793,7 @@ func init() {
|
||||||
purego.RegisterLibFunc(&imageAlphaMask, raylibDll, "ImageAlphaMask")
|
purego.RegisterLibFunc(&imageAlphaMask, raylibDll, "ImageAlphaMask")
|
||||||
purego.RegisterLibFunc(&imageAlphaPremultiply, raylibDll, "ImageAlphaPremultiply")
|
purego.RegisterLibFunc(&imageAlphaPremultiply, raylibDll, "ImageAlphaPremultiply")
|
||||||
purego.RegisterLibFunc(&imageBlurGaussian, raylibDll, "ImageBlurGaussian")
|
purego.RegisterLibFunc(&imageBlurGaussian, raylibDll, "ImageBlurGaussian")
|
||||||
|
purego.RegisterLibFunc(&imageKernelConvolution, raylibDll, "ImageKernelConvolution")
|
||||||
purego.RegisterLibFunc(&imageResize, raylibDll, "ImageResize")
|
purego.RegisterLibFunc(&imageResize, raylibDll, "ImageResize")
|
||||||
purego.RegisterLibFunc(&imageResizeNN, raylibDll, "ImageResizeNN")
|
purego.RegisterLibFunc(&imageResizeNN, raylibDll, "ImageResizeNN")
|
||||||
purego.RegisterLibFunc(&imageResizeCanvas, raylibDll, "ImageResizeCanvas")
|
purego.RegisterLibFunc(&imageResizeCanvas, raylibDll, "ImageResizeCanvas")
|
||||||
|
@ -2535,6 +2537,11 @@ func ImageBlurGaussian(image *Image, blurSize int32) {
|
||||||
imageBlurGaussian(image, blurSize)
|
imageBlurGaussian(image, blurSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ImageKernelConvolution - Apply custom square convolution kernel to image
|
||||||
|
func ImageKernelConvolution(image *Image, kernel []float32) {
|
||||||
|
imageKernelConvolution(image, kernel, int32(len(kernel)))
|
||||||
|
}
|
||||||
|
|
||||||
// ImageResize - Resize image (Bicubic scaling algorithm)
|
// ImageResize - Resize image (Bicubic scaling algorithm)
|
||||||
func ImageResize(image *Image, newWidth int32, newHeight int32) {
|
func ImageResize(image *Image, newWidth int32, newHeight int32) {
|
||||||
imageResize(image, newWidth, newHeight)
|
imageResize(image, newWidth, newHeight)
|
||||||
|
|
|
@ -381,6 +381,13 @@ func ImageBlurGaussian(image *Image, blurSize int32) {
|
||||||
C.ImageBlurGaussian(cimage, cblurSize)
|
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)
|
// ImageResize - Resize an image (bilinear filtering)
|
||||||
func ImageResize(image *Image, newWidth, newHeight int32) {
|
func ImageResize(image *Image, newWidth, newHeight int32) {
|
||||||
cimage := image.cptr()
|
cimage := image.cptr()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue