Documentation ¶
Index ¶
- Variables
- type Backend
- type FillStyle
- type Gradient
- type GradientStop
- type Image
- type ImagePattern
- type ImagePatternData
- type ImagePatternRepeat
- type LinearGradient
- type Mat
- type Mat2
- type RadialGradient
- type Vec
- func (v Vec) Add(v2 Vec) Vec
- func (v Vec) Angle() float64
- func (v Vec) AngleTo(v2 Vec) float64
- func (v Vec) Atan2() float64
- func (v Vec) Div(v2 Vec) Vec
- func (v Vec) Divf(f float64) Vec
- func (v Vec) Dot(v2 Vec) float64
- func (v Vec) Len() float64
- func (v Vec) LenSqr() float64
- func (v Vec) Mul(v2 Vec) Vec
- func (v Vec) MulMat(m Mat) Vec
- func (v Vec) MulMat2(m Mat2) Vec
- func (v Vec) Mulf(f float64) Vec
- func (v Vec) Norm() Vec
- func (v Vec) String() string
- func (v Vec) Sub(v2 Vec) Vec
Constants ¶
This section is empty.
Variables ¶
View Source
var MatIdentity = Mat{
1, 0,
0, 1,
0, 0}
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { Size() (int, int) LoadImage(img image.Image) (Image, error) LoadImagePattern(data ImagePatternData) ImagePattern LoadLinearGradient(data Gradient) LinearGradient LoadRadialGradient(data Gradient) RadialGradient Clear(pts [4]Vec) Fill(style *FillStyle, pts []Vec, tf Mat, canOverlap bool) DrawImage(dimg Image, sx, sy, sw, sh float64, pts [4]Vec, alpha float64) FillImageMask(style *FillStyle, mask *image.Alpha, pts [4]Vec) // pts must have four points ClearClip() Clip(pts []Vec) GetImageData(x, y, w, h int) *image.RGBA PutImageData(img *image.RGBA, x, y int) CanUseAsImage(b Backend) bool AsImage() Image // can return nil if not supported }
Backend is used by the canvas to actually do the final drawing. This enables the backend to be implemented by various methods (OpenGL, but also other APIs or software)
type FillStyle ¶
type FillStyle struct { Color color.RGBA Blur float64 LinearGradient LinearGradient RadialGradient RadialGradient Gradient struct { X0, Y0 float64 X1, Y1 float64 RadFrom float64 RadTo float64 } ImagePattern ImagePattern }
FillStyle is the color and other details on how to fill
type Gradient ¶
type Gradient []GradientStop
type GradientStop ¶
type ImagePattern ¶
type ImagePattern interface { Delete() Replace(data ImagePatternData) }
type ImagePatternData ¶
type ImagePatternData struct { Image Image Transform [9]float64 Repeat ImagePatternRepeat }
type ImagePatternRepeat ¶
type ImagePatternRepeat uint8
const ( Repeat ImagePatternRepeat = iota RepeatX RepeatY NoRepeat )
Image pattern repeat constants
type LinearGradient ¶
type LinearGradient interface { Delete() Replace(data Gradient) }
type RadialGradient ¶
type RadialGradient interface { Delete() Replace(data Gradient) }
Click to show internal directories.
Click to hide internal directories.