-
Notifications
You must be signed in to change notification settings - Fork 21
/
affine_matrix.go
76 lines (61 loc) · 1.54 KB
/
affine_matrix.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package gmagick
/*
#include <wand/wand_api.h>
*/
import "C"
// AffineMatrix represents an ImageMagick AffineMatrix struct
type AffineMatrix struct {
am C.AffineMatrix
}
// ptr returns the underlying C AffineMatrix pointer
func (a *AffineMatrix) ptr() *C.AffineMatrix {
return &(a.am)
}
// TranslateX returns the TX value
func (a *AffineMatrix) TranslateX() float64 {
return float64(a.am.tx)
}
// SetTranslateX sets the TX value
func (a *AffineMatrix) SetTranslateX(val float64) {
a.am.tx = C.double(val)
}
// TranslateY returns the TY value
func (a *AffineMatrix) TranslateY() float64 {
return float64(a.am.ty)
}
// SetTranslateY sets the TY value
func (a *AffineMatrix) SetTranslateY(val float64) {
a.am.ty = C.double(val)
}
// RotateX returns the RX value
func (a *AffineMatrix) RotateX() float64 {
return float64(a.am.rx)
}
// SetRotateX sets the RX value
func (a *AffineMatrix) SetRotateX(val float64) {
a.am.rx = C.double(val)
}
// RotateY returns the RY value
func (a *AffineMatrix) RotateY() float64 {
return float64(a.am.ry)
}
// SetRotateY sets the RY value
func (a *AffineMatrix) SetRotateY(val float64) {
a.am.ry = C.double(val)
}
// ScaleX returns the SX value
func (a *AffineMatrix) ScaleX() float64 {
return float64(a.am.sx)
}
// SetScaleX sets the SX value
func (a *AffineMatrix) SetScaleX(val float64) {
a.am.sx = C.double(val)
}
// ScaleY returns the SY value
func (a *AffineMatrix) ScaleY() float64 {
return float64(a.am.sy)
}
// SetScaleY sets the SY value
func (a *AffineMatrix) SetScaleY(val float64) {
a.am.sy = C.double(val)
}