func RotateSimple(p *Pixbuf, angle PixbufRotation) *Pixbuf { gpixbuf := C.gdk_pixbuf_rotate_simple(p.GPixbuf, C.GdkPixbufRotation(angle)) return &Pixbuf{ GdkPixbuf: &GdkPixbuf{gpixbuf}, GObject: glib.ObjectFromNative(unsafe.Pointer(gpixbuf)), } }
// RotateSimple is a wrapper around gdk_pixbuf_rotate_simple(). func (v *Pixbuf) RotateSimple(angle PixbufRotation) (*Pixbuf, error) { c := C.gdk_pixbuf_rotate_simple(v.native(), C.GdkPixbufRotation(angle)) if c == nil { return nil, nilPtrErr } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} p := &Pixbuf{obj} runtime.SetFinalizer(obj, (*glib.Object).Unref) return p, nil }
import "C" var ( // Colorspace COLORSPACE_RGB = C.GdkColorspace(C.GDK_COLORSPACE_RGB) // InterpType INTERP_NEAREST = C.GdkInterpType(C.GDK_INTERP_NEAREST) INTERP_TILES = C.GdkInterpType(C.GDK_INTERP_TILES) INTERP_BILINEAR = C.GdkInterpType(C.GDK_INTERP_BILINEAR) INTERP_HYPER = C.GdkInterpType(C.GDK_INTERP_HYPER) // PixbufAlphaMode PIXBUF_ALPHA_BILEVEL = C.GdkPixbufAlphaMode(C.GDK_PIXBUF_ALPHA_BILEVEL) PIXBUF_ALPHA_FULL = C.GdkPixbufAlphaMode(C.GDK_PIXBUF_ALPHA_FULL) // PixbufError PIXBUF_ERROR_CORRUPT_IMAGE = C.GdkPixbufError(C.GDK_PIXBUF_ERROR_CORRUPT_IMAGE) PIXBUF_ERROR_INSUFFICIENT_MEMORY = C.GdkPixbufError(C.GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY) PIXBUF_ERROR_BAD_OPTION = C.GdkPixbufError(C.GDK_PIXBUF_ERROR_BAD_OPTION) PIXBUF_ERROR_UNKNOWN_TYPE = C.GdkPixbufError(C.GDK_PIXBUF_ERROR_UNKNOWN_TYPE) PIXBUF_ERROR_UNSUPPORTED_OPERATION = C.GdkPixbufError(C.GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION) PIXBUF_ERROR_FAILED = C.GdkPixbufError(C.GDK_PIXBUF_ERROR_FAILED) // PixbufRotation PIXBUF_ROTATE_NONE = C.GdkPixbufRotation(C.GDK_PIXBUF_ROTATE_NONE) PIXBUF_ROTATE_COUNTERCLOCKWISE = C.GdkPixbufRotation(C.GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE) PIXBUF_ROTATE_UPSIDEDOWN = C.GdkPixbufRotation(C.GDK_PIXBUF_ROTATE_UPSIDEDOWN) PIXBUF_ROTATE_CLOCKWISE = C.GdkPixbufRotation(C.GDK_PIXBUF_ROTATE_CLOCKWISE) )