command

package
v0.0.0-...-b6c76eb Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	Clip     rect.Rect
	Commands []Command
}

CommandBuffer is a list of drawing directives.

func (*Buffer) Cursor

func (b *Buffer) Cursor(r rect.Rect, cursor font.Cursor)

func (*Buffer) DrawImage

func (b *Buffer) DrawImage(r rect.Rect, img *image.RGBA)

func (*Buffer) DrawText

func (b *Buffer) DrawText(r rect.Rect, str string, face font.Face, fg color.RGBA)

func (*Buffer) FillCircle

func (b *Buffer) FillCircle(r rect.Rect, c color.RGBA)

func (*Buffer) FillRect

func (b *Buffer) FillRect(rect rect.Rect, rounding uint16, c color.RGBA)

func (*Buffer) FillTriangle

func (b *Buffer) FillTriangle(p0, p1, p2 image.Point, c color.RGBA)

func (*Buffer) PushScissor

func (b *Buffer) PushScissor(r rect.Rect)

func (*Buffer) Reset

func (buffer *Buffer) Reset()

func (*Buffer) StrokeLine

func (b *Buffer) StrokeLine(p0, p1 image.Point, line_thickness int, c color.RGBA)

type CircleFilled

type CircleFilled struct {
	Color color.RGBA
}

type Command

type Command struct {
	rect.Rect
	Kind           CommandKind
	Line           Line
	RectFilled     RectFilled
	TriangleFilled TriangleFilled
	CircleFilled   CircleFilled
	Image          Image
	Text           Text
	Cursor         font.Cursor
}

Represents one drawing directive.

type CommandKind

type CommandKind uint8
const (
	ScissorCmd CommandKind = iota
	LineCmd
	RectFilledCmd
	TriangleFilledCmd
	CircleFilledCmd
	ImageCmd
	TextCmd
	CursorCmd
)

type Image

type Image struct {
	Img *image.RGBA
}

type Line

type Line struct {
	LineThickness uint16
	Begin         image.Point
	End           image.Point
	Color         color.RGBA
}

type RectFilled

type RectFilled struct {
	Rounding uint16
	Color    color.RGBA
}

type Text

type Text struct {
	Face       font.Face
	Foreground color.RGBA
	String     string
}

type TriangleFilled

type TriangleFilled struct {
	A     image.Point
	B     image.Point
	C     image.Point
	Color color.RGBA
}

Jump to

Keyboard shortcuts

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