Documentation ¶
Overview ¶
This package contains functions for Pi/2 step rotation of points in a 2-dimensional space.
Index ¶
- Constants
- Variables
- func DrawRgbaImage(pixFormat Format, rotationFn Rotate, scaleType int, flipV bool, ...)
- func ExampleRotate(data []uint8, w int, h int, angle Angle) []uint8
- func Resize(scaleType int, src *image.RGBA, out *image.RGBA)
- func Rgb565(data []byte, index int) color.RGBA
- func Rgba8888(data []byte, index int) color.RGBA
- func Rotate0(x, y, _, _ int) (int, int)
- func Rotate180(x, y, w, h int) (int, int)
- func Rotate270(x, y, _, h int) (int, int)
- func Rotate90(x, y, w, _ int) (int, int)
- type Angle
- type Format
- type Rotate
Constants ¶
View Source
const ( // BIT_FORMAT_SHORT_5_5_5_1 has 5 bits R, 5 bits G, 5 bits B, 1 bit alpha BitFormatShort5551 = iota // BIT_FORMAT_INT_8_8_8_8_REV has 8 bits R, 8 bits G, 8 bits B, 8 bit alpha BitFormatInt8888Rev // BIT_FORMAT_SHORT_5_6_5 has 5 bits R, 6 bits G, 5 bits BitFormatShort565 )
View Source
const ( // skips image interpolation ScaleNot = iota // nearest neighbour interpolation ScaleNearestNeighbour // bilinear interpolation ScaleBilinear )
Variables ¶
View Source
var Angles = [4]Rotate{ Angle0: {Call: Rotate0, IsEven: false}, Angle90: {Call: Rotate90, IsEven: true}, Angle180: {Call: Rotate180, IsEven: false}, Angle270: {Call: Rotate270, IsEven: true}, }
A helper to choose appropriate rotation by its angle
Functions ¶
func DrawRgbaImage ¶
func ExampleRotate ¶
[1 2 3 4 5 6 7 8 9] [7 4 1 8 5 2 9 6 3]
Types ¶
type Rotate ¶
An interface for rotation of a given point with the coordinates x, y in the matrix of w x h. Returns a pair of new coordinates x, y in the resulting matrix. Be aware that w / h values are 0 index-based and it's meant to be used with h corresponded to matrix height and y coordinate, and with w to x coordinate.
func GetRotation ¶
Click to show internal directories.
Click to hide internal directories.