Documentation
¶
Index ¶
- Variables
- type BGRA
- type Bitmap
- func (img Bitmap) At(x, y int) color.Color
- func (img Bitmap) Bounds() image.Rectangle
- func (img Bitmap) ColorModel() color.Model
- func (img Bitmap) GetPixel(x, y int) (r, g, b, a byte)
- func (img Bitmap) PixOffset(x, y int) int
- func (img Bitmap) Set(x, y int, c color.Color)
- func (img Bitmap) SetPixel(x, y int, r, g, b, a byte)
- func (img Bitmap) SubImage(r image.Rectangle) image.Image
- type Brush
- type Color
- type Painter
- type Path
- func (p Path) ArcTo(rx, ry, xRotate, large, sweep, x, y float32) Path
- func (p Path) BezierTo(c1x, c1y, c2x, c2y, x, y float32) Path
- func (p Path) Close() Path
- func (p Path) CurrentPos() (x, y float32)
- func (p Path) LineTo(x, y float32) Path
- func (p Path) QuadBezierTo(cx, cy, x, y float32) Path
- func (p Path) Range(f func(op PathOperation, args []float32) (stop bool))
- type PathOperation
- type PixelFormat
- type Point
- type Pos
- type Rectangle
- type Size
Constants ¶
This section is empty.
Variables ¶
View Source
var BGRAModel = color.ModelFunc(bgraModel)
Functions ¶
This section is empty.
Types ¶
type Bitmap ¶
func CopyToBitmap ¶
func CopyToBitmap(src image.Image, dstFormat PixelFormat, buf []byte) (dst Bitmap)
func MakeBitmap ¶
func MakeBitmap(x, y, width, height int, format PixelFormat, buf []byte) Bitmap
func (Bitmap) ColorModel ¶
type Painter ¶
type Painter interface {
Name() string
Destroy()
Begin(width, height, scale float32)
End()
SetClipRect(rect Rectangle)
SetTransform(transform geometry.Transform)
Clear(color Color)
FillRect(rect Rectangle, brush Brush)
FillRoundRect(rect Rectangle, radius float32, brush Brush)
FillEllipse(center Point, xRadius, yRadius float32, brush Brush)
FillPath(path Path, brush Brush)
DrawLine(p0, p1 Point, strokeWidth float32, brush Brush)
DrawRect(rect Rectangle, strokeWidth float32, brush Brush)
DrawRoundRect(rect Rectangle, radius, strokeWidth float32, brush Brush)
DrawEllipse(center Point, xRadius, yRadius, strokeWidth float32, brush Brush)
DrawPath(path Path, strokeWidth float32, brush Brush)
DrawTextLayout(origin Point, layout typography.TextLayout)
DrawImage(rect Rectangle, img image.Image)
}
Painter is thread-affine and not safe for concurrent use.
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
func (Path) CurrentPos ¶
func (Path) QuadBezierTo ¶
type PathOperation ¶
type PathOperation float32
const ( PathMoveTo PathOperation = iota // (x, y) PathLineTo // (x, y) PathArcTo // (rx, ry, xRotate, large, sweep, x, y) PathBezierTo // (c1x, c1y, c2x, c2y, x, y) PathClose // (0, 0) )
func (PathOperation) String ¶
func (op PathOperation) String() string
type PixelFormat ¶
type PixelFormat int
const ( PixelFormatUnknown PixelFormat = iota PixelFormatRGBA PixelFormatBGRA PixelFormatGray )
func (PixelFormat) BitsPerPixel ¶
func (f PixelFormat) BitsPerPixel() (bits int)
func (PixelFormat) BytesPerPixel ¶
func (f PixelFormat) BytesPerPixel() (bytes int)
Click to show internal directories.
Click to hide internal directories.