// Code generated by cmd/cgo; DO NOT EDIT. //line /home/josie/.cache/paru/clone/wiiudownloader/src/pkg/mod/github.com/gotk3/gotk3@v0.6.5-0.20240618185848-ff349ae13f56/gdk/pixbuf_since_2_32.go:1:1 // Same copyright and license as the rest of the files in this project // +build !gdk_pixbuf_2_2,!gdk_pixbuf_2_4,!gdk_pixbuf_2_6,!gdk_pixbuf_2_8,!gdk_pixbuf_2_12,!gdk_pixbuf_2_14,!gdk_pixbuf_2_22,!gdk_pixbuf_2_24,!gdk_pixbuf_2_26,!gdk_pixbuf_2_28,!gdk_pixbuf_2_30 package gdk // #cgo pkg-config: gdk-3.0 glib-2.0 gobject-2.0 // #include // #include "gdk.go.h" // #include "pixbuf.go.h" import _ "unsafe" import ( "runtime" "unsafe" "github.com/gotk3/gotk3/glib" ) // Image Data in Memory // PixbufNewFromBytes is a wrapper around gdk_pixbuf_new_from_bytes(). // see go package "encoding/base64" func PixbufNewFromBytes(pixbufData []byte, cs Colorspace, hasAlpha bool, bitsPerSample, width, height, rowStride int) (*Pixbuf, error) { arrayPtr := (* /*line :24:16*/_Ctype_GBytes /*line :24:24*/)(unsafe.Pointer(&pixbufData[0])) c := func() *_Ctype_struct__GdkPixbuf{ _cgo0 := /*line :27:3*/arrayPtr; var _cgo1 _Ctype_GdkColorspace = _Ctype_GdkColorspace /*line :28:18*/(cs); var _cgo2 _Ctype_gboolean = /*line :29:3*/gbool(hasAlpha); var _cgo3 _Ctype_int = _Ctype_int /*line :30:8*/(bitsPerSample); var _cgo4 _Ctype_int = _Ctype_int /*line :31:8*/(width); var _cgo5 _Ctype_int = _Ctype_int /*line :32:8*/(height); var _cgo6 _Ctype_int = _Ctype_int /*line :33:8*/(rowStride); _cgoCheckPointer(_cgo0, nil); return /*line :34:3*/_Cfunc_gdk_pixbuf_new_from_bytes(_cgo0, _cgo1, _cgo2, _cgo3, _cgo4, _cgo5, _cgo6); }() if c == nil { return nil, nilPtrErr } obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} p := &Pixbuf{obj} //obj.Ref() runtime.SetFinalizer(p, func(_ interface{}) { glib.FinalizerStrategy(obj.Unref) }) return p, nil } // PixbufNewFromBytesOnly is a convenient alternative to PixbufNewFromBytes() and also a wrapper around gdk_pixbuf_new_from_bytes(). // see go package "encoding/base64" func PixbufNewFromBytesOnly(pixbufData []byte) (*Pixbuf, error) { pixbufLoader, err := PixbufLoaderNew() if err != nil { return nil, err } return pixbufLoader.WriteAndReturnPixbuf(pixbufData) } // File loading // TODO: // gdk_pixbuf_get_file_info_async(). // gdk_pixbuf_get_file_info_finish(). // The GdkPixbuf Structure // TODO: // gdk_pixbuf_get_options(). // gdk_pixbuf_read_pixels().