PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/src/GFX/ImageFilter.xs

http://github.com/PerlGameDev/SDL
Unknown | 485 lines | 432 code | 53 blank | 0 comment | 0 complexity | 134eca0a20c5fe983b4b22451038f101 MD5 | raw file
  1#include "EXTERN.h"
  2#include "perl.h"
  3#include "XSUB.h"
  4#include "ppport.h"
  5
  6#ifndef aTHX_
  7#define aTHX_
  8#endif
  9
 10#include <SDL.h>
 11
 12#ifdef HAVE_SDL_GFX_IMAGEFILTER
 13#include <SDL_imageFilter.h>
 14#endif 
 15
 16MODULE = SDL::GFX::ImageFilter 	PACKAGE = SDL::GFX::ImageFilter    PREFIX = gfx_image_
 17
 18=for documentation
 19
 20The Following are XS bindings to the SDL_gfx Library
 21
 22Described here:
 23
 24See: L<http:/*www.ferzkopp.net/joomla/content/view/19/14/> */
 25
 26=cut
 27
 28#ifdef HAVE_SDL_GFX_IMAGEFILTER
 29
 30int
 31gfx_image_MMX_detect()
 32	CODE:
 33		RETVAL = SDL_imageFilterMMXdetect();
 34	OUTPUT:
 35		RETVAL
 36
 37void
 38gfx_image_MMX_off()
 39	CODE:
 40		SDL_imageFilterMMXoff();
 41
 42void
 43gfx_image_MMX_on()
 44	CODE:
 45		SDL_imageFilterMMXon();
 46
 47int
 48gfx_image_add(Src1, Src2, Dest, length)
 49	unsigned char *Src1
 50	unsigned char *Src2
 51	unsigned char *Dest
 52	int length
 53	CODE:
 54		RETVAL = SDL_imageFilterAdd(Src1, Src2, Dest, length);
 55	OUTPUT:
 56		RETVAL
 57
 58int
 59gfx_image_mean(Src1, Src2, Dest, length)
 60	unsigned char *Src1
 61	unsigned char *Src2
 62	unsigned char *Dest
 63	int length
 64	CODE:
 65		RETVAL = SDL_imageFilterMean(Src1, Src2, Dest, length);
 66	OUTPUT:
 67		RETVAL
 68
 69int
 70gfx_image_sub(Src1, Src2, Dest, length)
 71	unsigned char *Src1
 72	unsigned char *Src2
 73	unsigned char *Dest
 74	int length
 75	CODE:
 76		RETVAL = SDL_imageFilterSub(Src1, Src2, Dest, length);
 77	OUTPUT:
 78		RETVAL
 79
 80int
 81gfx_image_abs_diff(Src1, Src2, Dest, length)
 82	unsigned char *Src1
 83	unsigned char *Src2
 84	unsigned char *Dest
 85	int length
 86	CODE:
 87		RETVAL = SDL_imageFilterAbsDiff(Src1, Src2, Dest, length);
 88	OUTPUT:
 89		RETVAL
 90
 91int
 92gfx_image_mult(Src1, Src2, Dest, length)
 93	unsigned char *Src1
 94	unsigned char *Src2
 95	unsigned char *Dest
 96	int length
 97	CODE:
 98		RETVAL = SDL_imageFilterMult(Src1, Src2, Dest, length);
 99	OUTPUT:
