Documentation ¶
Index ¶
- Variables
- func WH(w, h int) image.Rectangle
- func XYWH(x, y, w, h int) image.Rectangle
- func XYXY(x, y, x1, y1 int) image.Rectangle
- type Buffer
- func (b *Buffer) Add(c ...Command)
- func (b *Buffer) Fill(r image.Rectangle, c Color)
- func (b *Buffer) Icon(r image.Rectangle, id string, c Color)
- func (b *Buffer) Image(r image.Rectangle, i *image.RGBA, c Color, update bool)
- func (b *Buffer) Outline(r image.Rectangle, c Color)
- func (b *Buffer) Pop()
- func (b *Buffer) Push(r image.Rectangle)
- func (b *Buffer) Reset(w, h int)
- func (b *Buffer) Shadow(r image.Rectangle, c Color, size int)
- func (b *Buffer) Size() (int, int)
- func (b *Buffer) SubImage(r image.Rectangle, i *image.RGBA, sub image.Rectangle, c Color, update bool)
- func (b *Buffer) Text(p image.Point, text string, c Color, font Font)
- type Color
- type Command
- type CommandList
- type Fill
- type Font
- type FontLookup
- type FontMetrics
- type Icon
- type Image
- type Outline
- type Shadow
- type Text
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Black = Color{0, 0, 0, 255} White = Color{255, 255, 255, 255} Transparent = Color{0, 0, 0, 0} )
Functions ¶
Types ¶
type Buffer ¶
type Buffer struct { Commands []Command FontLookup FontLookup All []CommandList // contains filtered or unexported fields }
A Buffer contains a list of commands.
func (*Buffer) Image ¶
Image adds a command to draw an image. update should be true if the image has changed since it was last drawn.
func (*Buffer) Push ¶
Push constrains drawing to a rectangle. Subsequent operations will be translated and clipped. Subsequent calls to Size will return the rectangle's size.
type Color ¶
type Color [4]byte
Color is a 32 bit RGBA color with premultiplied alpha.
func Gray ¶
Gray creates an opaque gray color from an intensity in range [0,1], where 0 means black and 1 means white.
type CommandList ¶
type FontLookup ¶
type FontLookup interface { // GetClosest takes a font face description and returns the best match that is actually supported. // If a font has multiple names, it should return a consistent, canonical name. GetClosest(Font) Font // Metrics returns the FontMetrics for the specified font. // Implementations must not assume that the argument has been passed through GetClosest. Metrics(Font) FontMetrics }
A FontLookup provides information about fonts.
Click to show internal directories.
Click to hide internal directories.