-
Notifications
You must be signed in to change notification settings - Fork 35
/
composite_im.go
153 lines (149 loc) · 3.77 KB
/
composite_im.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
// +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 CompositeBlend:
cc = C.BlendCompositeOp
case CompositeBlur:
cc = C.BlurCompositeOp
case CompositeBumpmap:
cc = C.BumpmapCompositeOp
case CompositeChangeMask:
cc = C.ChangeMaskCompositeOp
case CompositeClear:
cc = C.ClearCompositeOp
case CompositeColorBurn:
cc = C.ColorBurnCompositeOp
case CompositeColorDodge:
cc = C.ColorDodgeCompositeOp
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 CompositeDarkenIntensity:
cc = C.DarkenIntensityCompositeOp
case CompositeDifference:
cc = C.DifferenceCompositeOp
case CompositeDisplace:
cc = C.DisplaceCompositeOp
case CompositeDissolve:
cc = C.DissolveCompositeOp
case CompositeDistort:
cc = C.DistortCompositeOp
case CompositeDivideDst:
cc = C.DivideDstCompositeOp
case CompositeDivideSrc:
cc = C.DivideSrcCompositeOp
case CompositeDstAtop:
cc = C.DstAtopCompositeOp
case CompositeDst:
cc = C.DstCompositeOp
case CompositeDstIn:
cc = C.DstInCompositeOp
case CompositeDstOut:
cc = C.DstOutCompositeOp
case CompositeDstOver:
cc = C.DstOverCompositeOp
case CompositeExclusion:
cc = C.ExclusionCompositeOp
case CompositeHardLight:
cc = C.HardLightCompositeOp
case CompositeHue:
cc = C.HueCompositeOp
case CompositeIn:
cc = C.InCompositeOp
case CompositeLighten:
cc = C.LightenCompositeOp
case CompositeLightenIntensity:
cc = C.LightenIntensityCompositeOp
case CompositeLinearBurn:
cc = C.LinearBurnCompositeOp
case CompositeLinearDodge:
cc = C.LinearDodgeCompositeOp
case CompositeLinearLight:
cc = C.LinearLightCompositeOp
case CompositeLuminize:
cc = C.LuminizeCompositeOp
case CompositeMathematics:
cc = C.MathematicsCompositeOp
case CompositeMinusDst:
cc = C.MinusDstCompositeOp
case CompositeMinusSrc:
cc = C.MinusSrcCompositeOp
case CompositeModulate:
cc = C.ModulateCompositeOp
case CompositeModulusAdd:
cc = C.ModulusAddCompositeOp
case CompositeModulusSubtract:
cc = C.ModulusSubtractCompositeOp
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 CompositePegtopLight:
cc = C.PegtopLightCompositeOp
case CompositePinLight:
cc = C.PinLightCompositeOp
case CompositePlus:
cc = C.PlusCompositeOp
case CompositeReplace:
cc = C.ReplaceCompositeOp
case CompositeSaturate:
cc = C.SaturateCompositeOp
case CompositeScreen:
cc = C.ScreenCompositeOp
case CompositeSoftLight:
cc = C.SoftLightCompositeOp
case CompositeSrcAtop:
cc = C.SrcAtopCompositeOp
case CompositeSrc:
cc = C.SrcCompositeOp
case CompositeSrcIn:
cc = C.SrcInCompositeOp
case CompositeSrcOut:
cc = C.SrcOutCompositeOp
case CompositeSrcOver:
cc = C.SrcOverCompositeOp
case CompositeThreshold:
cc = C.ThresholdCompositeOp
case CompositeUndefined:
cc = C.UndefinedCompositeOp
case CompositeVividLight:
cc = C.VividLightCompositeOp
case CompositeXor:
cc = C.XorCompositeOp
default:
return 0, notImplementedError(fmt.Sprintf("composite %s", c))
}
return int(cc), nil
}