Documentation
¶
Index ¶
- func GetType() int
- type Animation
- type Colorspace
- type Format
- func (v *Format) GetDescription() string
- func (v *Format) GetExtensions() []string
- func (v *Format) GetLicense() string
- func (v *Format) GetMimeTypes() []string
- func (v *Format) GetName() string
- func (v *Format) IsDisabled() bool
- func (v *Format) IsScalable() bool
- func (v *Format) IsWritable() bool
- func (v *Format) SetDisabled(disabled bool)
- type GdkPixbuf
- type InterpType
- type Loader
- type Pixbuf
- func NewPixbuf(colorspace Colorspace, hasAlpha bool, bitsPerSample, width, height int) *Pixbuf
- func NewPixbufFromBytes(buffer []byte) (*Pixbuf, *glib.Error)
- func NewPixbufFromData(pbd PixbufData) *Pixbuf
- func NewPixbufFromFile(filename string) (*Pixbuf, *glib.Error)
- func NewPixbufFromFileAtScale(filename string, width, height int, preserve_aspect_ratio bool) (*Pixbuf, *glib.Error)
- func NewPixbufFromFileAtSize(filename string, width, heigth int) (*Pixbuf, *glib.Error)
- func NewPixbufFromStream(stream *gio.GInputStream) (*Pixbuf, *glib.Error)
- func NewPixbufFromXpmData(data **byte) (*Pixbuf, *glib.Error)
- func (p *Pixbuf) Fill(pixel uint32)
- func (p *Pixbuf) Flip(horizontal bool) *Pixbuf
- func (p *Pixbuf) GetBitsPerSample() int
- func (p *Pixbuf) GetColorspace() Colorspace
- func (p *Pixbuf) GetHasAlpha() bool
- func (p *Pixbuf) GetHeight() int
- func (p *Pixbuf) GetNChannels() int
- func (p *Pixbuf) GetPixels() []byte
- func (p *Pixbuf) GetPixelsWithLength() []byte
- func (p *Pixbuf) GetRowstride() int
- func (p *Pixbuf) GetWidth() int
- func (p *Pixbuf) RotateSimple(angle PixbufRotation) *Pixbuf
- func (p *Pixbuf) Save(filename, savetype string, options ...string) *glib.Error
- func (p *Pixbuf) Scale(x, y, width, height int, offsetX, offsetY, scaleX, scaleY float64, ...) *Pixbuf
- func (p *Pixbuf) ScaleSimple(width, height int, interp InterpType) *Pixbuf
- type PixbufAlphaMode
- type PixbufData
- type PixbufRotation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Animation ¶
type Animation struct {
GPixbufAnimation *C.GdkPixbufAnimation
}
----------------------------------------------------------------------- Animation -----------------------------------------------------------------------
type Format ¶
type Format struct {
GPixbufFormat *C.GdkPixbufFormat
}
----------------------------------------------------------------------- Format -----------------------------------------------------------------------
func GetFileInfo ¶
func (*Format) GetDescription ¶
func (*Format) GetExtensions ¶
func (*Format) GetLicense ¶
func (*Format) GetMimeTypes ¶
func (*Format) IsDisabled ¶
func (*Format) IsScalable ¶
func (*Format) IsWritable ¶
func (*Format) SetDisabled ¶
type GdkPixbuf ¶
func NewGdkPixbuf ¶
type InterpType ¶
type InterpType int
const ( INTERP_NEAREST InterpType = iota INTERP_TILES INTERP_BILINEAR INTERP_HYPER )
type Loader ¶
type Loader struct {
GPixbufLoader *C.GdkPixbufLoader
}
----------------------------------------------------------------------- Loader -----------------------------------------------------------------------
func NewLoaderWithMimeType ¶
func NewLoaderWithType ¶
type Pixbuf ¶
----------------------------------------------------------------------- Pixbuf -----------------------------------------------------------------------
func NewPixbuf ¶
func NewPixbuf(colorspace Colorspace, hasAlpha bool, bitsPerSample, width, height int) *Pixbuf
File Loading GdkPixbuf * gdk_pixbuf_new (GdkColorspace colorspace, gboolean has_alpha, int bits_per_sample, int width, int height);
func NewPixbufFromBytes ¶
NewPixbufFromBytes creates a Pixbuf from image data in a byte array
Can be used for reading Base64 encoded images easily with the output from base64.StdEncoding.DecodeString("...")
func NewPixbufFromData ¶
func NewPixbufFromData(pbd PixbufData) *Pixbuf
NewPixbufFromData creates a Pixbuf from image data in a byte array
func NewPixbufFromFileAtSize ¶
func NewPixbufFromStream ¶
func NewPixbufFromStream(stream *gio.GInputStream) (*Pixbuf, *glib.Error)
func (*Pixbuf) GetBitsPerSample ¶
func (*Pixbuf) GetColorspace ¶
func (p *Pixbuf) GetColorspace() Colorspace
func (*Pixbuf) GetHasAlpha ¶
func (*Pixbuf) GetNChannels ¶
func (*Pixbuf) GetPixelsWithLength ¶
guchar * gdk_pixbuf_get_pixels_with_length (const GdkPixbuf *pixbuf, guint *length);
Retuns a slice of byte backed by a C array of pixbuf data.
func (*Pixbuf) GetRowstride ¶
func (*Pixbuf) RotateSimple ¶
func (p *Pixbuf) RotateSimple(angle PixbufRotation) *Pixbuf
func (*Pixbuf) Scale ¶
func (p *Pixbuf) Scale(x, y, width, height int, offsetX, offsetY, scaleX, scaleY float64, interp InterpType) *Pixbuf
func (*Pixbuf) ScaleSimple ¶
func (p *Pixbuf) ScaleSimple(width, height int, interp InterpType) *Pixbuf
type PixbufAlphaMode ¶
type PixbufAlphaMode int
const ( GDK_PIXBUF_ALPHA_BILEVEL PixbufAlphaMode = iota GDK_PIXBUF_ALPHA_FULL )
type PixbufData ¶
type PixbufData struct { Data []byte Colorspace Colorspace HasAlpha bool BitsPerSample, Width, Height, RowStride int }
PixbufData is an inline/embedded image data object for usage with NewPixbufFromData.
type PixbufRotation ¶
type PixbufRotation int
const ( PIXBUF_ROTATE_NONE PixbufRotation = 0 PIXBUF_ROTATE_COUNTERCLOCKWISE PixbufRotation = 90 PIXBUF_ROTATE_UPSIDEDOWN PixbufRotation = 180 PIXBUF_ROTATE_CLOCKWISE PixbufRotation = 270 )