memdraw

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Frepl   = 1 << 0 /* is replicated */
	Fsimple = 1 << 1 /* is 1x1 */
	Fgrey   = 1 << 2 /* is grey */
	Falpha  = 1 << 3 /* has explicit alpha */
	Fcmap   = 1 << 4 /* has cmap channel */
	Fbytes  = 1 << 5 /* has only 8-bit channels */
)

Variables

This section is empty.

Functions

func Arc

func Arc(dst *Image, c draw.Point, a int, b int, t int, src *Image, sp draw.Point, alpha int, phi int, op draw.Op)

* make a "wedge" mask covering the desired angle and contained in * a surrounding square; draw a full ellipse; intersect that with the * wedge to make a mask through which to copy src to dst.

func Draw

func Draw(dst *Image, r draw.Rectangle, src *Image, p0 draw.Point, mask *Image, p1 draw.Point, op draw.Op)

func Ellipse

func Ellipse(dst *Image, c draw.Point, a int, b int, t int, src *Image, sp draw.Point, op draw.Op)

func FillColor

func FillColor(m *Image, val draw.Color)

func FillPoly

func FillPoly(dst *Image, vert []draw.Point, w int, src *Image, sp draw.Point, op draw.Op)

func Free

func Free(i *Image)

func Init

func Init()

func LDelete

func LDelete(i *Image)

func LFree

func LFree(i *Image)

* Just free the data structures, don't do graphics

func LNoRefresh

func LNoRefresh(l *Image, r draw.Rectangle, v interface{})

func LOrigin

func LOrigin(i *Image, log draw.Point, scr draw.Point) (int, error)

* Place i so i->r.min = log, i->layer->screenr.min == scr.

func LSetRefresh

func LSetRefresh(i *Image, fn Refreshfn, ptr interface{}) bool

func LToFrontN

func LToFrontN(ip []*Image, n int)

func LToRearN

func LToRearN(ip []*Image, n int)

func Line

func Line(dst *Image, p0 draw.Point, p1 draw.Point, end0, end1 draw.End, radius int, src *Image, sp draw.Point, op draw.Op)

func LineBBox

func LineBBox(p0 draw.Point, p1 draw.Point, end0, end1 draw.End, radius int) draw.Rectangle

func LineEndSize

func LineEndSize(end draw.End) int

func Load

func Load(dst *Image, r draw.Rectangle, data []uint8, iscompressed bool) (int, error)

func Poly

func Poly(dst *Image, vert []draw.Point, end0, end1 draw.End, radius int, src *Image, sp draw.Point, op draw.Op)

func Unload

func Unload(src *Image, r draw.Rectangle, data []uint8) (int, error)

Types

type Image

type Image struct {
	R     draw.Rectangle /* rectangle in data area, local coords */
	Clipr draw.Rectangle /* clipping region */
	Depth int            /* number of bits of storage per pixel */

	Pix draw.Pix /* channel descriptions */

	Data *_Memdata /* pointer to data; shared by windows in this image */

	Width     uint32 /* width in words of a single scan line */
	Layer     *Layer /* nil if not a layer*/
	Flags     uint32
	X         interface{}
	ScreenRef int /* reference count if this is a screen */
	// contains filtered or unexported fields
}
var Black *Image
var Opaque *Image

func AllocImage

func AllocImage(r draw.Rectangle, chan_ draw.Pix) (*Image, error)

func LAlloc

func LAlloc(s *Screen, screenr draw.Rectangle, refreshfn Refreshfn, refreshptr interface{}, val draw.Color) (*Image, error)

func (*Image) BytesAt

func (i *Image) BytesAt(p draw.Point) []uint8

func (*Image) Draw

func (i *Image) Draw(r draw.Rectangle, src *Image, sp draw.Point, mask *Image, mp draw.Point, op draw.Op)

type Layer

type Layer struct {
	Screenr draw.Rectangle /* true position of layer on screen */
	Delta   draw.Point     /* add delta to go from image coords to screen */
	Screen  *Screen        /* screen this layer belongs to */

	Refreshfn  Refreshfn   /* function to call to refresh obscured parts if save==nil */
	Refreshptr interface{} /* argument to refreshfn */
	// contains filtered or unexported fields
}

type Refreshfn

type Refreshfn func(*Image, draw.Rectangle, interface{})

type Screen

type Screen struct {
	Frontmost *Image /* frontmost layer on screen */
	Rearmost  *Image /* rearmost layer on screen */
	Image     *Image /* upon which all layers are drawn */
	Fill      *Image /* if non-zero, picture to use when repainting */
}

Jump to

Keyboard shortcuts

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