// CreateImageSurface is a wrapper around cairo_image_surface_create(). func CreateImageSurface(format Format, width, height int) *Surface { c := C.cairo_image_surface_create(C.cairo_format_t(format), C.int(width), C.int(height)) s := wrapSurface(c) runtime.SetFinalizer(s, (*Surface).destroy) return s }
func NewSurface(format Format, width, height int) *Surface { s := C.cairo_image_surface_create(C.cairo_format_t(format), C.int(width), C.int(height)) return &Surface{surface: s, context: C.cairo_create(s)} }
func NewSurface(format Format, width, height int) *Surface { surface := new(Surface) surface.surface = C.cairo_image_surface_create(C.cairo_format_t(format), C.int(width), C.int(height)) surface.context = C.cairo_create(surface.surface) return surface }
func (self Format) StrideForWidth(width int) int { return int(C.cairo_format_stride_for_width(C.cairo_format_t(self), C.int(width))) }
func (f Format) c() C.cairo_format_t { return C.cairo_format_t(f) }