1 /** \file
2  * \brief Kernel Generators
3  * Creates several known kernels
4  *
5  * See Copyright Notice in im_lib.d
6  */
7 
8 module im.kernel;
9 
10 import im.image: imImage;
11 
12 extern (C) @safe nothrow:
13 
14 
15 /** \defgroup kernel Kernel Generators
16  * \par
17  * Creates several known kernels
18  * \par
19  * See \ref im_kernel.h
20  * \ingroup convolve */
21 
22 
23 /** Creates a kernel with the following values:
24  *
25 \verbatim
26    1  2  1
27    0  0  0
28   -1 -2 -1
29 \endverbatim
30  *
31  * \verbatim im.KernelSobel() -> kernel: imImage [in Lua 5] \endverbatim
32  * \ingroup kernel */
33 imImage* imKernelSobel();
34 
35 /** Creates a kernel with the following values:
36  *
37 \verbatim
38    1  1  1
39    0  0  0
40   -1 -1 -1
41 \endverbatim
42  *
43  * \verbatim im.KernelPrewitt() -> kernel: imImage [in Lua 5] \endverbatim
44  * \ingroup kernel */
45 imImage* imKernelPrewitt();
46 
47 /** Creates a kernel with the following values:
48  *
49 \verbatim
50    5  5  5
51   -3  0 -3
52   -3 -3 -3
53 \endverbatim
54  *
55  * \verbatim im.KernelKirsh() -> kernel: imImage [in Lua 5] \endverbatim
56  * \ingroup kernel */
57 imImage* imKernelKirsh();
58 
59 /** Creates a kernel with the following values:
60  *
61 \verbatim
62    0 -1  0
63   -1  4 -1
64    0 -1  0
65 \endverbatim
66  *
67  * \verbatim im.KernelLaplacian4() -> kernel: imImage [in Lua 5] \endverbatim
68  * \ingroup kernel */
69 imImage* imKernelLaplacian4();
70 
71 /** Creates a kernel with the following values:
72  *
73 \verbatim
74   -1 -1 -1
75   -1  8 -1
76   -1 -1 -1
77 \endverbatim
78  *
79  * \verbatim im.KernelLaplacian8() -> kernel: imImage [in Lua 5] \endverbatim
80  * \ingroup kernel */
81 imImage* imKernelLaplacian8();
82 
83 /** Creates a kernel with the following values:
84  *
85 \verbatim
86    0 -1 -1 -1  0
87   -1  0  1  0 -1
88   -1  1  8  1 -1
89   -1  0  1  0 -1
90    0 -1 -1 -1  0
91 \endverbatim
92  *
93  * \verbatim im.KernelLaplacian5x5() -> kernel: imImage [in Lua 5] \endverbatim
94  * \ingroup kernel */
95 imImage* imKernelLaplacian5x5();
96 
97 /** Creates a kernel with the following values:
98  *
99 \verbatim
100   -1 -1 -1 -1 -1 -1 -1
101   -1 -1 -1 -1 -1 -1 -1
102   -1 -1 -1 -1 -1 -1 -1
103   -1 -1 -1 48 -1 -1 -1
104   -1 -1 -1 -1 -1 -1 -1
105   -1 -1 -1 -1 -1 -1 -1
106   -1 -1 -1 -1 -1 -1 -1
107 \endverbatim
108  *
109  * \verbatim im.KernelLaplacian7x7() -> kernel: imImage [in Lua 5] \endverbatim
110  * \ingroup kernel */
111 imImage* imKernelLaplacian7x7();
112 
113 /** Creates a kernel with the following values:
114  *
115 \verbatim
116   0 -1 0
117   0  1 0
118   0  0 0
119 \endverbatim
120  *
121  * \verbatim im.KernelGradian3x3() -> kernel: imImage [in Lua 5] \endverbatim
122  * \ingroup kernel */
123 imImage* imKernelGradian3x3();
124 
125 /** Creates a kernel with the following values:
126  *
127 \verbatim
128    0 -1 -1  0  1  1  0
129   -1 -2 -2  0  2  2  1
130   -1 -2 -3  0  3  2  1
131   -1 -2 -3  0  3  2  1
132   -1 -2 -3  0  3  2  1
133   -1 -2 -2  0  2  2  1
134    0 -1 -1  0  1  1  0
135 \endverbatim
136  *
137  * \verbatim im.KernelGradian7x7() -> kernel: imImage [in Lua 5] \endverbatim
138  * \ingroup kernel */
139 imImage* imKernelGradian7x7();
140 
141 /** Creates a kernel with the following values:
142  *
143 \verbatim
144   -1 0 0
145    0 0 0
146    0 0 1
147 \endverbatim
148  *
149  * \verbatim im.KernelSculpt() -> kernel: imImage [in Lua 5] \endverbatim
150  * \ingroup kernel */
151 imImage* imKernelSculpt();
152 
153 /** Creates a kernel with the following values:
154  *
155 \verbatim
156   1 1 1
157   1 1 1
158   1 1 1
159 \endverbatim
160  *
161  * \verbatim im.KernelMean3x3() -> kernel: imImage [in Lua 5] \endverbatim
162  * \ingroup kernel */
163 imImage* imKernelMean3x3();
164 
165 /** Creates a kernel with the following values:
166  *
167 \verbatim
168   1 1 1 1 1
169   1 1 1 1 1
170   1 1 1 1 1
171   1 1 1 1 1
172   1 1 1 1 1
173 \endverbatim
174  *
175  * \verbatim im.KernelMean5x5() -> kernel: imImage [in Lua 5] \endverbatim
176  * \ingroup kernel */
177 imImage* imKernelMean5x5();
178 
179 /** Creates a kernel with the following values:
180  *
181 \verbatim
182   0 1 1 1 0
183   1 1 1 1 1
184   1 1 1 1 1
185   1 1 1 1 1
186   0 1 1 1 0
187 \endverbatim
188  *
189  * \verbatim im.KernelMean5x5() -> kernel: imImage [in Lua 5] \endverbatim
190  * \ingroup kernel */
191 imImage* imKernelCircularMean5x5();
192 
193 /** Creates a kernel with the following values:
194  *
195 \verbatim
196   1 1 1 1 1 1 1
197   1 1 1 1 1 1 1
198   1 1 1 1 1 1 1
199   1 1 1 1 1 1 1
200   1 1 1 1 1 1 1
201   1 1 1 1 1 1 1
202   1 1 1 1 1 1 1
203 \endverbatim
204  *
205  * \verbatim im.KernelMean7x7() -> kernel: imImage [in Lua 5] \endverbatim
206  * \ingroup kernel */
207 imImage* imKernelMean7x7();
208 
209 /** Creates a kernel with the following values:
210  *
211 \verbatim
212   0 0 1 1 1 0 0
213   0 1 1 1 1 1 0
214   1 1 1 1 1 1 1
215   1 1 1 1 1 1 1
216   1 1 1 1 1 1 1
217   0 1 1 1 1 1 0
218   0 0 1 1 1 0 0
219 \endverbatim
220  *
221  * \verbatim im.KernelCircularMean7x7() -> kernel: imImage [in Lua 5] \endverbatim
222  * \ingroup kernel */
223 imImage* imKernelCircularMean7x7();
224 
225 /** Creates a kernel with the following values:
226  *
227 \verbatim
228   1 2 1
229   2 4 2
230   1 2 1
231 \endverbatim
232  *
233  * \verbatim im.KernelGaussian3x3() -> kernel: imImage [in Lua 5] \endverbatim
234  * \ingroup kernel */
235 imImage* imKernelGaussian3x3();
236 
237 /** Creates a kernel with the following values:
238  *
239 \verbatim
240   1  4  6  4 1
241   4 16 24 16 4
242   6 24 36 24 6
243   4 16 24 16 4
244   1  4  6  4 1
245 \endverbatim
246  *
247  * \verbatim im.KernelGaussian5x5() -> kernel: imImage [in Lua 5] \endverbatim
248  * \ingroup kernel */
249 imImage* imKernelGaussian5x5();
250 
251 /** Creates a kernel with the following values:
252  *
253 \verbatim
254   1 2 3 2 1
255   2 4 6 4 2
256   3 6 9 6 3
257   2 4 6 4 2
258   1 2 3 2 1
259 \endverbatim
260  *
261  * \verbatim im.KernelBarlett5x5() -> kernel: imImage [in Lua 5] \endverbatim
262  * \ingroup kernel */
263 imImage* imKernelBarlett5x5();
264 
265 /** Creates a kernel with the following values:
266  *
267 \verbatim
268    0 -1 -1 -1  0
269   -1 -1  3 -1 -1
270   -1  3  4  3 -1
271   -1 -1  3 -1 -1
272    0 -1 -1 -1  0
273 \endverbatim
274  *
275  * \verbatim im.KernelTopHat5x5() -> kernel: imImage [in Lua 5] \endverbatim
276  * \ingroup kernel */
277 imImage* imKernelTopHat5x5();
278 
279 /** Creates a kernel with the following values:
280  *
281 \verbatim
282    0  0 -1 -1 -1  0  0
283    0 -1 -1 -1 -1 -1  0
284   -1 -1  3  3  3 -1 -1
285   -1 -1  3  4  3 -1 -1
286   -1 -1  3  3  3 -1 -1
287    0 -1 -1 -1 -1 -1  0
288    0  0 -1 -1 -1  0  0
289 \endverbatim
290  *
291  * \verbatim im.KernelTopHat7x7() -> kernel: imImage [in Lua 5] \endverbatim
292  * \ingroup kernel */
293 imImage* imKernelTopHat7x7();
294 
295 /** Creates a kernel with the following values:
296  *
297 \verbatim
298    0 -1 -2 -1  0
299   -1 -4  0 -4 -1
300   -2  0 40  0 -2
301   -1 -4  0 -4 -1
302    0 -1 -2 -1  0
303 \endverbatim
304  *
305  * \verbatim im.KernelEnhance() -> kernel: imImage [in Lua 5] \endverbatim
306  * \ingroup kernel */
307 imImage* imKernelEnhance();