100		RETVAL
101
102int
103gfx_image_mult_nor(Src1, Src2, Dest, length)
104	unsigned char *Src1
105	unsigned char *Src2
106	unsigned char *Dest
107	int length
108	CODE:
109		RETVAL = SDL_imageFilterMultNor(Src1, Src2, Dest, length);
110	OUTPUT:
111		RETVAL
112
113int
114gfx_image_mult_div_by_2(Src1, Src2, Dest, length)
115	unsigned char *Src1
116	unsigned char *Src2
117	unsigned char *Dest
118	int length
119	CODE:
120		RETVAL = SDL_imageFilterMultDivby2(Src1, Src2, Dest, length);
121	OUTPUT:
122		RETVAL
123
124int
125gfx_image_mult_div_by_4(Src1, Src2, Dest, length)
126	unsigned char *Src1
127	unsigned char *Src2
128	unsigned char *Dest
129	int length
130	CODE:
131		RETVAL = SDL_imageFilterMultDivby4(Src1, Src2, Dest, length);
132	OUTPUT:
133		RETVAL
134
135int
136gfx_image_bit_and(Src1, Src2, Dest, length)
137	unsigned char *Src1
138	unsigned char *Src2
139	unsigned char *Dest
140	int length
141	CODE:
142		RETVAL = SDL_imageFilterBitAnd(Src1, Src2, Dest, length);
143	OUTPUT:
144		RETVAL
145
146int
147gfx_image_bit_or(Src1, Src2, Dest, length)
148	unsigned char *Src1
149	unsigned char *Src2
150	unsigned char *Dest
151	int length
152	CODE:
153		RETVAL = SDL_imageFilterBitOr(Src1, Src2, Dest, length);
154	OUTPUT:
155		RETVAL
156
157int
158gfx_image_div(Src1, Src2, Dest, length)
159	unsigned char *Src1
160	unsigned char *Src2
161	unsigned char *Dest
162	int length
163	CODE:
164		RETVAL = SDL_imageFilterDiv(Src1, Src2, Dest, length);
165	OUTPUT:
166		RETVAL
167
168int
169gfx_image_bit_negation(Src1, Dest, length)
170	unsigned char *Src1
171	unsigned char *Dest
172	int length
173	CODE:
174		RETVAL = SDL_imageFilterBitNegation(Src1, Dest, length);
175	OUTPUT:
176		RETVAL
177
178int
179gfx_image_add_byte(Src1, Dest, length, C)
180	unsigned char *Src1
181	unsigned char *Dest
182	int length
183	unsigned char C
184	CODE:
185		RETVAL = SDL_imageFilterAddByte(Src1, Dest, length, C);
186	OUTPUT:
187		RETVAL
188
189int
190gfx_image_add_uint(Src1, Dest, length, C)
191	unsigned char *Src1
192	unsigned char *Dest
193	int length
194	unsigned int C
195	CODE:
196		RETVAL = SDL_imageFilterAddUint(Src1, Dest, length, C);
197	OUTPUT:
198		RETVAL
199
200int
201gfx_image_add_byte_to_half(Src1, Dest, length, C)
202	unsigned char *Src1
203	unsigned char *Dest
204	int length
205	unsigned char C
206	CODE:
207		RETVAL = SDL_imageFilterAddByteToHalf(Src1, Dest, length, C);
208	OUTPUT:
209		RETVAL
210
211int
212gfx_image_sub_byte(Src1, Dest, length, C)
213	unsigned char *Src1
214	unsigned char *Dest
215	int length
216	unsigned char C
217	CODE:
218		RETVAL = SDL_imageFilterSubByte(Src1, Dest, length, C);
219	OUTPUT:
220		RETVAL
221
222int
223gfx_image_sub_uint(Src1, Dest, length, C)
224	unsigned char *Src1
225	unsigned char *Dest
226	int length
227	unsigned int C
228	CODE:
229		RETVAL = SDL_imageFilterSubUint(Src1, Dest, length, C);
230	OUTPUT:
231		RETVAL
232
233int
234gfx_image_shift_right(Src1, Dest, length, N)
235	unsigned char *Src1
236	unsigned char *Dest
237	int length
238	unsigned char N
239	CODE:
240		RETVAL = SDL_imageFilterShiftRight(Src1, Dest, length, N);
241	OUTPUT:
242		RETVAL
243
244int
245gfx_image_shift_right_uint(Src1, Dest, length, N)
246	unsigned char *Src1
247	unsigned char *Dest
248	int length
249	unsigned char N
250	CODE:
251		RETVAL = SDL_imageFilterShiftRightUint(Src1, Dest, length, N);
252	OUTPUT:
253		RETVAL
254
255int
256gfx_image_mult_by_byte(Src1, Dest, length, C)
257	unsigned char *Src1
258	unsigned char *Dest
259	int length
260	unsigned char C
261	CODE:
262		RETVAL = SDL_imageFilterMultByByte(Src1, Dest, length, C);
263	OUTPUT:
264		RETVAL
265
266int
267gfx_image_shift_right_and_mult_by_byte(Src1, Dest, length, N, C)
268	unsigned char *Src1
269	unsigned char *Dest
270	int length
271	unsigned char N
272	unsigned char C
273	CODE:
274		RETVAL = SDL_imageFilterShiftRightAndMultByByte(Src1, Dest, length, N, C);
275	OUTPUT:
276		RETVAL
277
278int
279gfx_image_shift_left_byte(Src1, Dest, length, N)
280	unsigned char *Src1
281	unsigned char *Dest
282	int length
283	unsigned char N
284	CODE:
285		RETVAL = SDL_imageFilterShiftLeftByte(Src1, Dest, length, N);
286	OUTPUT:
287		RETVAL
288
289int
290gfx_image_shift_left_uint(Src1, Dest, length, N)
291	unsigned char *Src1
292	unsigned char *Dest
293	int length
294	unsigned char N
295	CODE:
296		RETVAL = SDL_imageFilterShiftLeftUint(Src1, Dest, length, N);
297	OUTPUT:
298		RETVAL
299
300int
301gfx_image_shift_left(Src1, Dest, length, N)
302	unsigned char *Src1
303	unsigned char *Dest
304	int length
305	unsigned char N
306	CODE:
307		RETVAL = SDL_imageFilterShiftLeft(Src1, Dest, length, N);
308	OUTPUT:
309		RETVAL
310
311int
312gfx_image_binarize_using_threshold(Src1, Dest, length, T)
313	unsigned char *Src1
314	unsigned char *Dest
315	int length
316	unsigned char T
317	CODE:
318		RETVAL = SDL_imageFilterBinarizeUsingThreshold(Src1, Dest, length, T);
319	OUTPUT:
320		RETVAL
321
322int
323gfx_image_clip_to_range(Src1, Dest, length, Tmin, Tmax)
324	unsigned char *Src1
325	unsigned char *Dest
326	int length
327	unsigned char Tmin
328	unsigned char Tmax
329	CODE:
330		RETVAL = SDL_imageFilterClipToRange(Src1, Dest, length, Tmin, Tmax);
331	OUTPUT:
332		RETVAL
333
334int
335gfx_image_normalize_linear(Src1, Dest, length, Cmin, Cmax, Nmin, Nmax)
336	unsigned char *Src1
337	unsigned char *Dest
338	int length
339	int Cmin
340	int Cmax
341	int Nmin
342	int Nmax
343	CODE:
344		RETVAL = SDL_imageFilterNormalizeLinear(Src1, Dest, length, Cmin, Cmax, Nmin, Nmax);
345	OUTPUT:
346		RETVAL
347
348int
349gfx_image_convolve_kernel_3x3_divide(Src, Dest, rows, columns, Kernel, Divisor)
350	unsigned char *Src
351	unsigned char *Dest
352	int rows
353	int columns
354	Sint16 *Kernel
355	unsigned char Divisor
356	CODE:
357		RETVAL = SDL_imageFilterConvolveKernel3x3Divide(Src, Dest, rows, columns, Kernel, Divisor);
358	OUTPUT:
359		RETVAL
360
361int
362gfx_image_convolve_kernel_5x5_divide(Src, Dest, rows, columns, Kernel, Divisor)
363	unsigned char *Src
364	unsigned char *Dest
365	int rows
366	int columns
367	Sint16 *Kernel
368	unsigned char Divisor
369	CODE:
370		RETVAL = SDL_imageFilterConvolveKernel5x5Divide(Src, Dest, rows, columns, Kernel, Divisor);
371	OUTPUT:
372		RETVAL
373
374int
375gfx_image_convolve_kernel_7x7_divide(Src, Dest, rows, columns, Kernel, Divisor)
376	unsigned char *Src
377	unsigned char *Dest
378	int rows
379	int columns
380	Sint16 *Kernel
381	unsigned char Divisor
382	CODE:
383		RETVAL = SDL_imageFilterConvolveKernel7x7Divide(Src, Dest, rows, columns, Kernel, Divisor);
384	OUTPUT:
385		RETVAL
386
387int
388gfx_image_convolve_kernel_9x9_divide(Src, Dest, rows, columns, Kernel, Divisor)
389	unsigned char *Src
390	unsigned char *Dest
391	int rows
392	int columns
393	Sint16 *Kernel
394	unsigned char Divisor
395	CODE:
396		RETVAL = SDL_imageFilterConvolveKernel9x9Divide(Src, Dest, rows, columns, Kernel, Divisor);
397	OUTPUT:
398		RETVAL
399
400int
401gfx_image_convolve_kernel_3x3_shift_right(Src, Dest, rows, columns, Kernel, NRightShift)
402	unsigned char *Src
403	unsigned char *Dest
404	int rows
405	int columns
406	Sint16 *Kernel
407	unsigned char NRightShift
408	CODE:
409		RETVAL = SDL_imageFilterConvolveKernel3x3ShiftRight(Src, Dest, rows, columns, Kernel, NRightShift);
410	OUTPUT:
411		RETVAL
412
413int
414gfx_image_convolve_kernel_5x5_shift_right(Src, Dest, rows, columns, Kernel, NRightShift)
415	unsigned char *Src
416	unsigned char *Dest
417	int rows
418	int columns
419	Sint16 *Kernel
420	unsigned char NRightShift
421	CODE:
422		RETVAL = SDL_imageFilterConvolveKernel5x5ShiftRight(Src, Dest, rows, columns, Kernel, NRightShift);
423	OUTPUT:
424		RETVAL
425
426int
427gfx_image_convolve_kernel_7x7_shift_right(Src, Dest, rows, columns, Kernel, NRightShift)
428	unsigned char *Src
429	unsigned char *Dest
430	int rows
431	int columns
432	Sint16 *Kernel
433	unsigned char NRightShift
434	CODE:
435		RETVAL = SDL_imageFilterConvolveKernel7x7ShiftRight(Src, Dest, rows, columns, Kernel, NRightShift);
436	OUTPUT:
437		RETVAL
438
439int
440gfx_image_convolve_kernel_9x9_shift_right(Src, Dest, rows, columns, Kernel, NRightShift)
441	unsigned char *Src
442	unsigned char *Dest
443	int rows
444	int columns
445	Sint16 *Kernel
446	unsigned char NRightShift
447	CODE:
448		RETVAL = SDL_imageFilterConvolveKernel9x9ShiftRight(Src, Dest, rows, columns, Kernel, NRightShift);
449	OUTPUT:
450		RETVAL
451
452int
453gfx_image_sobel_x(Src, Dest, rows, columns)
454	unsigned char *Src
455	unsigned char *Dest
456	int rows
457	int columns
458	CODE:
459		RETVAL = SDL_imageFilterSobelX(Src, Dest, rows, columns);
460	OUTPUT:
461		RETVAL
462
463int
464gfx_image_sobel_x_shift_right(Src, Dest, rows, columns, NRightShift)
465	unsigned char *Src
466	unsigned char *Dest
467	int rows
468	int columns
469	unsigned char NRightShift
470	CODE:
471		RETVAL = SDL_imageFilterSobelXShiftRight(Src, Dest, rows, columns, NRightShift);
472	OUTPUT:
473		RETVAL
474
475void
476gfx_image_align_stack()
477	CODE:
478		SDL_imageFilterAlignStack();
479
480void
481gfx_image_restore_stack()
482	CODE:
483		SDL_imageFilterRestoreStack();
484	
485#endif