ImageFromChannel function added
This commit is contained in:
parent
23f1ab19b7
commit
bf03596ee4
2 changed files with 18 additions and 0 deletions
|
@ -292,6 +292,15 @@ func ImageFromImage(image Image, rec Rectangle) Image {
|
|||
return *v
|
||||
}
|
||||
|
||||
// ImageFromChannel - Create an image from a selected channel of another image (GRAYSCALE)
|
||||
func ImageFromChannel(image Image, selectedChannel int32) Image {
|
||||
cimage := image.cptr()
|
||||
cselectedChannel := C.int(selectedChannel)
|
||||
ret := C.ImageFromChannel(*cimage, cselectedChannel)
|
||||
v := newImageFromPointer(unsafe.Pointer(&ret))
|
||||
return *v
|
||||
}
|
||||
|
||||
// ImageText - Create an image from text (default font)
|
||||
func ImageText(text string, fontSize int32, col color.RGBA) *Image {
|
||||
ctext := C.CString(text)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue