-
Notifications
You must be signed in to change notification settings - Fork 35
/
composite_gm.go
83 lines (79 loc) · 1.89 KB
/
composite_gm.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
77
78
79
80
81
82
83
// +build gm
package magick
// #include <magick/api.h>
import "C"
import (
"fmt"
)
func (im *Image) compositeOperator(c Composite) (int, error) {
var cc C.CompositeOperator
switch c {
case CompositeAtop:
cc = C.AtopCompositeOp
case CompositeBumpmap:
cc = C.BumpmapCompositeOp
case CompositeClear:
cc = C.ClearCompositeOp
case CompositeColorize:
cc = C.ColorizeCompositeOp
case CompositeCopyBlack:
cc = C.CopyBlackCompositeOp
case CompositeCopyBlue:
cc = C.CopyBlueCompositeOp
case CompositeCopy:
cc = C.CopyCompositeOp
case CompositeCopyCyan:
cc = C.CopyCyanCompositeOp
case CompositeCopyGreen:
cc = C.CopyGreenCompositeOp
case CompositeCopyMagenta:
cc = C.CopyMagentaCompositeOp
case CompositeCopyRed:
cc = C.CopyRedCompositeOp
case CompositeCopyYellow:
cc = C.CopyYellowCompositeOp
case CompositeDarken:
cc = C.DarkenCompositeOp
case CompositeDifference:
cc = C.DifferenceCompositeOp
case CompositeDisplace:
cc = C.DisplaceCompositeOp
case CompositeDissolve:
cc = C.DissolveCompositeOp
case CompositeHue:
cc = C.HueCompositeOp
case CompositeIn:
cc = C.InCompositeOp
case CompositeLuminize:
cc = C.LuminizeCompositeOp
case CompositeModulate:
cc = C.ModulateCompositeOp
case CompositeMultiply:
cc = C.MultiplyCompositeOp
case CompositeNo:
cc = C.NoCompositeOp
case CompositeOut:
cc = C.OutCompositeOp
case CompositeOver:
cc = C.OverCompositeOp
case CompositeOverlay:
cc = C.OverlayCompositeOp
case CompositePlus:
cc = C.PlusCompositeOp
case CompositeSaturate:
cc = C.SaturateCompositeOp
case CompositeScreen:
cc = C.ScreenCompositeOp
case CompositeThreshold:
cc = C.ThresholdCompositeOp
case CompositeUndefined:
cc = C.UndefinedCompositeOp
case CompositeXor:
cc = C.XorCompositeOp
case CompositeAlpha:
cc = C.CopyOpacityCompositeOp
default:
return 0, notImplementedError(fmt.Sprintf("composite %s", c))
}
return int(cc), nil
}