xcanvas

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas struct {
	*xgraphics.Image
}

Canvas satisfies the canvas.Canvas interface. It draws to an xgraphics.Image. It must be closed after use.

func NewCanvas added in v0.3.0

func NewCanvas(x *xgbutil.XUtil, bounds image.Rectangle) *Canvas

NewCanvas creates a new canvas from a bounding rectangle.

func NewCanvasFrom added in v0.3.0

func NewCanvasFrom(image *xgraphics.Image) *Canvas

NewCanvasFrom creates a new canvas from an existing xgraphics.Image. Note that calling Close() on the resulting canvas will destroy this image.

func (*Canvas) Clip

func (this *Canvas) Clip(bounds image.Rectangle) canvas.Canvas

Clip returns a sub-canvas of this canvas.

func (*Canvas) Close added in v0.3.0

func (this *Canvas) Close()

Close frees this canvas from the X server.

func (*Canvas) Pen

func (this *Canvas) Pen() canvas.Pen

Pen returns a new drawing context.

func (*Canvas) Push

func (this *Canvas) Push(window xproto.Window)

Push pushes this canvas to the screen.

type Texture added in v0.3.0

type Texture struct {
	// contains filtered or unexported fields
}

Texture is a read-only image texture that can be quickly written to a canvas. It must be closed manually after use.

func AssertTexture added in v0.3.0

func AssertTexture(unknown canvas.Texture) *Texture

AssertTexture checks if a given canvas.Texture is a texture from this package.

func NewTextureFrom added in v0.3.0

func NewTextureFrom(source image.Image) *Texture

NewTextureFrom creates a new texture from a source image.

func (*Texture) At added in v0.5.0

func (this *Texture) At(x, y int) color.Color

func (*Texture) BGRAAt added in v0.5.0

func (this *Texture) BGRAAt(x, y int) xgraphics.BGRA

func (*Texture) Bounds added in v0.4.0

func (this *Texture) Bounds() image.Rectangle

Bounds returns the bounding rectangle of this texture.

func (*Texture) Clip added in v0.3.0

func (this *Texture) Clip(bounds image.Rectangle) canvas.Texture

Clip returns a subset of this texture that points to the same data.

func (*Texture) Close added in v0.3.0

func (this *Texture) Close() error

Close frees the texture from memory.

func (*Texture) ColorModel added in v0.5.0

func (this *Texture) ColorModel() color.Model

func (*Texture) Opaque added in v0.3.0

func (this *Texture) Opaque() bool

Opaque reports whether or not the texture is fully opaque.

func (*Texture) PixOffset added in v0.3.1

func (this *Texture) PixOffset(x, y int) int

Jump to

Keyboard shortcuts

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