gdkpixbuf

package
v0.0.0-...-48574e3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2024 License: BSD-3-Clause Imports: 6 Imported by: 87

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetType

func GetType() int

Types

type Animation

type Animation struct {
	GPixbufAnimation *C.GdkPixbufAnimation
}

----------------------------------------------------------------------- Animation -----------------------------------------------------------------------

type Colorspace

type Colorspace int
const (
	GDK_COLORSPACE_RGB Colorspace = iota
)

type Format

type Format struct {
	GPixbufFormat *C.GdkPixbufFormat
}

----------------------------------------------------------------------- Format -----------------------------------------------------------------------

func GetFileInfo

func GetFileInfo(filename string, width, height *int) *Format

func (*Format) GetDescription

func (v *Format) GetDescription() string

func (*Format) GetExtensions

func (v *Format) GetExtensions() []string

func (*Format) GetLicense

func (v *Format) GetLicense() string

func (*Format) GetMimeTypes

func (v *Format) GetMimeTypes() []string

func (*Format) GetName

func (v *Format) GetName() string

func (*Format) IsDisabled

func (v *Format) IsDisabled() bool

func (*Format) IsScalable

func (v *Format) IsScalable() bool

func (*Format) IsWritable

func (v *Format) IsWritable() bool

func (*Format) SetDisabled

func (v *Format) SetDisabled(disabled bool)

type GdkPixbuf

type GdkPixbuf struct {
	GPixbuf *C.GdkPixbuf
}

func NewGdkPixbuf

func NewGdkPixbuf(p unsafe.Pointer) *GdkPixbuf

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 NewLoader

func NewLoader() *Loader

func NewLoaderWithMimeType

func NewLoaderWithMimeType(mime_type string) (loader *Loader, err *glib.Error)

func NewLoaderWithType

func NewLoaderWithType(image_type string) (loader *Loader, err *glib.Error)

func (Loader) Close

func (v Loader) Close() (bool, *glib.Error)

func (Loader) GetFormat

func (v Loader) GetFormat() *Format

func (Loader) GetPixbuf

func (v Loader) GetPixbuf() *Pixbuf

func (Loader) SetSize

func (v Loader) SetSize(width int, height int)
func (v Loader) GetPixbufAnimation() *Animation {
	return &Animation {
		C.gdk_pixbuf_loader_get_animation(v.GPixbufLoader) };
}

func (Loader) Write

func (v Loader) Write(buf []byte) (bool, *glib.Error)

type Pixbuf

type Pixbuf struct {
	*GdkPixbuf
	*glib.GObject
}

----------------------------------------------------------------------- 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

func NewPixbufFromBytes(buffer []byte) (*Pixbuf, *glib.Error)

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 NewPixbufFromFile

func NewPixbufFromFile(filename string) (*Pixbuf, *glib.Error)

func NewPixbufFromFileAtScale

func NewPixbufFromFileAtScale(filename string, width, height int, preserve_aspect_ratio bool) (*Pixbuf, *glib.Error)

func NewPixbufFromFileAtSize

func NewPixbufFromFileAtSize(filename string, width, heigth int) (*Pixbuf, *glib.Error)

func NewPixbufFromStream

func NewPixbufFromStream(stream *gio.GInputStream) (*Pixbuf, *glib.Error)

func NewPixbufFromXpmData

func NewPixbufFromXpmData(data **byte) (*Pixbuf, *glib.Error)

func (*Pixbuf) Fill

func (p *Pixbuf) Fill(pixel uint32)

func (*Pixbuf) Flip

func (p *Pixbuf) Flip(horizontal bool) *Pixbuf

func (*Pixbuf) GetBitsPerSample

func (p *Pixbuf) GetBitsPerSample() int

func (*Pixbuf) GetColorspace

func (p *Pixbuf) GetColorspace() Colorspace

func (*Pixbuf) GetHasAlpha

func (p *Pixbuf) GetHasAlpha() bool

func (*Pixbuf) GetHeight

func (p *Pixbuf) GetHeight() int

func (*Pixbuf) GetNChannels

func (p *Pixbuf) GetNChannels() int

func (*Pixbuf) GetPixels

func (p *Pixbuf) GetPixels() []byte

func (*Pixbuf) GetPixelsWithLength

func (p *Pixbuf) GetPixelsWithLength() []byte

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 (p *Pixbuf) GetRowstride() int

func (*Pixbuf) GetWidth

func (p *Pixbuf) GetWidth() int

func (*Pixbuf) RotateSimple

func (p *Pixbuf) RotateSimple(angle PixbufRotation) *Pixbuf

func (*Pixbuf) Save

func (p *Pixbuf) Save(filename, savetype string, options ...string) *glib.Error

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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL