forked from rainycape/magick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeom.go
40 lines (35 loc) · 756 Bytes
/
geom.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
package magick
// #include <magick/api.h>
import "C"
type Rect struct {
X int
Y int
Width uint
Height uint
}
func (r *Rect) rectangleInfo() *C.RectangleInfo {
var info C.RectangleInfo
info.x = magickLong(r.X)
info.y = magickLong(r.Y)
info.width = magickSize(r.Width)
info.height = magickSize(r.Height)
return &info
}
type Frame struct {
X int
Y int
Width uint
Height uint
InnerBevel int
OuterBevel int
}
func (f *Frame) frameInfo() *C.FrameInfo {
var info C.FrameInfo
info.x = magickLong(f.X)
info.y = magickLong(f.Y)
info.width = magickSize(f.Width)
info.height = magickSize(f.Height)
info.inner_bevel = magickLong(f.InnerBevel)
info.outer_bevel = magickLong(f.OuterBevel)
return &info
}