add PadHexs and ToMMBitmap support

This commit is contained in:
vcaesar 2022-01-03 21:51:52 -04:00
parent f6abdbe21b
commit d2f905e308

View File

@ -192,6 +192,11 @@ func PadHex(hex C.MMRGBHex) string {
return gcolor
}
// PadHexs trans CHex to string
func PadHexs(hex CHex) string {
return PadHex(C.MMRGBHex(hex))
}
// HexToRgb trans hex to rgb
func HexToRgb(hex uint32) *C.uint8_t {
return C.color_hex_to_rgb(C.uint32_t(hex))
@ -343,6 +348,11 @@ func FreeBitmap(bitmap CBitmap) {
C.bitmap_dealloc(C.MMBitmapRef(bitmap))
}
// ToMMBitmapRef trans CBitmap to C.MMBitmapRef
func ToMMBitmapRef(bit CBitmap) C.MMBitmapRef {
return C.MMBitmapRef(bit)
}
// ToBitmap trans C.MMBitmapRef to Bitmap
func ToBitmap(bit CBitmap) Bitmap {
bitmap := Bitmap{