mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 23:23:55 +00:00
update Bitmap struct delete fuzzy api
This commit is contained in:
parent
c26d9022db
commit
a4a4d26f62
14
robotgo.go
14
robotgo.go
@ -88,11 +88,11 @@ type (
|
|||||||
|
|
||||||
// Bitmap is Bitmap struct
|
// Bitmap is Bitmap struct
|
||||||
type Bitmap struct {
|
type Bitmap struct {
|
||||||
ImageBuffer *uint8
|
ImgBuf *uint8
|
||||||
Width int
|
Width int
|
||||||
Height int
|
Height int
|
||||||
Bytewidth int
|
Bytewidth int
|
||||||
BitsPerPixel uint8
|
BitsPixel uint8
|
||||||
BytesPerPixel uint8
|
BytesPerPixel uint8
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -543,7 +543,7 @@ func KeyTap(tapKey string, args ...interface{}) string {
|
|||||||
// zkey := C.CString(args[0])
|
// zkey := C.CString(args[0])
|
||||||
zkey := C.CString(tapKey)
|
zkey := C.CString(tapKey)
|
||||||
defer C.free(unsafe.Pointer(zkey))
|
defer C.free(unsafe.Pointer(zkey))
|
||||||
|
|
||||||
if len(args) > 2 {
|
if len(args) > 2 {
|
||||||
num = len(args)
|
num = len(args)
|
||||||
for i := 0; i < num; i++ {
|
for i := 0; i < num; i++ {
|
||||||
@ -811,11 +811,11 @@ func GetText(imgPath string, args ...string) (string, error) {
|
|||||||
// ToBitmap trans C.MMBitmapRef to Bitmap
|
// ToBitmap trans C.MMBitmapRef to Bitmap
|
||||||
func ToBitmap(bit C.MMBitmapRef) Bitmap {
|
func ToBitmap(bit C.MMBitmapRef) Bitmap {
|
||||||
bitmap := Bitmap{
|
bitmap := Bitmap{
|
||||||
ImageBuffer: (*uint8)(bit.imageBuffer),
|
ImgBuf: (*uint8)(bit.imageBuffer),
|
||||||
Width: int(bit.width),
|
Width: int(bit.width),
|
||||||
Height: int(bit.height),
|
Height: int(bit.height),
|
||||||
Bytewidth: int(bit.bytewidth),
|
Bytewidth: int(bit.bytewidth),
|
||||||
BitsPerPixel: uint8(bit.bitsPerPixel),
|
BitsPixel: uint8(bit.bitsPerPixel),
|
||||||
BytesPerPixel: uint8(bit.bytesPerPixel),
|
BytesPerPixel: uint8(bit.bytesPerPixel),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -825,11 +825,11 @@ func ToBitmap(bit C.MMBitmapRef) Bitmap {
|
|||||||
// ToCBitmap trans Bitmap to C.MMBitmapRef
|
// ToCBitmap trans Bitmap to C.MMBitmapRef
|
||||||
func ToCBitmap(bit Bitmap) C.MMBitmapRef {
|
func ToCBitmap(bit Bitmap) C.MMBitmapRef {
|
||||||
cbitmap := C.createMMBitmap(
|
cbitmap := C.createMMBitmap(
|
||||||
(*C.uint8_t)(bit.ImageBuffer),
|
(*C.uint8_t)(bit.ImgBuf),
|
||||||
C.size_t(bit.Width),
|
C.size_t(bit.Width),
|
||||||
C.size_t(bit.Height),
|
C.size_t(bit.Height),
|
||||||
C.size_t(bit.Bytewidth),
|
C.size_t(bit.Bytewidth),
|
||||||
C.uint8_t(bit.BitsPerPixel),
|
C.uint8_t(bit.BitsPixel),
|
||||||
C.uint8_t(bit.BytesPerPixel),
|
C.uint8_t(bit.BytesPerPixel),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user