Documentation ¶
Index ¶
- Variables
- func Scale(dst draw.Image, src image.Image) error
- type Affine
- func (a Affine) Center(x, y float64) Affine
- func (a Affine) CenterFit(dst, src image.Rectangle) Affine
- func (a Affine) Mul(b Affine) Affine
- func (a Affine) Rotate(angle float64) Affine
- func (a Affine) Scale(x, y float64) Affine
- func (a Affine) Shear(x, y float64) Affine
- func (a Affine) Transform(dst draw.Image, src image.Image, i interp.Interp) error
- func (a Affine) TransformCenter(dst draw.Image, src image.Image, i interp.Interp) error
- func (a Affine) Translate(x, y float64) Affine
Constants ¶
This section is empty.
Variables ¶
View Source
var I = Affine{
1, 0, 0,
0, 1, 0,
0, 0, 1,
}
I is the identity Affine transform matrix.
Functions ¶
Types ¶
type Affine ¶
type Affine [9]float64
Affine is a 3x3 2D affine transform matrix. M(i,j) is Affine[i*3+j].
func (Affine) CenterFit ¶
CenterFit produces the affine transform, centered around the rectangles. It is equivalent to
I.Translate(-<center of src>).Mul(a).Translate(<center of dst>)
func (Affine) TransformCenter ¶
TransformCenter applies the affine transform to src and produces dst. Equivalent to
a.CenterFit(dst, src).Transform(dst, src, i).
Click to show internal directories.
Click to hide internal directories.