Add new functions

This commit is contained in:
Milan Nikolic 2021-11-11 18:34:45 +01:00
parent ec25c4ec9e
commit 914ca1ffdc
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
3 changed files with 62 additions and 4 deletions

View file

@ -355,6 +355,17 @@ func ImageColorReplace(image *Image, color, replace Color) {
C.ImageColorReplace(cimage, *ccolor, *creplace)
}
// GetImageColor - Get image pixel color at (x, y) position
func GetImageColor(image Image, x, y int32) Color {
cimage := image.cptr()
cx := (C.int)(x)
cy := (C.int)(y)
ret := C.GetImageColor(*cimage, cx, cy)
v := newColorFromPointer(unsafe.Pointer(&ret))
return v
}
// ImageClearBackground - Clear image background with given color
func ImageClearBackground(dst *Image, color Color) {
cdst := dst.cptr()