1 Star 0 Fork 0

满清末造 / gotk3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
format.go 907 Bytes
一键复制 编辑 原始数据 按行查看 历史
package cairo
// #include <stdlib.h>
// #include <cairo.h>
// #include <cairo-gobject.h>
import "C"
import (
"unsafe"
)
// Format is a representation of Cairo's cairo_format_t.
type Format int
const (
FORMAT_INVALID Format = C.CAIRO_FORMAT_INVALID
FORMAT_ARGB32 Format = C.CAIRO_FORMAT_ARGB32
FORMAT_RGB24 Format = C.CAIRO_FORMAT_RGB24
FORMAT_A8 Format = C.CAIRO_FORMAT_A8
FORMAT_A1 Format = C.CAIRO_FORMAT_A1
FORMAT_RGB16_565 Format = C.CAIRO_FORMAT_RGB16_565
FORMAT_RGB30 Format = C.CAIRO_FORMAT_RGB30
)
func marshalFormat(p uintptr) (interface{}, error) {
c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p)))
return Format(c), nil
}
// FormatStrideForWidth is a wrapper for cairo_format_stride_for_width().
func FormatStrideForWidth(format Format, width int) int {
c := C.cairo_format_stride_for_width(C.cairo_format_t(format), C.int(width))
return int(c)
}
1
https://gitee.com/antkillerfarm/gotk3.git
git@gitee.com:antkillerfarm/gotk3.git
antkillerfarm
gotk3
gotk3
v0.4.0

搜索帮助

53164aa7 5694891 3bd8fe86 5694891