Update to 2.0.0 tree from current Fremantle build
[opencv] / interfaces / swig / python / _highgui.cpp
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 1.3.40
4  * 
5  * This file is not intended to be easily readable and contains a number of 
6  * coding conventions designed to improve portability and efficiency. Do not make
7  * changes to this file unless you know what you are doing--modify the SWIG 
8  * interface file instead. 
9  * ----------------------------------------------------------------------------- */
10
11 #define SWIGPYTHON
12 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
13
14
15 #ifdef __cplusplus
16 /* SwigValueWrapper is described in swig.swg */
17 template<typename T> class SwigValueWrapper {
18   struct SwigMovePointer {
19     T *ptr;
20     SwigMovePointer(T *p) : ptr(p) { }
21     ~SwigMovePointer() { delete ptr; }
22     SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
23   } pointer;
24   SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
25   SwigValueWrapper(const SwigValueWrapper<T>& rhs);
26 public:
27   SwigValueWrapper() : pointer(0) { }
28   SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
29   operator T&() const { return *pointer.ptr; }
30   T *operator&() { return pointer.ptr; }
31 };
32
33 template <typename T> T SwigValueInit() {
34   return T();
35 }
36 #endif
37
38 /* -----------------------------------------------------------------------------
39  *  This section contains generic SWIG labels for method/variable
40  *  declarations/attributes, and other compiler dependent labels.
41  * ----------------------------------------------------------------------------- */
42
43 /* template workaround for compilers that cannot correctly implement the C++ standard */
44 #ifndef SWIGTEMPLATEDISAMBIGUATOR
45 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
46 #  define SWIGTEMPLATEDISAMBIGUATOR template
47 # elif defined(__HP_aCC)
48 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
49 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
50 #  define SWIGTEMPLATEDISAMBIGUATOR template
51 # else
52 #  define SWIGTEMPLATEDISAMBIGUATOR
53 # endif
54 #endif
55
56 /* inline attribute */
57 #ifndef SWIGINLINE
58 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
59 #   define SWIGINLINE inline
60 # else
61 #   define SWIGINLINE
62 # endif
63 #endif
64
65 /* attribute recognised by some compilers to avoid 'unused' warnings */
66 #ifndef SWIGUNUSED
67 # if defined(__GNUC__)
68 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
69 #     define SWIGUNUSED __attribute__ ((__unused__)) 
70 #   else
71 #     define SWIGUNUSED
72 #   endif
73 # elif defined(__ICC)
74 #   define SWIGUNUSED __attribute__ ((__unused__)) 
75 # else
76 #   define SWIGUNUSED 
77 # endif
78 #endif
79
80 #ifndef SWIG_MSC_UNSUPPRESS_4505
81 # if defined(_MSC_VER)
82 #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
83 # endif 
84 #endif
85
86 #ifndef SWIGUNUSEDPARM
87 # ifdef __cplusplus
88 #   define SWIGUNUSEDPARM(p)
89 # else
90 #   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
91 # endif
92 #endif
93
94 /* internal SWIG method */
95 #ifndef SWIGINTERN
96 # define SWIGINTERN static SWIGUNUSED
97 #endif
98
99 /* internal inline SWIG method */
100 #ifndef SWIGINTERNINLINE
101 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
102 #endif
103
104 /* exporting methods */
105 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
106 #  ifndef GCC_HASCLASSVISIBILITY
107 #    define GCC_HASCLASSVISIBILITY
108 #  endif
109 #endif
110
111 #ifndef SWIGEXPORT
112 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
113 #   if defined(STATIC_LINKED)
114 #     define SWIGEXPORT
115 #   else
116 #     define SWIGEXPORT __declspec(dllexport)
117 #   endif
118 # else
119 #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
120 #     define SWIGEXPORT __attribute__ ((visibility("default")))
121 #   else
122 #     define SWIGEXPORT
123 #   endif
124 # endif
125 #endif
126
127 /* calling conventions for Windows */
128 #ifndef SWIGSTDCALL
129 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
130 #   define SWIGSTDCALL __stdcall
131 # else
132 #   define SWIGSTDCALL
133 # endif 
134 #endif
135
136 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
137 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
138 # define _CRT_SECURE_NO_DEPRECATE
139 #endif
140
141 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
142 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
143 # define _SCL_SECURE_NO_DEPRECATE
144 #endif
145
146
147
148 /* Python.h has to appear first */
149 #include <Python.h>
150
151 /* -----------------------------------------------------------------------------
152  * swigrun.swg
153  *
154  * This file contains generic C API SWIG runtime support for pointer
155  * type checking.
156  * ----------------------------------------------------------------------------- */
157
158 /* This should only be incremented when either the layout of swig_type_info changes,
159    or for whatever reason, the runtime changes incompatibly */
160 #define SWIG_RUNTIME_VERSION "4"
161
162 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
163 #ifdef SWIG_TYPE_TABLE
164 # define SWIG_QUOTE_STRING(x) #x
165 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
166 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
167 #else
168 # define SWIG_TYPE_TABLE_NAME
169 #endif
170
171 /*
172   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
173   creating a static or dynamic library from the SWIG runtime code.
174   In 99.9% of the cases, SWIG just needs to declare them as 'static'.
175   
176   But only do this if strictly necessary, ie, if you have problems
177   with your compiler or suchlike.
178 */
179
180 #ifndef SWIGRUNTIME
181 # define SWIGRUNTIME SWIGINTERN
182 #endif
183
184 #ifndef SWIGRUNTIMEINLINE
185 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
186 #endif
187
188 /*  Generic buffer size */
189 #ifndef SWIG_BUFFER_SIZE
190 # define SWIG_BUFFER_SIZE 1024
191 #endif
192
193 /* Flags for pointer conversions */
194 #define SWIG_POINTER_DISOWN        0x1
195 #define SWIG_CAST_NEW_MEMORY       0x2
196
197 /* Flags for new pointer objects */
198 #define SWIG_POINTER_OWN           0x1
199
200
201 /* 
202    Flags/methods for returning states.
203    
204    The SWIG conversion methods, as ConvertPtr, return and integer 
205    that tells if the conversion was successful or not. And if not,
206    an error code can be returned (see swigerrors.swg for the codes).
207    
208    Use the following macros/flags to set or process the returning
209    states.
210    
211    In old versions of SWIG, code such as the following was usually written:
212
213      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
214        // success code
215      } else {
216        //fail code
217      }
218
219    Now you can be more explicit:
220
221     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
222     if (SWIG_IsOK(res)) {
223       // success code
224     } else {
225       // fail code
226     }
227
228    which is the same really, but now you can also do
229
230     Type *ptr;
231     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
232     if (SWIG_IsOK(res)) {
233       // success code
234       if (SWIG_IsNewObj(res) {
235         ...
236         delete *ptr;
237       } else {
238         ...
239       }
240     } else {
241       // fail code
242     }
243     
244    I.e., now SWIG_ConvertPtr can return new objects and you can
245    identify the case and take care of the deallocation. Of course that
246    also requires SWIG_ConvertPtr to return new result values, such as
247
248       int SWIG_ConvertPtr(obj, ptr,...) {         
249         if (<obj is ok>) {                             
250           if (<need new object>) {                     
251             *ptr = <ptr to new allocated object>; 
252             return SWIG_NEWOBJ;                
253           } else {                                     
254             *ptr = <ptr to old object>;        
255             return SWIG_OLDOBJ;                
256           }                                    
257         } else {                                       
258           return SWIG_BADOBJ;                  
259         }                                              
260       }
261
262    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
263    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
264    SWIG errors code.
265
266    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
267    allows to return the 'cast rank', for example, if you have this
268
269        int food(double)
270        int fooi(int);
271
272    and you call
273  
274       food(1)   // cast rank '1'  (1 -> 1.0)
275       fooi(1)   // cast rank '0'
276
277    just use the SWIG_AddCast()/SWIG_CheckState()
278 */
279
280 #define SWIG_OK                    (0) 
281 #define SWIG_ERROR                 (-1)
282 #define SWIG_IsOK(r)               (r >= 0)
283 #define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
284
285 /* The CastRankLimit says how many bits are used for the cast rank */
286 #define SWIG_CASTRANKLIMIT         (1 << 8)
287 /* The NewMask denotes the object was created (using new/malloc) */
288 #define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
289 /* The TmpMask is for in/out typemaps that use temporal objects */
290 #define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
291 /* Simple returning values */
292 #define SWIG_BADOBJ                (SWIG_ERROR)
293 #define SWIG_OLDOBJ                (SWIG_OK)
294 #define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
295 #define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
296 /* Check, add and del mask methods */
297 #define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
298 #define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
299 #define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
300 #define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
301 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
302 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
303
304 /* Cast-Rank Mode */
305 #if defined(SWIG_CASTRANK_MODE)
306 #  ifndef SWIG_TypeRank
307 #    define SWIG_TypeRank             unsigned long
308 #  endif
309 #  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
310 #    define SWIG_MAXCASTRANK          (2)
311 #  endif
312 #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
313 #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
314 SWIGINTERNINLINE int SWIG_AddCast(int r) { 
315   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
316 }
317 SWIGINTERNINLINE int SWIG_CheckState(int r) { 
318   return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
319 }
320 #else /* no cast-rank mode */
321 #  define SWIG_AddCast
322 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
323 #endif
324
325
326 #include <string.h>
327
328 #ifdef __cplusplus
329 extern "C" {
330 #endif
331
332 typedef void *(*swig_converter_func)(void *, int *);
333 typedef struct swig_type_info *(*swig_dycast_func)(void **);
334
335 /* Structure to store information on one type */
336 typedef struct swig_type_info {
337   const char             *name;                 /* mangled name of this type */
338   const char             *str;                  /* human readable name of this type */
339   swig_dycast_func        dcast;                /* dynamic cast function down a hierarchy */
340   struct swig_cast_info  *cast;                 /* linked list of types that can cast into this type */
341   void                   *clientdata;           /* language specific type data */
342   int                    owndata;               /* flag if the structure owns the clientdata */
343 } swig_type_info;
344
345 /* Structure to store a type and conversion function used for casting */
346 typedef struct swig_cast_info {
347   swig_type_info         *type;                 /* pointer to type that is equivalent to this type */
348   swig_converter_func     converter;            /* function to cast the void pointers */
349   struct swig_cast_info  *next;                 /* pointer to next cast in linked list */
350   struct swig_cast_info  *prev;                 /* pointer to the previous cast */
351 } swig_cast_info;
352
353 /* Structure used to store module information
354  * Each module generates one structure like this, and the runtime collects
355  * all of these structures and stores them in a circularly linked list.*/
356 typedef struct swig_module_info {
357   swig_type_info         **types;               /* Array of pointers to swig_type_info structures that are in this module */
358   size_t                 size;                  /* Number of types in this module */
359   struct swig_module_info *next;                /* Pointer to next element in circularly linked list */
360   swig_type_info         **type_initial;        /* Array of initially generated type structures */
361   swig_cast_info         **cast_initial;        /* Array of initially generated casting structures */
362   void                    *clientdata;          /* Language specific module data */
363 } swig_module_info;
364
365 /* 
366   Compare two type names skipping the space characters, therefore
367   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
368
369   Return 0 when the two name types are equivalent, as in
370   strncmp, but skipping ' '.
371 */
372 SWIGRUNTIME int
373 SWIG_TypeNameComp(const char *f1, const char *l1,
374                   const char *f2, const char *l2) {
375   for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
376     while ((*f1 == ' ') && (f1 != l1)) ++f1;
377     while ((*f2 == ' ') && (f2 != l2)) ++f2;
378     if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
379   }
380   return (int)((l1 - f1) - (l2 - f2));
381 }
382
383 /*
384   Check type equivalence in a name list like <name1>|<name2>|...
385   Return 0 if not equal, 1 if equal
386 */
387 SWIGRUNTIME int
388 SWIG_TypeEquiv(const char *nb, const char *tb) {
389   int equiv = 0;
390   const char* te = tb + strlen(tb);
391   const char* ne = nb;
392   while (!equiv && *ne) {
393     for (nb = ne; *ne; ++ne) {
394       if (*ne == '|') break;
395     }
396     equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
397     if (*ne) ++ne;
398   }
399   return equiv;
400 }
401
402 /*
403   Check type equivalence in a name list like <name1>|<name2>|...
404   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
405 */
406 SWIGRUNTIME int
407 SWIG_TypeCompare(const char *nb, const char *tb) {
408   int equiv = 0;
409   const char* te = tb + strlen(tb);
410   const char* ne = nb;
411   while (!equiv && *ne) {
412     for (nb = ne; *ne; ++ne) {
413       if (*ne == '|') break;
414     }
415     equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
416     if (*ne) ++ne;
417   }
418   return equiv;
419 }
420
421
422 /*
423   Check the typename
424 */
425 SWIGRUNTIME swig_cast_info *
426 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
427   if (ty) {
428     swig_cast_info *iter = ty->cast;
429     while (iter) {
430       if (strcmp(iter->type->name, c) == 0) {
431         if (iter == ty->cast)
432           return iter;
433         /* Move iter to the top of the linked list */
434         iter->prev->next = iter->next;
435         if (iter->next)
436           iter->next->prev = iter->prev;
437         iter->next = ty->cast;
438         iter->prev = 0;
439         if (ty->cast) ty->cast->prev = iter;
440         ty->cast = iter;
441         return iter;
442       }
443       iter = iter->next;
444     }
445   }
446   return 0;
447 }
448
449 /* 
450   Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
451 */
452 SWIGRUNTIME swig_cast_info *
453 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
454   if (ty) {
455     swig_cast_info *iter = ty->cast;
456     while (iter) {
457       if (iter->type == from) {
458         if (iter == ty->cast)
459           return iter;
460         /* Move iter to the top of the linked list */
461         iter->prev->next = iter->next;
462         if (iter->next)
463           iter->next->prev = iter->prev;
464         iter->next = ty->cast;
465         iter->prev = 0;
466         if (ty->cast) ty->cast->prev = iter;
467         ty->cast = iter;
468         return iter;
469       }
470       iter = iter->next;
471     }
472   }
473   return 0;
474 }
475
476 /*
477   Cast a pointer up an inheritance hierarchy
478 */
479 SWIGRUNTIMEINLINE void *
480 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
481   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
482 }
483
484 /* 
485    Dynamic pointer casting. Down an inheritance hierarchy
486 */
487 SWIGRUNTIME swig_type_info *
488 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
489   swig_type_info *lastty = ty;
490   if (!ty || !ty->dcast) return ty;
491   while (ty && (ty->dcast)) {
492     ty = (*ty->dcast)(ptr);
493     if (ty) lastty = ty;
494   }
495   return lastty;
496 }
497
498 /*
499   Return the name associated with this type
500 */
501 SWIGRUNTIMEINLINE const char *
502 SWIG_TypeName(const swig_type_info *ty) {
503   return ty->name;
504 }
505
506 /*
507   Return the pretty name associated with this type,
508   that is an unmangled type name in a form presentable to the user.
509 */
510 SWIGRUNTIME const char *
511 SWIG_TypePrettyName(const swig_type_info *type) {
512   /* The "str" field contains the equivalent pretty names of the
513      type, separated by vertical-bar characters.  We choose
514      to print the last name, as it is often (?) the most
515      specific. */
516   if (!type) return NULL;
517   if (type->str != NULL) {
518     const char *last_name = type->str;
519     const char *s;
520     for (s = type->str; *s; s++)
521       if (*s == '|') last_name = s+1;
522     return last_name;
523   }
524   else
525     return type->name;
526 }
527
528 /* 
529    Set the clientdata field for a type
530 */
531 SWIGRUNTIME void
532 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
533   swig_cast_info *cast = ti->cast;
534   /* if (ti->clientdata == clientdata) return; */
535   ti->clientdata = clientdata;
536   
537   while (cast) {
538     if (!cast->converter) {
539       swig_type_info *tc = cast->type;
540       if (!tc->clientdata) {
541         SWIG_TypeClientData(tc, clientdata);
542       }
543     }    
544     cast = cast->next;
545   }
546 }
547 SWIGRUNTIME void
548 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
549   SWIG_TypeClientData(ti, clientdata);
550   ti->owndata = 1;
551 }
552   
553 /*
554   Search for a swig_type_info structure only by mangled name
555   Search is a O(log #types)
556   
557   We start searching at module start, and finish searching when start == end.  
558   Note: if start == end at the beginning of the function, we go all the way around
559   the circular list.
560 */
561 SWIGRUNTIME swig_type_info *
562 SWIG_MangledTypeQueryModule(swig_module_info *start, 
563                             swig_module_info *end, 
564                             const char *name) {
565   swig_module_info *iter = start;
566   do {
567     if (iter->size) {
568       register size_t l = 0;
569       register size_t r = iter->size - 1;
570       do {
571         /* since l+r >= 0, we can (>> 1) instead (/ 2) */
572         register size_t i = (l + r) >> 1; 
573         const char *iname = iter->types[i]->name;
574         if (iname) {
575           register int compare = strcmp(name, iname);
576           if (compare == 0) {       
577             return iter->types[i];
578           } else if (compare < 0) {
579             if (i) {
580               r = i - 1;
581             } else {
582               break;
583             }
584           } else if (compare > 0) {
585             l = i + 1;
586           }
587         } else {
588           break; /* should never happen */
589         }
590       } while (l <= r);
591     }
592     iter = iter->next;
593   } while (iter != end);
594   return 0;
595 }
596
597 /*
598   Search for a swig_type_info structure for either a mangled name or a human readable name.
599   It first searches the mangled names of the types, which is a O(log #types)
600   If a type is not found it then searches the human readable names, which is O(#types).
601   
602   We start searching at module start, and finish searching when start == end.  
603   Note: if start == end at the beginning of the function, we go all the way around
604   the circular list.
605 */
606 SWIGRUNTIME swig_type_info *
607 SWIG_TypeQueryModule(swig_module_info *start, 
608                      swig_module_info *end, 
609                      const char *name) {
610   /* STEP 1: Search the name field using binary search */
611   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
612   if (ret) {
613     return ret;
614   } else {
615     /* STEP 2: If the type hasn't been found, do a complete search
616        of the str field (the human readable name) */
617     swig_module_info *iter = start;
618     do {
619       register size_t i = 0;
620       for (; i < iter->size; ++i) {
621         if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
622           return iter->types[i];
623       }
624       iter = iter->next;
625     } while (iter != end);
626   }
627   
628   /* neither found a match */
629   return 0;
630 }
631
632 /* 
633    Pack binary data into a string
634 */
635 SWIGRUNTIME char *
636 SWIG_PackData(char *c, void *ptr, size_t sz) {
637   static const char hex[17] = "0123456789abcdef";
638   register const unsigned char *u = (unsigned char *) ptr;
639   register const unsigned char *eu =  u + sz;
640   for (; u != eu; ++u) {
641     register unsigned char uu = *u;
642     *(c++) = hex[(uu & 0xf0) >> 4];
643     *(c++) = hex[uu & 0xf];
644   }
645   return c;
646 }
647
648 /* 
649    Unpack binary data from a string
650 */
651 SWIGRUNTIME const char *
652 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
653   register unsigned char *u = (unsigned char *) ptr;
654   register const unsigned char *eu = u + sz;
655   for (; u != eu; ++u) {
656     register char d = *(c++);
657     register unsigned char uu;
658     if ((d >= '0') && (d <= '9'))
659       uu = ((d - '0') << 4);
660     else if ((d >= 'a') && (d <= 'f'))
661       uu = ((d - ('a'-10)) << 4);
662     else 
663       return (char *) 0;
664     d = *(c++);
665     if ((d >= '0') && (d <= '9'))
666       uu |= (d - '0');
667     else if ((d >= 'a') && (d <= 'f'))
668       uu |= (d - ('a'-10));
669     else 
670       return (char *) 0;
671     *u = uu;
672   }
673   return c;
674 }
675
676 /* 
677    Pack 'void *' into a string buffer.
678 */
679 SWIGRUNTIME char *
680 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
681   char *r = buff;
682   if ((2*sizeof(void *) + 2) > bsz) return 0;
683   *(r++) = '_';
684   r = SWIG_PackData(r,&ptr,sizeof(void *));
685   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
686   strcpy(r,name);
687   return buff;
688 }
689
690 SWIGRUNTIME const char *
691 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
692   if (*c != '_') {
693     if (strcmp(c,"NULL") == 0) {
694       *ptr = (void *) 0;
695       return name;
696     } else {
697       return 0;
698     }
699   }
700   return SWIG_UnpackData(++c,ptr,sizeof(void *));
701 }
702
703 SWIGRUNTIME char *
704 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
705   char *r = buff;
706   size_t lname = (name ? strlen(name) : 0);
707   if ((2*sz + 2 + lname) > bsz) return 0;
708   *(r++) = '_';
709   r = SWIG_PackData(r,ptr,sz);
710   if (lname) {
711     strncpy(r,name,lname+1);
712   } else {
713     *r = 0;
714   }
715   return buff;
716 }
717
718 SWIGRUNTIME const char *
719 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
720   if (*c != '_') {
721     if (strcmp(c,"NULL") == 0) {
722       memset(ptr,0,sz);
723       return name;
724     } else {
725       return 0;
726     }
727   }
728   return SWIG_UnpackData(++c,ptr,sz);
729 }
730
731 #ifdef __cplusplus
732 }
733 #endif
734
735 /*  Errors in SWIG */
736 #define  SWIG_UnknownError         -1 
737 #define  SWIG_IOError              -2 
738 #define  SWIG_RuntimeError         -3 
739 #define  SWIG_IndexError           -4 
740 #define  SWIG_TypeError            -5 
741 #define  SWIG_DivisionByZero       -6 
742 #define  SWIG_OverflowError        -7 
743 #define  SWIG_SyntaxError          -8 
744 #define  SWIG_ValueError           -9 
745 #define  SWIG_SystemError          -10
746 #define  SWIG_AttributeError       -11
747 #define  SWIG_MemoryError          -12 
748 #define  SWIG_NullReferenceError   -13
749
750
751
752 /* Compatibility macros for Python 3 */
753 #if PY_VERSION_HEX >= 0x03000000
754
755 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
756 #define PyInt_Check(x) PyLong_Check(x)
757 #define PyInt_AsLong(x) PyLong_AsLong(x)
758 #define PyInt_FromLong(x) PyLong_FromLong(x)
759 #define PyString_Format(fmt, args)  PyUnicode_Format(fmt, args)
760
761 #endif
762
763 #ifndef Py_TYPE
764 #  define Py_TYPE(op) ((op)->ob_type)
765 #endif
766
767 /* SWIG APIs for compatibility of both Python 2 & 3 */
768
769 #if PY_VERSION_HEX >= 0x03000000
770 #  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
771 #else
772 #  define SWIG_Python_str_FromFormat PyString_FromFormat
773 #endif
774
775
776 /* Warning: This function will allocate a new string in Python 3,
777  * so please call SWIG_Python_str_DelForPy3(x) to free the space.
778  */
779 SWIGINTERN char*
780 SWIG_Python_str_AsChar(PyObject *str)
781 {
782 #if PY_VERSION_HEX >= 0x03000000
783   char *cstr;
784   char *newstr;
785   Py_ssize_t len;
786   str = PyUnicode_AsUTF8String(str);
787   PyBytes_AsStringAndSize(str, &cstr, &len);
788   newstr = (char *) malloc(len+1);
789   memcpy(newstr, cstr, len+1);
790   Py_XDECREF(str);
791   return newstr;
792 #else
793   return PyString_AsString(str);
794 #endif
795 }
796
797 #if PY_VERSION_HEX >= 0x03000000
798 #  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
799 #else
800 #  define SWIG_Python_str_DelForPy3(x) 
801 #endif
802
803
804 SWIGINTERN PyObject*
805 SWIG_Python_str_FromChar(const char *c)
806 {
807 #if PY_VERSION_HEX >= 0x03000000
808   return PyUnicode_FromString(c); 
809 #else
810   return PyString_FromString(c);
811 #endif
812 }
813
814 /* Add PyOS_snprintf for old Pythons */
815 #if PY_VERSION_HEX < 0x02020000
816 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
817 #  define PyOS_snprintf _snprintf
818 # else
819 #  define PyOS_snprintf snprintf
820 # endif
821 #endif
822
823 /* A crude PyString_FromFormat implementation for old Pythons */
824 #if PY_VERSION_HEX < 0x02020000
825
826 #ifndef SWIG_PYBUFFER_SIZE
827 # define SWIG_PYBUFFER_SIZE 1024
828 #endif
829
830 static PyObject *
831 PyString_FromFormat(const char *fmt, ...) {
832   va_list ap;
833   char buf[SWIG_PYBUFFER_SIZE * 2];
834   int res;
835   va_start(ap, fmt);
836   res = vsnprintf(buf, sizeof(buf), fmt, ap);
837   va_end(ap);
838   return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
839 }
840 #endif
841
842 /* Add PyObject_Del for old Pythons */
843 #if PY_VERSION_HEX < 0x01060000
844 # define PyObject_Del(op) PyMem_DEL((op))
845 #endif
846 #ifndef PyObject_DEL
847 # define PyObject_DEL PyObject_Del
848 #endif
849
850 /* A crude PyExc_StopIteration exception for old Pythons */
851 #if PY_VERSION_HEX < 0x02020000
852 # ifndef PyExc_StopIteration
853 #  define PyExc_StopIteration PyExc_RuntimeError
854 # endif
855 # ifndef PyObject_GenericGetAttr
856 #  define PyObject_GenericGetAttr 0
857 # endif
858 #endif
859
860 /* Py_NotImplemented is defined in 2.1 and up. */
861 #if PY_VERSION_HEX < 0x02010000
862 # ifndef Py_NotImplemented
863 #  define Py_NotImplemented PyExc_RuntimeError
864 # endif
865 #endif
866
867 /* A crude PyString_AsStringAndSize implementation for old Pythons */
868 #if PY_VERSION_HEX < 0x02010000
869 # ifndef PyString_AsStringAndSize
870 #  define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
871 # endif
872 #endif
873
874 /* PySequence_Size for old Pythons */
875 #if PY_VERSION_HEX < 0x02000000
876 # ifndef PySequence_Size
877 #  define PySequence_Size PySequence_Length
878 # endif
879 #endif
880
881 /* PyBool_FromLong for old Pythons */
882 #if PY_VERSION_HEX < 0x02030000
883 static
884 PyObject *PyBool_FromLong(long ok)
885 {
886   PyObject *result = ok ? Py_True : Py_False;
887   Py_INCREF(result);
888   return result;
889 }
890 #endif
891
892 /* Py_ssize_t for old Pythons */
893 /* This code is as recommended by: */
894 /* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
895 #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
896 typedef int Py_ssize_t;
897 # define PY_SSIZE_T_MAX INT_MAX
898 # define PY_SSIZE_T_MIN INT_MIN
899 #endif
900
901 /* -----------------------------------------------------------------------------
902  * error manipulation
903  * ----------------------------------------------------------------------------- */
904
905 SWIGRUNTIME PyObject*
906 SWIG_Python_ErrorType(int code) {
907   PyObject* type = 0;
908   switch(code) {
909   case SWIG_MemoryError:
910     type = PyExc_MemoryError;
911     break;
912   case SWIG_IOError:
913     type = PyExc_IOError;
914     break;
915   case SWIG_RuntimeError:
916     type = PyExc_RuntimeError;
917     break;
918   case SWIG_IndexError:
919     type = PyExc_IndexError;
920     break;
921   case SWIG_TypeError:
922     type = PyExc_TypeError;
923     break;
924   case SWIG_DivisionByZero:
925     type = PyExc_ZeroDivisionError;
926     break;
927   case SWIG_OverflowError:
928     type = PyExc_OverflowError;
929     break;
930   case SWIG_SyntaxError:
931     type = PyExc_SyntaxError;
932     break;
933   case SWIG_ValueError:
934     type = PyExc_ValueError;
935     break;
936   case SWIG_SystemError:
937     type = PyExc_SystemError;
938     break;
939   case SWIG_AttributeError:
940     type = PyExc_AttributeError;
941     break;
942   default:
943     type = PyExc_RuntimeError;
944   }
945   return type;
946 }
947
948
949 SWIGRUNTIME void
950 SWIG_Python_AddErrorMsg(const char* mesg)
951 {
952   PyObject *type = 0;
953   PyObject *value = 0;
954   PyObject *traceback = 0;
955
956   if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
957   if (value) {
958     char *tmp;
959     PyObject *old_str = PyObject_Str(value);
960     PyErr_Clear();
961     Py_XINCREF(type);
962
963     PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
964     SWIG_Python_str_DelForPy3(tmp);
965     Py_DECREF(old_str);
966     Py_DECREF(value);
967   } else {
968     PyErr_SetString(PyExc_RuntimeError, mesg);
969   }
970 }
971
972 #if defined(SWIG_PYTHON_NO_THREADS)
973 #  if defined(SWIG_PYTHON_THREADS)
974 #    undef SWIG_PYTHON_THREADS
975 #  endif
976 #endif
977 #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
978 #  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
979 #    if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
980 #      define SWIG_PYTHON_USE_GIL
981 #    endif
982 #  endif
983 #  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
984 #    ifndef SWIG_PYTHON_INITIALIZE_THREADS
985 #     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads() 
986 #    endif
987 #    ifdef __cplusplus /* C++ code */
988        class SWIG_Python_Thread_Block {
989          bool status;
990          PyGILState_STATE state;
991        public:
992          void end() { if (status) { PyGILState_Release(state); status = false;} }
993          SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
994          ~SWIG_Python_Thread_Block() { end(); }
995        };
996        class SWIG_Python_Thread_Allow {
997          bool status;
998          PyThreadState *save;
999        public:
1000          void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
1001          SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
1002          ~SWIG_Python_Thread_Allow() { end(); }
1003        };
1004 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
1005 #      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
1006 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
1007 #      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
1008 #    else /* C code */
1009 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
1010 #      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
1011 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
1012 #      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
1013 #    endif
1014 #  else /* Old thread way, not implemented, user must provide it */
1015 #    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1016 #      define SWIG_PYTHON_INITIALIZE_THREADS
1017 #    endif
1018 #    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1019 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1020 #    endif
1021 #    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1022 #      define SWIG_PYTHON_THREAD_END_BLOCK
1023 #    endif
1024 #    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1025 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1026 #    endif
1027 #    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1028 #      define SWIG_PYTHON_THREAD_END_ALLOW
1029 #    endif
1030 #  endif
1031 #else /* No thread support */
1032 #  define SWIG_PYTHON_INITIALIZE_THREADS
1033 #  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1034 #  define SWIG_PYTHON_THREAD_END_BLOCK
1035 #  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1036 #  define SWIG_PYTHON_THREAD_END_ALLOW
1037 #endif
1038
1039 /* -----------------------------------------------------------------------------
1040  * Python API portion that goes into the runtime
1041  * ----------------------------------------------------------------------------- */
1042
1043 #ifdef __cplusplus
1044 extern "C" {
1045 #if 0
1046 } /* cc-mode */
1047 #endif
1048 #endif
1049
1050 /* -----------------------------------------------------------------------------
1051  * Constant declarations
1052  * ----------------------------------------------------------------------------- */
1053
1054 /* Constant Types */
1055 #define SWIG_PY_POINTER 4
1056 #define SWIG_PY_BINARY  5
1057
1058 /* Constant information structure */
1059 typedef struct swig_const_info {
1060   int type;
1061   char *name;
1062   long lvalue;
1063   double dvalue;
1064   void   *pvalue;
1065   swig_type_info **ptype;
1066 } swig_const_info;
1067
1068
1069 /* -----------------------------------------------------------------------------
1070  * Wrapper of PyInstanceMethod_New() used in Python 3
1071  * It is exported to the generated module, used for -fastproxy
1072  * ----------------------------------------------------------------------------- */
1073 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func)
1074 {
1075 #if PY_VERSION_HEX >= 0x03000000
1076   return PyInstanceMethod_New(func);
1077 #else
1078   return NULL;
1079 #endif
1080 }
1081
1082 #ifdef __cplusplus
1083 #if 0
1084 { /* cc-mode */
1085 #endif
1086 }
1087 #endif
1088
1089
1090 /* -----------------------------------------------------------------------------
1091  * See the LICENSE file for information on copyright, usage and redistribution
1092  * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1093  *
1094  * pyrun.swg
1095  *
1096  * This file contains the runtime support for Python modules
1097  * and includes code for managing global variables and pointer
1098  * type checking.
1099  *
1100  * ----------------------------------------------------------------------------- */
1101
1102 /* Common SWIG API */
1103
1104 /* for raw pointers */
1105 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1106 #define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1107 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1108 #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(ptr, type, flags)
1109 #define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty) 
1110 #define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
1111 #define swig_owntype                                    int
1112
1113 /* for raw packed data */
1114 #define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1115 #define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
1116
1117 /* for class or struct pointers */
1118 #define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
1119 #define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
1120
1121 /* for C or C++ function pointers */
1122 #define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1123 #define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(ptr, type, 0)
1124
1125 /* for C++ member pointers, ie, member methods */
1126 #define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1127 #define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
1128
1129
1130 /* Runtime API */
1131
1132 #define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule()
1133 #define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
1134 #define SWIG_NewClientData(obj)                         SwigPyClientData_New(obj)
1135
1136 #define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj                            
1137 #define SWIG_SetErrorMsg                                SWIG_Python_SetErrorMsg                            
1138 #define SWIG_ErrorType(code)                            SWIG_Python_ErrorType(code)                        
1139 #define SWIG_Error(code, msg)                           SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) 
1140 #define SWIG_fail                                       goto fail                                          
1141
1142
1143 /* Runtime API implementation */
1144
1145 /* Error manipulation */
1146
1147 SWIGINTERN void 
1148 SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1149   SWIG_PYTHON_THREAD_BEGIN_BLOCK; 
1150   PyErr_SetObject(errtype, obj);
1151   Py_DECREF(obj);
1152   SWIG_PYTHON_THREAD_END_BLOCK;
1153 }
1154
1155 SWIGINTERN void 
1156 SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1157   SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1158   PyErr_SetString(errtype, (char *) msg);
1159   SWIG_PYTHON_THREAD_END_BLOCK;
1160 }
1161
1162 #define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1163
1164 /* Set a constant value */
1165
1166 SWIGINTERN void
1167 SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {   
1168   PyDict_SetItemString(d, (char*) name, obj);
1169   Py_DECREF(obj);                            
1170 }
1171
1172 /* Append a value to the result obj */
1173
1174 SWIGINTERN PyObject*
1175 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1176 #if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
1177   if (!result) {
1178     result = obj;
1179   } else if (result == Py_None) {
1180     Py_DECREF(result);
1181     result = obj;
1182   } else {
1183     if (!PyList_Check(result)) {
1184       PyObject *o2 = result;
1185       result = PyList_New(1);
1186       PyList_SetItem(result, 0, o2);
1187     }
1188     PyList_Append(result,obj);
1189     Py_DECREF(obj);
1190   }
1191   return result;
1192 #else
1193   PyObject*   o2;
1194   PyObject*   o3;
1195   if (!result) {
1196     result = obj;
1197   } else if (result == Py_None) {
1198     Py_DECREF(result);
1199     result = obj;
1200   } else {
1201     if (!PyTuple_Check(result)) {
1202       o2 = result;
1203       result = PyTuple_New(1);
1204       PyTuple_SET_ITEM(result, 0, o2);
1205     }
1206     o3 = PyTuple_New(1);
1207     PyTuple_SET_ITEM(o3, 0, obj);
1208     o2 = result;
1209     result = PySequence_Concat(o2, o3);
1210     Py_DECREF(o2);
1211     Py_DECREF(o3);
1212   }
1213   return result;
1214 #endif
1215 }
1216
1217 /* Unpack the argument tuple */
1218
1219 SWIGINTERN int
1220 SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1221 {
1222   if (!args) {
1223     if (!min && !max) {
1224       return 1;
1225     } else {
1226       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", 
1227                    name, (min == max ? "" : "at least "), (int)min);
1228       return 0;
1229     }
1230   }  
1231   if (!PyTuple_Check(args)) {
1232     PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1233     return 0;
1234   } else {
1235     register Py_ssize_t l = PyTuple_GET_SIZE(args);
1236     if (l < min) {
1237       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
1238                    name, (min == max ? "" : "at least "), (int)min, (int)l);
1239       return 0;
1240     } else if (l > max) {
1241       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
1242                    name, (min == max ? "" : "at most "), (int)max, (int)l);
1243       return 0;
1244     } else {
1245       register int i;
1246       for (i = 0; i < l; ++i) {
1247         objs[i] = PyTuple_GET_ITEM(args, i);
1248       }
1249       for (; l < max; ++l) {
1250         objs[l] = 0;
1251       }
1252       return i + 1;
1253     }    
1254   }
1255 }
1256
1257 /* A functor is a function object with one single object argument */
1258 #if PY_VERSION_HEX >= 0x02020000
1259 #define SWIG_Python_CallFunctor(functor, obj)           PyObject_CallFunctionObjArgs(functor, obj, NULL);
1260 #else
1261 #define SWIG_Python_CallFunctor(functor, obj)           PyObject_CallFunction(functor, "O", obj);
1262 #endif
1263
1264 /*
1265   Helper for static pointer initialization for both C and C++ code, for example
1266   static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1267 */
1268 #ifdef __cplusplus
1269 #define SWIG_STATIC_POINTER(var)  var
1270 #else
1271 #define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
1272 #endif
1273
1274 /* -----------------------------------------------------------------------------
1275  * Pointer declarations
1276  * ----------------------------------------------------------------------------- */
1277
1278 /* Flags for new pointer objects */
1279 #define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
1280 #define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1281
1282 #define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
1283
1284 #ifdef __cplusplus
1285 extern "C" {
1286 #if 0
1287 } /* cc-mode */
1288 #endif
1289 #endif
1290
1291 /*  How to access Py_None */
1292 #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
1293 #  ifndef SWIG_PYTHON_NO_BUILD_NONE
1294 #    ifndef SWIG_PYTHON_BUILD_NONE
1295 #      define SWIG_PYTHON_BUILD_NONE
1296 #    endif
1297 #  endif
1298 #endif
1299
1300 #ifdef SWIG_PYTHON_BUILD_NONE
1301 #  ifdef Py_None
1302 #   undef Py_None
1303 #   define Py_None SWIG_Py_None()
1304 #  endif
1305 SWIGRUNTIMEINLINE PyObject * 
1306 _SWIG_Py_None(void)
1307 {
1308   PyObject *none = Py_BuildValue((char*)"");
1309   Py_DECREF(none);
1310   return none;
1311 }
1312 SWIGRUNTIME PyObject * 
1313 SWIG_Py_None(void)
1314 {
1315   static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
1316   return none;
1317 }
1318 #endif
1319
1320 /* The python void return value */
1321
1322 SWIGRUNTIMEINLINE PyObject * 
1323 SWIG_Py_Void(void)
1324 {
1325   PyObject *none = Py_None;
1326   Py_INCREF(none);
1327   return none;
1328 }
1329
1330 /* SwigPyClientData */
1331
1332 typedef struct {
1333   PyObject *klass;
1334   PyObject *newraw;
1335   PyObject *newargs;
1336   PyObject *destroy;
1337   int delargs;
1338   int implicitconv;
1339 } SwigPyClientData;
1340
1341 SWIGRUNTIMEINLINE int 
1342 SWIG_Python_CheckImplicit(swig_type_info *ty)
1343 {
1344   SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
1345   return data ? data->implicitconv : 0;
1346 }
1347
1348 SWIGRUNTIMEINLINE PyObject *
1349 SWIG_Python_ExceptionType(swig_type_info *desc) {
1350   SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1351   PyObject *klass = data ? data->klass : 0;
1352   return (klass ? klass : PyExc_RuntimeError);
1353 }
1354
1355
1356 SWIGRUNTIME SwigPyClientData * 
1357 SwigPyClientData_New(PyObject* obj)
1358 {
1359   if (!obj) {
1360     return 0;
1361   } else {
1362     SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
1363     /* the klass element */
1364     data->klass = obj;
1365     Py_INCREF(data->klass);
1366     /* the newraw method and newargs arguments used to create a new raw instance */
1367     if (PyClass_Check(obj)) {
1368       data->newraw = 0;
1369       data->newargs = obj;
1370       Py_INCREF(obj);
1371     } else {
1372 #if (PY_VERSION_HEX < 0x02020000)
1373       data->newraw = 0;
1374 #else
1375       data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
1376 #endif
1377       if (data->newraw) {
1378         Py_INCREF(data->newraw);
1379         data->newargs = PyTuple_New(1);
1380         PyTuple_SetItem(data->newargs, 0, obj);
1381       } else {
1382         data->newargs = obj;
1383       }
1384       Py_INCREF(data->newargs);
1385     }
1386     /* the destroy method, aka as the C++ delete method */
1387     data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
1388     if (PyErr_Occurred()) {
1389       PyErr_Clear();
1390       data->destroy = 0;
1391     }
1392     if (data->destroy) {
1393       int flags;
1394       Py_INCREF(data->destroy);
1395       flags = PyCFunction_GET_FLAGS(data->destroy);
1396 #ifdef METH_O
1397       data->delargs = !(flags & (METH_O));
1398 #else
1399       data->delargs = 0;
1400 #endif
1401     } else {
1402       data->delargs = 0;
1403     }
1404     data->implicitconv = 0;
1405     return data;
1406   }
1407 }
1408
1409 SWIGRUNTIME void 
1410 SwigPyClientData_Del(SwigPyClientData* data)
1411 {
1412   Py_XDECREF(data->newraw);
1413   Py_XDECREF(data->newargs);
1414   Py_XDECREF(data->destroy);
1415 }
1416
1417 /* =============== SwigPyObject =====================*/
1418
1419 typedef struct {
1420   PyObject_HEAD
1421   void *ptr;
1422   swig_type_info *ty;
1423   int own;
1424   PyObject *next;
1425 } SwigPyObject;
1426
1427 SWIGRUNTIME PyObject *
1428 SwigPyObject_long(SwigPyObject *v)
1429 {
1430   return PyLong_FromVoidPtr(v->ptr);
1431 }
1432
1433 SWIGRUNTIME PyObject *
1434 SwigPyObject_format(const char* fmt, SwigPyObject *v)
1435 {
1436   PyObject *res = NULL;
1437   PyObject *args = PyTuple_New(1);
1438   if (args) {
1439     if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1440       PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1441       if (ofmt) {
1442 #if PY_VERSION_HEX >= 0x03000000
1443         res = PyUnicode_Format(ofmt,args);
1444 #else
1445         res = PyString_Format(ofmt,args);
1446 #endif
1447         Py_DECREF(ofmt);
1448       }
1449       Py_DECREF(args);
1450     }
1451   }
1452   return res;
1453 }
1454
1455 SWIGRUNTIME PyObject *
1456 SwigPyObject_oct(SwigPyObject *v)
1457 {
1458   return SwigPyObject_format("%o",v);
1459 }
1460
1461 SWIGRUNTIME PyObject *
1462 SwigPyObject_hex(SwigPyObject *v)
1463 {
1464   return SwigPyObject_format("%x",v);
1465 }
1466
1467 SWIGRUNTIME PyObject *
1468 #ifdef METH_NOARGS
1469 SwigPyObject_repr(SwigPyObject *v)
1470 #else
1471 SwigPyObject_repr(SwigPyObject *v, PyObject *args)
1472 #endif
1473 {
1474   const char *name = SWIG_TypePrettyName(v->ty);
1475   PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, v);
1476   if (v->next) {
1477 #ifdef METH_NOARGS
1478     PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1479 #else
1480     PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
1481 #endif
1482 #if PY_VERSION_HEX >= 0x03000000
1483     PyObject *joined = PyUnicode_Concat(repr, nrep);
1484     Py_DecRef(repr);
1485     Py_DecRef(nrep);
1486     repr = joined;
1487 #else
1488     PyString_ConcatAndDel(&repr,nrep);
1489 #endif
1490   }
1491   return repr;  
1492 }
1493
1494 SWIGRUNTIME int
1495 SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
1496 {
1497   char *str;
1498 #ifdef METH_NOARGS
1499   PyObject *repr = SwigPyObject_repr(v);
1500 #else
1501   PyObject *repr = SwigPyObject_repr(v, NULL);
1502 #endif
1503   if (repr) {
1504     str = SWIG_Python_str_AsChar(repr); 
1505     fputs(str, fp);
1506     SWIG_Python_str_DelForPy3(str);
1507     Py_DECREF(repr);
1508     return 0; 
1509   } else {
1510     return 1; 
1511   }
1512 }
1513
1514 SWIGRUNTIME PyObject *
1515 SwigPyObject_str(SwigPyObject *v)
1516 {
1517   char result[SWIG_BUFFER_SIZE];
1518   return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
1519     SWIG_Python_str_FromChar(result) : 0;
1520 }
1521
1522 SWIGRUNTIME int
1523 SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1524 {
1525   void *i = v->ptr;
1526   void *j = w->ptr;
1527   return (i < j) ? -1 : ((i > j) ? 1 : 0);
1528 }
1529
1530 /* Added for Python 3.x, would it also be useful for Python 2.x? */
1531 SWIGRUNTIME PyObject*
1532 SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
1533 {
1534   PyObject* res;
1535   if( op != Py_EQ && op != Py_NE ) {
1536     Py_INCREF(Py_NotImplemented);
1537     return Py_NotImplemented;
1538   }
1539   if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) )
1540     res = Py_True;
1541   else
1542     res = Py_False;
1543   Py_INCREF(res);
1544   return res;  
1545 }
1546
1547
1548 SWIGRUNTIME PyTypeObject* _PySwigObject_type(void);
1549
1550 SWIGRUNTIME PyTypeObject*
1551 SwigPyObject_type(void) {
1552   static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type();
1553   return type;
1554 }
1555
1556 SWIGRUNTIMEINLINE int
1557 SwigPyObject_Check(PyObject *op) {
1558   return (Py_TYPE(op) == SwigPyObject_type())
1559     || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1560 }
1561
1562 SWIGRUNTIME PyObject *
1563 SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1564
1565 SWIGRUNTIME void
1566 SwigPyObject_dealloc(PyObject *v)
1567 {
1568   SwigPyObject *sobj = (SwigPyObject *) v;
1569   PyObject *next = sobj->next;
1570   if (sobj->own == SWIG_POINTER_OWN) {
1571     swig_type_info *ty = sobj->ty;
1572     SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1573     PyObject *destroy = data ? data->destroy : 0;
1574     if (destroy) {
1575       /* destroy is always a VARARGS method */
1576       PyObject *res;
1577       if (data->delargs) {
1578         /* we need to create a temporary object to carry the destroy operation */
1579         PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1580         res = SWIG_Python_CallFunctor(destroy, tmp);
1581         Py_DECREF(tmp);
1582       } else {
1583         PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1584         PyObject *mself = PyCFunction_GET_SELF(destroy);
1585         res = ((*meth)(mself, v));
1586       }
1587       Py_XDECREF(res);
1588     } 
1589 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1590     else {
1591       const char *name = SWIG_TypePrettyName(ty);
1592       printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1593     }
1594 #endif
1595   } 
1596   Py_XDECREF(next);
1597   PyObject_DEL(v);
1598 }
1599
1600 SWIGRUNTIME PyObject* 
1601 SwigPyObject_append(PyObject* v, PyObject* next)
1602 {
1603   SwigPyObject *sobj = (SwigPyObject *) v;
1604 #ifndef METH_O
1605   PyObject *tmp = 0;
1606   if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
1607   next = tmp;
1608 #endif
1609   if (!SwigPyObject_Check(next)) {
1610     return NULL;
1611   }
1612   sobj->next = next;
1613   Py_INCREF(next);
1614   return SWIG_Py_Void();
1615 }
1616
1617 SWIGRUNTIME PyObject* 
1618 #ifdef METH_NOARGS
1619 SwigPyObject_next(PyObject* v)
1620 #else
1621 SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1622 #endif
1623 {
1624   SwigPyObject *sobj = (SwigPyObject *) v;
1625   if (sobj->next) {    
1626     Py_INCREF(sobj->next);
1627     return sobj->next;
1628   } else {
1629     return SWIG_Py_Void();
1630   }
1631 }
1632
1633 SWIGINTERN PyObject*
1634 #ifdef METH_NOARGS
1635 SwigPyObject_disown(PyObject *v)
1636 #else
1637 SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1638 #endif
1639 {
1640   SwigPyObject *sobj = (SwigPyObject *)v;
1641   sobj->own = 0;
1642   return SWIG_Py_Void();
1643 }
1644
1645 SWIGINTERN PyObject*
1646 #ifdef METH_NOARGS
1647 SwigPyObject_acquire(PyObject *v)
1648 #else
1649 SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1650 #endif
1651 {
1652   SwigPyObject *sobj = (SwigPyObject *)v;
1653   sobj->own = SWIG_POINTER_OWN;
1654   return SWIG_Py_Void();
1655 }
1656
1657 SWIGINTERN PyObject*
1658 SwigPyObject_own(PyObject *v, PyObject *args)
1659 {
1660   PyObject *val = 0;
1661 #if (PY_VERSION_HEX < 0x02020000)
1662   if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
1663 #else
1664   if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) 
1665 #endif
1666     {
1667       return NULL;
1668     } 
1669   else
1670     {
1671       SwigPyObject *sobj = (SwigPyObject *)v;
1672       PyObject *obj = PyBool_FromLong(sobj->own);
1673       if (val) {
1674 #ifdef METH_NOARGS
1675         if (PyObject_IsTrue(val)) {
1676           SwigPyObject_acquire(v);
1677         } else {
1678           SwigPyObject_disown(v);
1679         }
1680 #else
1681         if (PyObject_IsTrue(val)) {
1682           SwigPyObject_acquire(v,args);
1683         } else {
1684           SwigPyObject_disown(v,args);
1685         }
1686 #endif
1687       } 
1688       return obj;
1689     }
1690 }
1691
1692 #ifdef METH_O
1693 static PyMethodDef
1694 swigobject_methods[] = {
1695   {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
1696   {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS,  (char *)"aquires ownership of the pointer"},
1697   {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1698   {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_O,       (char *)"appends another 'this' object"},
1699   {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
1700   {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
1701   {0, 0, 0, 0}  
1702 };
1703 #else
1704 static PyMethodDef
1705 swigobject_methods[] = {
1706   {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
1707   {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS,  (char *)"aquires ownership of the pointer"},
1708   {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
1709   {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
1710   {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
1711   {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
1712   {0, 0, 0, 0}  
1713 };
1714 #endif
1715
1716 #if PY_VERSION_HEX < 0x02020000
1717 SWIGINTERN PyObject *
1718 SwigPyObject_getattr(SwigPyObject *sobj,char *name)
1719 {
1720   return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
1721 }
1722 #endif
1723
1724 SWIGRUNTIME PyTypeObject*
1725 _PySwigObject_type(void) {
1726   static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1727   
1728   static PyNumberMethods SwigPyObject_as_number = {
1729     (binaryfunc)0, /*nb_add*/
1730     (binaryfunc)0, /*nb_subtract*/
1731     (binaryfunc)0, /*nb_multiply*/
1732     /* nb_divide removed in Python 3 */
1733 #if PY_VERSION_HEX < 0x03000000
1734     (binaryfunc)0, /*nb_divide*/
1735 #endif
1736     (binaryfunc)0, /*nb_remainder*/
1737     (binaryfunc)0, /*nb_divmod*/
1738     (ternaryfunc)0,/*nb_power*/
1739     (unaryfunc)0,  /*nb_negative*/
1740     (unaryfunc)0,  /*nb_positive*/
1741     (unaryfunc)0,  /*nb_absolute*/
1742     (inquiry)0,    /*nb_nonzero*/
1743     0,             /*nb_invert*/
1744     0,             /*nb_lshift*/
1745     0,             /*nb_rshift*/
1746     0,             /*nb_and*/
1747     0,             /*nb_xor*/
1748     0,             /*nb_or*/
1749 #if PY_VERSION_HEX < 0x03000000
1750     0,   /*nb_coerce*/
1751 #endif
1752     (unaryfunc)SwigPyObject_long, /*nb_int*/
1753 #if PY_VERSION_HEX < 0x03000000
1754     (unaryfunc)SwigPyObject_long, /*nb_long*/
1755 #else
1756     0, /*nb_reserved*/
1757 #endif
1758     (unaryfunc)0,                 /*nb_float*/
1759 #if PY_VERSION_HEX < 0x03000000
1760     (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
1761     (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
1762 #endif
1763 #if PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1764     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1765 #elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
1766     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1767 #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
1768     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
1769 #elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
1770     0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
1771 #endif
1772   };
1773
1774   static PyTypeObject swigpyobject_type;  
1775   static int type_init = 0;
1776   if (!type_init) {
1777     const PyTypeObject tmp
1778       = {
1779         /* PyObject header changed in Python 3 */
1780 #if PY_VERSION_HEX >= 0x03000000
1781         PyVarObject_HEAD_INIT(&PyType_Type, 0)
1782 #else    
1783         PyObject_HEAD_INIT(NULL)
1784         0,                                  /* ob_size */
1785 #endif
1786         (char *)"SwigPyObject",             /* tp_name */
1787         sizeof(SwigPyObject),               /* tp_basicsize */
1788         0,                                  /* tp_itemsize */
1789         (destructor)SwigPyObject_dealloc,   /* tp_dealloc */
1790         (printfunc)SwigPyObject_print,      /* tp_print */
1791 #if PY_VERSION_HEX < 0x02020000
1792         (getattrfunc)SwigPyObject_getattr,  /* tp_getattr */ 
1793 #else
1794         (getattrfunc)0,                     /* tp_getattr */ 
1795 #endif
1796         (setattrfunc)0,                     /* tp_setattr */ 
1797 #if PY_VERSION_HEX >= 0x03000000
1798     0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1799 #else
1800         (cmpfunc)SwigPyObject_compare,      /* tp_compare */
1801 #endif
1802         (reprfunc)SwigPyObject_repr,        /* tp_repr */    
1803         &SwigPyObject_as_number,            /* tp_as_number */
1804         0,                                  /* tp_as_sequence */
1805         0,                                  /* tp_as_mapping */
1806         (hashfunc)0,                        /* tp_hash */
1807         (ternaryfunc)0,                     /* tp_call */
1808         (reprfunc)SwigPyObject_str,         /* tp_str */
1809         PyObject_GenericGetAttr,            /* tp_getattro */
1810         0,                                  /* tp_setattro */
1811         0,                                  /* tp_as_buffer */
1812         Py_TPFLAGS_DEFAULT,                 /* tp_flags */
1813         swigobject_doc,                     /* tp_doc */        
1814         0,                                  /* tp_traverse */
1815         0,                                  /* tp_clear */
1816         (richcmpfunc)SwigPyObject_richcompare,           /* tp_richcompare */
1817         0,                                  /* tp_weaklistoffset */
1818 #if PY_VERSION_HEX >= 0x02020000
1819         0,                                  /* tp_iter */
1820         0,                                  /* tp_iternext */
1821         swigobject_methods,                 /* tp_methods */ 
1822         0,                                  /* tp_members */
1823         0,                                  /* tp_getset */             
1824         0,                                  /* tp_base */               
1825         0,                                  /* tp_dict */               
1826         0,                                  /* tp_descr_get */          
1827         0,                                  /* tp_descr_set */          
1828         0,                                  /* tp_dictoffset */         
1829         0,                                  /* tp_init */               
1830         0,                                  /* tp_alloc */              
1831         0,                                  /* tp_new */                
1832         0,                                  /* tp_free */          
1833         0,                                  /* tp_is_gc */  
1834         0,                                  /* tp_bases */   
1835         0,                                  /* tp_mro */
1836         0,                                  /* tp_cache */   
1837         0,                                  /* tp_subclasses */
1838         0,                                  /* tp_weaklist */
1839 #endif
1840 #if PY_VERSION_HEX >= 0x02030000
1841         0,                                  /* tp_del */
1842 #endif
1843 #ifdef COUNT_ALLOCS
1844         0,0,0,0                             /* tp_alloc -> tp_next */
1845 #endif
1846       };
1847     swigpyobject_type = tmp;
1848     /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
1849 #if PY_VERSION_HEX < 0x03000000
1850     swigpyobject_type.ob_type = &PyType_Type;
1851 #endif
1852     type_init = 1;
1853   }
1854   return &swigpyobject_type;
1855 }
1856
1857 SWIGRUNTIME PyObject *
1858 SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
1859 {
1860   SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
1861   if (sobj) {
1862     sobj->ptr  = ptr;
1863     sobj->ty   = ty;
1864     sobj->own  = own;
1865     sobj->next = 0;
1866   }
1867   return (PyObject *)sobj;
1868 }
1869
1870 /* -----------------------------------------------------------------------------
1871  * Implements a simple Swig Packed type, and use it instead of string
1872  * ----------------------------------------------------------------------------- */
1873
1874 typedef struct {
1875   PyObject_HEAD
1876   void *pack;
1877   swig_type_info *ty;
1878   size_t size;
1879 } SwigPyPacked;
1880
1881 SWIGRUNTIME int
1882 SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
1883 {
1884   char result[SWIG_BUFFER_SIZE];
1885   fputs("<Swig Packed ", fp); 
1886   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1887     fputs("at ", fp); 
1888     fputs(result, fp); 
1889   }
1890   fputs(v->ty->name,fp); 
1891   fputs(">", fp);
1892   return 0; 
1893 }
1894   
1895 SWIGRUNTIME PyObject *
1896 SwigPyPacked_repr(SwigPyPacked *v)
1897 {
1898   char result[SWIG_BUFFER_SIZE];
1899   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1900     return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
1901   } else {
1902     return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
1903   }  
1904 }
1905
1906 SWIGRUNTIME PyObject *
1907 SwigPyPacked_str(SwigPyPacked *v)
1908 {
1909   char result[SWIG_BUFFER_SIZE];
1910   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
1911     return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
1912   } else {
1913     return SWIG_Python_str_FromChar(v->ty->name);
1914   }  
1915 }
1916
1917 SWIGRUNTIME int
1918 SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
1919 {
1920   size_t i = v->size;
1921   size_t j = w->size;
1922   int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
1923   return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
1924 }
1925
1926 SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void);
1927
1928 SWIGRUNTIME PyTypeObject*
1929 SwigPyPacked_type(void) {
1930   static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type();
1931   return type;
1932 }
1933
1934 SWIGRUNTIMEINLINE int
1935 SwigPyPacked_Check(PyObject *op) {
1936   return ((op)->ob_type == _PySwigPacked_type()) 
1937     || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
1938 }
1939
1940 SWIGRUNTIME void
1941 SwigPyPacked_dealloc(PyObject *v)
1942 {
1943   if (SwigPyPacked_Check(v)) {
1944     SwigPyPacked *sobj = (SwigPyPacked *) v;
1945     free(sobj->pack);
1946   }
1947   PyObject_DEL(v);
1948 }
1949
1950 SWIGRUNTIME PyTypeObject*
1951 _PySwigPacked_type(void) {
1952   static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
1953   static PyTypeObject swigpypacked_type;
1954   static int type_init = 0;  
1955   if (!type_init) {
1956     const PyTypeObject tmp
1957       = {
1958     /* PyObject header changed in Python 3 */
1959 #if PY_VERSION_HEX>=0x03000000
1960     PyVarObject_HEAD_INIT(&PyType_Type, 0)
1961 #else
1962         PyObject_HEAD_INIT(NULL)
1963     0,                              /* ob_size */       
1964 #endif
1965         (char *)"SwigPyPacked",             /* tp_name */       
1966         sizeof(SwigPyPacked),               /* tp_basicsize */  
1967         0,                                  /* tp_itemsize */   
1968         (destructor)SwigPyPacked_dealloc,   /* tp_dealloc */    
1969         (printfunc)SwigPyPacked_print,      /* tp_print */      
1970         (getattrfunc)0,                     /* tp_getattr */    
1971         (setattrfunc)0,                     /* tp_setattr */    
1972 #if PY_VERSION_HEX>=0x03000000
1973     0, /* tp_reserved in 3.0.1 */
1974 #else
1975     (cmpfunc)SwigPyPacked_compare,          /* tp_compare */
1976 #endif
1977         (reprfunc)SwigPyPacked_repr,        /* tp_repr */
1978         0,                                  /* tp_as_number */
1979         0,                                  /* tp_as_sequence */
1980         0,                                  /* tp_as_mapping */
1981         (hashfunc)0,                        /* tp_hash */
1982         (ternaryfunc)0,                     /* tp_call */
1983         (reprfunc)SwigPyPacked_str,         /* tp_str */
1984         PyObject_GenericGetAttr,            /* tp_getattro */
1985         0,                                  /* tp_setattro */
1986         0,                                  /* tp_as_buffer */
1987         Py_TPFLAGS_DEFAULT,                 /* tp_flags */
1988         swigpacked_doc,                     /* tp_doc */
1989         0,                                  /* tp_traverse */
1990         0,                                  /* tp_clear */
1991         0,                                  /* tp_richcompare */
1992         0,                                  /* tp_weaklistoffset */
1993 #if PY_VERSION_HEX >= 0x02020000
1994         0,                                  /* tp_iter */
1995         0,                                  /* tp_iternext */
1996         0,                                  /* tp_methods */ 
1997         0,                                  /* tp_members */
1998         0,                                  /* tp_getset */             
1999         0,                                  /* tp_base */               
2000         0,                                  /* tp_dict */               
2001         0,                                  /* tp_descr_get */          
2002         0,                                  /* tp_descr_set */          
2003         0,                                  /* tp_dictoffset */         
2004         0,                                  /* tp_init */               
2005         0,                                  /* tp_alloc */              
2006         0,                                  /* tp_new */                
2007         0,                                  /* tp_free */          
2008         0,                                  /* tp_is_gc */  
2009         0,                                  /* tp_bases */   
2010         0,                                  /* tp_mro */
2011         0,                                  /* tp_cache */   
2012         0,                                  /* tp_subclasses */
2013         0,                                  /* tp_weaklist */
2014 #endif
2015 #if PY_VERSION_HEX >= 0x02030000
2016         0,                                  /* tp_del */
2017 #endif
2018 #ifdef COUNT_ALLOCS
2019         0,0,0,0                             /* tp_alloc -> tp_next */
2020 #endif
2021       };
2022     swigpypacked_type = tmp;
2023     /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */
2024 #if PY_VERSION_HEX < 0x03000000
2025     swigpypacked_type.ob_type = &PyType_Type;
2026 #endif
2027     type_init = 1;
2028   }
2029   return &swigpypacked_type;
2030 }
2031
2032 SWIGRUNTIME PyObject *
2033 SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
2034 {
2035   SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
2036   if (sobj) {
2037     void *pack = malloc(size);
2038     if (pack) {
2039       memcpy(pack, ptr, size);
2040       sobj->pack = pack;
2041       sobj->ty   = ty;
2042       sobj->size = size;
2043     } else {
2044       PyObject_DEL((PyObject *) sobj);
2045       sobj = 0;
2046     }
2047   }
2048   return (PyObject *) sobj;
2049 }
2050
2051 SWIGRUNTIME swig_type_info *
2052 SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
2053 {
2054   if (SwigPyPacked_Check(obj)) {
2055     SwigPyPacked *sobj = (SwigPyPacked *)obj;
2056     if (sobj->size != size) return 0;
2057     memcpy(ptr, sobj->pack, size);
2058     return sobj->ty;
2059   } else {
2060     return 0;
2061   }
2062 }
2063
2064 /* -----------------------------------------------------------------------------
2065  * pointers/data manipulation
2066  * ----------------------------------------------------------------------------- */
2067
2068 SWIGRUNTIMEINLINE PyObject *
2069 _SWIG_This(void)
2070 {
2071     return SWIG_Python_str_FromChar("this");
2072 }
2073
2074 SWIGRUNTIME PyObject *
2075 SWIG_This(void)
2076 {
2077   static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This();
2078   return swig_this;
2079 }
2080
2081 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
2082
2083 /* TODO: I don't know how to implement the fast getset in Python 3 right now */
2084 #if PY_VERSION_HEX>=0x03000000
2085 #define SWIG_PYTHON_SLOW_GETSET_THIS 
2086 #endif
2087
2088 SWIGRUNTIME SwigPyObject *
2089 SWIG_Python_GetSwigThis(PyObject *pyobj) 
2090 {
2091   if (SwigPyObject_Check(pyobj)) {
2092     return (SwigPyObject *) pyobj;
2093   } else {
2094     PyObject *obj = 0;
2095 #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
2096     if (PyInstance_Check(pyobj)) {
2097       obj = _PyInstance_Lookup(pyobj, SWIG_This());      
2098     } else {
2099       PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2100       if (dictptr != NULL) {
2101         PyObject *dict = *dictptr;
2102         obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2103       } else {
2104 #ifdef PyWeakref_CheckProxy
2105         if (PyWeakref_CheckProxy(pyobj)) {
2106           PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2107           return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2108         }
2109 #endif
2110         obj = PyObject_GetAttr(pyobj,SWIG_This());
2111         if (obj) {
2112           Py_DECREF(obj);
2113         } else {
2114           if (PyErr_Occurred()) PyErr_Clear();
2115           return 0;
2116         }
2117       }
2118     }
2119 #else
2120     obj = PyObject_GetAttr(pyobj,SWIG_This());
2121     if (obj) {
2122       Py_DECREF(obj);
2123     } else {
2124       if (PyErr_Occurred()) PyErr_Clear();
2125       return 0;
2126     }
2127 #endif
2128     if (obj && !SwigPyObject_Check(obj)) {
2129       /* a PyObject is called 'this', try to get the 'real this'
2130          SwigPyObject from it */ 
2131       return SWIG_Python_GetSwigThis(obj);
2132     }
2133     return (SwigPyObject *)obj;
2134   }
2135 }
2136
2137 /* Acquire a pointer value */
2138
2139 SWIGRUNTIME int
2140 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2141   if (own == SWIG_POINTER_OWN) {
2142     SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2143     if (sobj) {
2144       int oldown = sobj->own;
2145       sobj->own = own;
2146       return oldown;
2147     }
2148   }
2149   return 0;
2150 }
2151
2152 /* Convert a pointer value */
2153
2154 SWIGRUNTIME int
2155 SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2156   if (!obj) return SWIG_ERROR;
2157   if (obj == Py_None) {
2158     if (ptr) *ptr = 0;
2159     return SWIG_OK;
2160   } else {
2161     SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2162     if (own)
2163       *own = 0;
2164     while (sobj) {
2165       void *vptr = sobj->ptr;
2166       if (ty) {
2167         swig_type_info *to = sobj->ty;
2168         if (to == ty) {
2169           /* no type cast needed */
2170           if (ptr) *ptr = vptr;
2171           break;
2172         } else {
2173           swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2174           if (!tc) {
2175             sobj = (SwigPyObject *)sobj->next;
2176           } else {
2177             if (ptr) {
2178               int newmemory = 0;
2179               *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2180               if (newmemory == SWIG_CAST_NEW_MEMORY) {
2181                 assert(own);
2182                 if (own)
2183                   *own = *own | SWIG_CAST_NEW_MEMORY;
2184               }
2185             }
2186             break;
2187           }
2188         }
2189       } else {
2190         if (ptr) *ptr = vptr;
2191         break;
2192       }
2193     }
2194     if (sobj) {
2195       if (own)
2196         *own = *own | sobj->own;
2197       if (flags & SWIG_POINTER_DISOWN) {
2198         sobj->own = 0;
2199       }
2200       return SWIG_OK;
2201     } else {
2202       int res = SWIG_ERROR;
2203       if (flags & SWIG_POINTER_IMPLICIT_CONV) {
2204         SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2205         if (data && !data->implicitconv) {
2206           PyObject *klass = data->klass;
2207           if (klass) {
2208             PyObject *impconv;
2209             data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2210             impconv = SWIG_Python_CallFunctor(klass, obj);
2211             data->implicitconv = 0;
2212             if (PyErr_Occurred()) {
2213               PyErr_Clear();
2214               impconv = 0;
2215             }
2216             if (impconv) {
2217               SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2218               if (iobj) {
2219                 void *vptr;
2220                 res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2221                 if (SWIG_IsOK(res)) {
2222                   if (ptr) {
2223                     *ptr = vptr;
2224                     /* transfer the ownership to 'ptr' */
2225                     iobj->own = 0;
2226                     res = SWIG_AddCast(res);
2227                     res = SWIG_AddNewMask(res);
2228                   } else {
2229                     res = SWIG_AddCast(res);                
2230                   }
2231                 }
2232               }
2233               Py_DECREF(impconv);
2234             }
2235           }
2236         }
2237       }
2238       return res;
2239     }
2240   }
2241 }
2242
2243 /* Convert a function ptr value */
2244
2245 SWIGRUNTIME int
2246 SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2247   if (!PyCFunction_Check(obj)) {
2248     return SWIG_ConvertPtr(obj, ptr, ty, 0);
2249   } else {
2250     void *vptr = 0;
2251     
2252     /* here we get the method pointer for callbacks */
2253     const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2254     const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2255     if (desc)
2256       desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2257     if (!desc) 
2258       return SWIG_ERROR;
2259     if (ty) {
2260       swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
2261       if (tc) {
2262         int newmemory = 0;
2263         *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2264         assert(!newmemory); /* newmemory handling not yet implemented */
2265       } else {
2266         return SWIG_ERROR;
2267       }
2268     } else {
2269       *ptr = vptr;
2270     }
2271     return SWIG_OK;
2272   }
2273 }
2274
2275 /* Convert a packed value value */
2276
2277 SWIGRUNTIME int
2278 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2279   swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2280   if (!to) return SWIG_ERROR;
2281   if (ty) {
2282     if (to != ty) {
2283       /* check type cast? */
2284       swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2285       if (!tc) return SWIG_ERROR;
2286     }
2287   }
2288   return SWIG_OK;
2289 }  
2290
2291 /* -----------------------------------------------------------------------------
2292  * Create a new pointer object
2293  * ----------------------------------------------------------------------------- */
2294
2295 /*
2296   Create a new instance object, without calling __init__, and set the
2297   'this' attribute.
2298 */
2299
2300 SWIGRUNTIME PyObject* 
2301 SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
2302 {
2303 #if (PY_VERSION_HEX >= 0x02020000)
2304   PyObject *inst = 0;
2305   PyObject *newraw = data->newraw;
2306   if (newraw) {
2307     inst = PyObject_Call(newraw, data->newargs, NULL);
2308     if (inst) {
2309 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2310       PyObject **dictptr = _PyObject_GetDictPtr(inst);
2311       if (dictptr != NULL) {
2312         PyObject *dict = *dictptr;
2313         if (dict == NULL) {
2314           dict = PyDict_New();
2315           *dictptr = dict;
2316           PyDict_SetItem(dict, SWIG_This(), swig_this);
2317         }
2318       }
2319 #else
2320       PyObject *key = SWIG_This();
2321       PyObject_SetAttr(inst, key, swig_this);
2322 #endif
2323     }
2324   } else {
2325 #if PY_VERSION_HEX >= 0x03000000
2326     inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
2327     PyObject_SetAttr(inst, SWIG_This(), swig_this);
2328     Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2329 #else
2330     PyObject *dict = PyDict_New();
2331     PyDict_SetItem(dict, SWIG_This(), swig_this);
2332     inst = PyInstance_NewRaw(data->newargs, dict);
2333     Py_DECREF(dict);
2334 #endif
2335   }
2336   return inst;
2337 #else
2338 #if (PY_VERSION_HEX >= 0x02010000)
2339   PyObject *inst;
2340   PyObject *dict = PyDict_New();
2341   PyDict_SetItem(dict, SWIG_This(), swig_this);
2342   inst = PyInstance_NewRaw(data->newargs, dict);
2343   Py_DECREF(dict);
2344   return (PyObject *) inst;
2345 #else
2346   PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
2347   if (inst == NULL) {
2348     return NULL;
2349   }
2350   inst->in_class = (PyClassObject *)data->newargs;
2351   Py_INCREF(inst->in_class);
2352   inst->in_dict = PyDict_New();
2353   if (inst->in_dict == NULL) {
2354     Py_DECREF(inst);
2355     return NULL;
2356   }
2357 #ifdef Py_TPFLAGS_HAVE_WEAKREFS
2358   inst->in_weakreflist = NULL;
2359 #endif
2360 #ifdef Py_TPFLAGS_GC
2361   PyObject_GC_Init(inst);
2362 #endif
2363   PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
2364   return (PyObject *) inst;
2365 #endif
2366 #endif
2367 }
2368
2369 SWIGRUNTIME void
2370 SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2371 {
2372  PyObject *dict;
2373 #if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2374  PyObject **dictptr = _PyObject_GetDictPtr(inst);
2375  if (dictptr != NULL) {
2376    dict = *dictptr;
2377    if (dict == NULL) {
2378      dict = PyDict_New();
2379      *dictptr = dict;
2380    }
2381    PyDict_SetItem(dict, SWIG_This(), swig_this);
2382    return;
2383  }
2384 #endif
2385  dict = PyObject_GetAttrString(inst, (char*)"__dict__");
2386  PyDict_SetItem(dict, SWIG_This(), swig_this);
2387  Py_DECREF(dict);
2388
2389
2390
2391 SWIGINTERN PyObject *
2392 SWIG_Python_InitShadowInstance(PyObject *args) {
2393   PyObject *obj[2];
2394   if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) {
2395     return NULL;
2396   } else {
2397     SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2398     if (sthis) {
2399       SwigPyObject_append((PyObject*) sthis, obj[1]);
2400     } else {
2401       SWIG_Python_SetSwigThis(obj[0], obj[1]);
2402     }
2403     return SWIG_Py_Void();
2404   }
2405 }
2406
2407 /* Create a new pointer object */
2408
2409 SWIGRUNTIME PyObject *
2410 SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
2411   if (!ptr) {
2412     return SWIG_Py_Void();
2413   } else {
2414     int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2415     PyObject *robj = SwigPyObject_New(ptr, type, own);
2416     SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2417     if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2418       PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2419       if (inst) {
2420         Py_DECREF(robj);
2421         robj = inst;
2422       }
2423     }
2424     return robj;
2425   }
2426 }
2427
2428 /* Create a new packed object */
2429
2430 SWIGRUNTIMEINLINE PyObject *
2431 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2432   return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2433 }
2434
2435 /* -----------------------------------------------------------------------------*
2436  *  Get type list 
2437  * -----------------------------------------------------------------------------*/
2438
2439 #ifdef SWIG_LINK_RUNTIME
2440 void *SWIG_ReturnGlobalTypeList(void *);
2441 #endif
2442
2443 SWIGRUNTIME swig_module_info *
2444 SWIG_Python_GetModule(void) {
2445   static void *type_pointer = (void *)0;
2446   /* first check if module already created */
2447   if (!type_pointer) {
2448 #ifdef SWIG_LINK_RUNTIME
2449     type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2450 #else
2451     type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
2452                                     (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
2453     if (PyErr_Occurred()) {
2454       PyErr_Clear();
2455       type_pointer = (void *)0;
2456     }
2457 #endif
2458   }
2459   return (swig_module_info *) type_pointer;
2460 }
2461
2462 #if PY_MAJOR_VERSION < 2
2463 /* PyModule_AddObject function was introduced in Python 2.0.  The following function
2464    is copied out of Python/modsupport.c in python version 2.3.4 */
2465 SWIGINTERN int
2466 PyModule_AddObject(PyObject *m, char *name, PyObject *o)
2467 {
2468   PyObject *dict;
2469   if (!PyModule_Check(m)) {
2470     PyErr_SetString(PyExc_TypeError,
2471                     "PyModule_AddObject() needs module as first arg");
2472     return SWIG_ERROR;
2473   }
2474   if (!o) {
2475     PyErr_SetString(PyExc_TypeError,
2476                     "PyModule_AddObject() needs non-NULL value");
2477     return SWIG_ERROR;
2478   }
2479   
2480   dict = PyModule_GetDict(m);
2481   if (dict == NULL) {
2482     /* Internal error -- modules must have a dict! */
2483     PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
2484                  PyModule_GetName(m));
2485     return SWIG_ERROR;
2486   }
2487   if (PyDict_SetItemString(dict, name, o))
2488     return SWIG_ERROR;
2489   Py_DECREF(o);
2490   return SWIG_OK;
2491 }
2492 #endif
2493
2494 SWIGRUNTIME void
2495 SWIG_Python_DestroyModule(void *vptr)
2496 {
2497   swig_module_info *swig_module = (swig_module_info *) vptr;
2498   swig_type_info **types = swig_module->types;
2499   size_t i;
2500   for (i =0; i < swig_module->size; ++i) {
2501     swig_type_info *ty = types[i];
2502     if (ty->owndata) {
2503       SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
2504       if (data) SwigPyClientData_Del(data);
2505     }
2506   }
2507   Py_DECREF(SWIG_This());
2508 }
2509
2510 SWIGRUNTIME void
2511 SWIG_Python_SetModule(swig_module_info *swig_module) {
2512   static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
2513
2514 #if PY_VERSION_HEX >= 0x03000000
2515  /* Add a dummy module object into sys.modules */
2516   PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
2517 #else
2518   PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
2519                                    swig_empty_runtime_method_table);
2520 #endif
2521   PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
2522   if (pointer && module) {
2523     PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
2524   } else {
2525     Py_XDECREF(pointer);
2526   }
2527 }
2528
2529 /* The python cached type query */
2530 SWIGRUNTIME PyObject *
2531 SWIG_Python_TypeCache(void) {
2532   static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2533   return cache;
2534 }
2535
2536 SWIGRUNTIME swig_type_info *
2537 SWIG_Python_TypeQuery(const char *type)
2538 {
2539   PyObject *cache = SWIG_Python_TypeCache();
2540   PyObject *key = SWIG_Python_str_FromChar(type); 
2541   PyObject *obj = PyDict_GetItem(cache, key);
2542   swig_type_info *descriptor;
2543   if (obj) {
2544     descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
2545   } else {
2546     swig_module_info *swig_module = SWIG_Python_GetModule();
2547     descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2548     if (descriptor) {
2549       obj = PyCObject_FromVoidPtr(descriptor, NULL);
2550       PyDict_SetItem(cache, key, obj);
2551       Py_DECREF(obj);
2552     }
2553   }
2554   Py_DECREF(key);
2555   return descriptor;
2556 }
2557
2558 /* 
2559    For backward compatibility only
2560 */
2561 #define SWIG_POINTER_EXCEPTION  0
2562 #define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
2563 #define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
2564
2565 SWIGRUNTIME int
2566 SWIG_Python_AddErrMesg(const char* mesg, int infront)
2567 {  
2568   if (PyErr_Occurred()) {
2569     PyObject *type = 0;
2570     PyObject *value = 0;
2571     PyObject *traceback = 0;
2572     PyErr_Fetch(&type, &value, &traceback);
2573     if (value) {
2574       char *tmp;
2575       PyObject *old_str = PyObject_Str(value);
2576       Py_XINCREF(type);
2577       PyErr_Clear();
2578       if (infront) {
2579         PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
2580       } else {
2581         PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
2582       }
2583       SWIG_Python_str_DelForPy3(tmp);
2584       Py_DECREF(old_str);
2585     }
2586     return 1;
2587   } else {
2588     return 0;
2589   }
2590 }
2591   
2592 SWIGRUNTIME int
2593 SWIG_Python_ArgFail(int argnum)
2594 {
2595   if (PyErr_Occurred()) {
2596     /* add information about failing argument */
2597     char mesg[256];
2598     PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2599     return SWIG_Python_AddErrMesg(mesg, 1);
2600   } else {
2601     return 0;
2602   }
2603 }
2604
2605 SWIGRUNTIMEINLINE const char *
2606 SwigPyObject_GetDesc(PyObject *self)
2607 {
2608   SwigPyObject *v = (SwigPyObject *)self;
2609   swig_type_info *ty = v ? v->ty : 0;
2610   return ty ? ty->str : (char*)"";
2611 }
2612
2613 SWIGRUNTIME void
2614 SWIG_Python_TypeError(const char *type, PyObject *obj)
2615 {
2616   if (type) {
2617 #if defined(SWIG_COBJECT_TYPES)
2618     if (obj && SwigPyObject_Check(obj)) {
2619       const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2620       if (otype) {
2621         PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2622                      type, otype);
2623         return;
2624       }
2625     } else 
2626 #endif      
2627     {
2628       const char *otype = (obj ? obj->ob_type->tp_name : 0); 
2629       if (otype) {
2630         PyObject *str = PyObject_Str(obj);
2631         const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2632         if (cstr) {
2633           PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2634                        type, otype, cstr);
2635           SWIG_Python_str_DelForPy3(cstr);
2636         } else {
2637           PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2638                        type, otype);
2639         }
2640         Py_XDECREF(str);
2641         return;
2642       }
2643     }   
2644     PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2645   } else {
2646     PyErr_Format(PyExc_TypeError, "unexpected type is received");
2647   }
2648 }
2649
2650
2651 /* Convert a pointer value, signal an exception on a type mismatch */
2652 SWIGRUNTIME void *
2653 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
2654   void *result;
2655   if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2656     PyErr_Clear();
2657 #if SWIG_POINTER_EXCEPTION
2658     if (flags) {
2659       SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
2660       SWIG_Python_ArgFail(argnum);
2661     }
2662 #endif
2663   }
2664   return result;
2665 }
2666
2667
2668 #ifdef __cplusplus
2669 #if 0
2670 { /* cc-mode */
2671 #endif
2672 }
2673 #endif
2674
2675
2676
2677 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
2678
2679 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
2680
2681
2682
2683 /* define the PyAPI_FUNC macro if it doesn't exist, for example with Python
2684    version below 2.3... But not really tested... */
2685 #ifndef PyAPI_FUNC
2686 #       define PyAPI_FUNC(RTYPE) RTYPE
2687 #endif
2688
2689 /* remove the PyInt_AS_LONG if defined, as this cause problems on RedHat */
2690 #ifdef PyInt_AS_LONG
2691 #undef PyInt_AS_LONG
2692 #endif
2693
2694 /* wrapper to the better function PyInt_AsLong, removing problems
2695    with RedHat (I hope) */
2696 long PyInt_AS_LONG (PyObject *obj) {
2697     return PyInt_AsLong (obj);
2698 }
2699
2700 /* remove the PyFloat_AS_DOUBLE if defined, to prevent errors */
2701 #ifdef PyFloat_AS_DOUBLE
2702 #undef PyFloat_AS_DOUBLE
2703 #endif
2704
2705 /* wrapper to the better function PyFloat_AS_DOUBLE, to prevent errors */
2706 double PyFloat_AS_DOUBLE (PyObject *obj) {
2707     return PyFloat_AsDouble (obj);
2708 }
2709
2710
2711   #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 
2712
2713
2714 /* -------- TYPES TABLE (BEGIN) -------- */
2715
2716 #define SWIGTYPE_p_Cv32suf swig_types[0]
2717 #define SWIGTYPE_p_Cv64suf swig_types[1]
2718 #define SWIGTYPE_p_CvAttrList swig_types[2]
2719 #define SWIGTYPE_p_CvAvgComp swig_types[3]
2720 #define SWIGTYPE_p_CvBox2D swig_types[4]
2721 #define SWIGTYPE_p_CvCapture swig_types[5]
2722 #define SWIGTYPE_p_CvChain swig_types[6]
2723 #define SWIGTYPE_p_CvChainPtReader swig_types[7]
2724 #define SWIGTYPE_p_CvConDensation swig_types[8]
2725 #define SWIGTYPE_p_CvConnectedComp swig_types[9]
2726 #define SWIGTYPE_p_CvContour swig_types[10]
2727 #define SWIGTYPE_p_CvContourTree swig_types[11]
2728 #define SWIGTYPE_p_CvConvexityDefect swig_types[12]
2729 #define SWIGTYPE_p_CvFileNode swig_types[13]
2730 #define SWIGTYPE_p_CvFileStorage swig_types[14]
2731 #define SWIGTYPE_p_CvFilter swig_types[15]
2732 #define SWIGTYPE_p_CvFont swig_types[16]
2733 #define SWIGTYPE_p_CvGenericHash swig_types[17]
2734 #define SWIGTYPE_p_CvGraph swig_types[18]
2735 #define SWIGTYPE_p_CvGraphEdge swig_types[19]
2736 #define SWIGTYPE_p_CvGraphScanner swig_types[20]
2737 #define SWIGTYPE_p_CvGraphVtx swig_types[21]
2738 #define SWIGTYPE_p_CvGraphVtx2D swig_types[22]
2739 #define SWIGTYPE_p_CvHaarClassifier swig_types[23]
2740 #define SWIGTYPE_p_CvHaarClassifierCascade swig_types[24]
2741 #define SWIGTYPE_p_CvHaarFeature swig_types[25]
2742 #define SWIGTYPE_p_CvHaarStageClassifier swig_types[26]
2743 #define SWIGTYPE_p_CvHidHaarClassifierCascade swig_types[27]
2744 #define SWIGTYPE_p_CvHistogram swig_types[28]
2745 #define SWIGTYPE_p_CvHuMoments swig_types[29]
2746 #define SWIGTYPE_p_CvKalman swig_types[30]
2747 #define SWIGTYPE_p_CvLineIterator swig_types[31]
2748 #define SWIGTYPE_p_CvMSERParams swig_types[32]
2749 #define SWIGTYPE_p_CvMat swig_types[33]
2750 #define SWIGTYPE_p_CvMatND swig_types[34]
2751 #define SWIGTYPE_p_CvMatrix3 swig_types[35]
2752 #define SWIGTYPE_p_CvMemBlock swig_types[36]
2753 #define SWIGTYPE_p_CvMemStorage swig_types[37]
2754 #define SWIGTYPE_p_CvMemStoragePos swig_types[38]
2755 #define SWIGTYPE_p_CvModuleInfo swig_types[39]
2756 #define SWIGTYPE_p_CvMoments swig_types[40]
2757 #define SWIGTYPE_p_CvNArrayIterator swig_types[41]
2758 #define SWIGTYPE_p_CvNextEdgeType swig_types[42]
2759 #define SWIGTYPE_p_CvPOSITObject swig_types[43]
2760 #define SWIGTYPE_p_CvPluginFuncInfo swig_types[44]
2761 #define SWIGTYPE_p_CvPoint swig_types[45]
2762 #define SWIGTYPE_p_CvPoint2D32f swig_types[46]
2763 #define SWIGTYPE_p_CvPoint2D64f swig_types[47]
2764 #define SWIGTYPE_p_CvPoint3D32f swig_types[48]
2765 #define SWIGTYPE_p_CvPoint3D64f swig_types[49]
2766 #define SWIGTYPE_p_CvQuadEdge2D swig_types[50]
2767 #define SWIGTYPE_p_CvRNG_Wrapper swig_types[51]
2768 #define SWIGTYPE_p_CvRect swig_types[52]
2769 #define SWIGTYPE_p_CvSURFParams swig_types[53]
2770 #define SWIGTYPE_p_CvSURFPoint swig_types[54]
2771 #define SWIGTYPE_p_CvScalar swig_types[55]
2772 #define SWIGTYPE_p_CvSeq swig_types[56]
2773 #define SWIGTYPE_p_CvSeqBlock swig_types[57]
2774 #define SWIGTYPE_p_CvSeqReader swig_types[58]
2775 #define SWIGTYPE_p_CvSeqWriter swig_types[59]
2776 #define SWIGTYPE_p_CvSet swig_types[60]
2777 #define SWIGTYPE_p_CvSetElem swig_types[61]
2778 #define SWIGTYPE_p_CvSize swig_types[62]
2779 #define SWIGTYPE_p_CvSize2D32f swig_types[63]
2780 #define SWIGTYPE_p_CvSlice swig_types[64]
2781 #define SWIGTYPE_p_CvSparseMat swig_types[65]
2782 #define SWIGTYPE_p_CvSparseMatIterator swig_types[66]
2783 #define SWIGTYPE_p_CvSparseNode swig_types[67]
2784 #define SWIGTYPE_p_CvStarDetectorParams swig_types[68]
2785 #define SWIGTYPE_p_CvStarKeypoint swig_types[69]
2786 #define SWIGTYPE_p_CvStereoBMState swig_types[70]
2787 #define SWIGTYPE_p_CvStereoGCState swig_types[71]
2788 #define SWIGTYPE_p_CvString swig_types[72]
2789 #define SWIGTYPE_p_CvStringHashNode swig_types[73]
2790 #define SWIGTYPE_p_CvSubdiv2D swig_types[74]
2791 #define SWIGTYPE_p_CvSubdiv2DEdge_Wrapper swig_types[75]
2792 #define SWIGTYPE_p_CvSubdiv2DPoint swig_types[76]
2793 #define SWIGTYPE_p_CvSubdiv2DPointLocation swig_types[77]
2794 #define SWIGTYPE_p_CvTermCriteria swig_types[78]
2795 #define SWIGTYPE_p_CvTreeNodeIterator swig_types[79]
2796 #define SWIGTYPE_p_CvTypeInfo swig_types[80]
2797 #define SWIGTYPE_p_CvTypedSeqT_CvConnectedComp_t swig_types[81]
2798 #define SWIGTYPE_p_CvTypedSeqT_CvPoint2D32f_t swig_types[82]
2799 #define SWIGTYPE_p_CvTypedSeqT_CvPoint_t swig_types[83]
2800 #define SWIGTYPE_p_CvTypedSeqT_CvQuadEdge2D_t swig_types[84]
2801 #define SWIGTYPE_p_CvTypedSeqT_CvRect_t swig_types[85]
2802 #define SWIGTYPE_p_CvTypedSeqT_CvSeq_p_t swig_types[86]
2803 #define SWIGTYPE_p_CvTypedSeqT_CvTupleT_CvPoint_2_t_t swig_types[87]
2804 #define SWIGTYPE_p_CvTypedSeqT_CvTupleT_float_2_t_t swig_types[88]
2805 #define SWIGTYPE_p_CvTypedSeqT_CvTupleT_float_3_t_t swig_types[89]
2806 #define SWIGTYPE_p_CvVideoWriter swig_types[90]
2807 #define SWIGTYPE_p_CvvImage swig_types[91]
2808 #define SWIGTYPE_p__IplConvKernel swig_types[92]
2809 #define SWIGTYPE_p__IplConvKernelFP swig_types[93]
2810 #define SWIGTYPE_p__IplImage swig_types[94]
2811 #define SWIGTYPE_p__IplROI swig_types[95]
2812 #define SWIGTYPE_p__IplTileInfo swig_types[96]
2813 #define SWIGTYPE_p_allocator_type swig_types[97]
2814 #define SWIGTYPE_p_char swig_types[98]
2815 #define SWIGTYPE_p_difference_type swig_types[99]
2816 #define SWIGTYPE_p_f_int__void swig_types[100]
2817 #define SWIGTYPE_p_f_int_int_int_int_p_void__void swig_types[101]
2818 #define SWIGTYPE_p_f_int_p_void__void swig_types[102]
2819 #define SWIGTYPE_p_float swig_types[103]
2820 #define SWIGTYPE_p_int swig_types[104]
2821 #define SWIGTYPE_p_int64_t swig_types[105]
2822 #define SWIGTYPE_p_p_char swig_types[106]
2823 #define SWIGTYPE_p_signed_char swig_types[107]
2824 #define SWIGTYPE_p_size_t swig_types[108]
2825 #define SWIGTYPE_p_size_type swig_types[109]
2826 #define SWIGTYPE_p_uint64_t swig_types[110]
2827 #define SWIGTYPE_p_unsigned_char swig_types[111]
2828 #define SWIGTYPE_p_unsigned_short swig_types[112]
2829 #define SWIGTYPE_p_value_type swig_types[113]
2830 #define SWIGTYPE_p_void swig_types[114]
2831 static swig_type_info *swig_types[116];
2832 static swig_module_info swig_module = {swig_types, 115, 0, 0, 0, 0};
2833 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
2834 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
2835
2836 /* -------- TYPES TABLE (END) -------- */
2837
2838 #if (PY_VERSION_HEX <= 0x02000000)
2839 # if !defined(SWIG_PYTHON_CLASSIC)
2840 #  error "This python version requires swig to be run with the '-classic' option"
2841 # endif
2842 #endif
2843
2844 /*-----------------------------------------------
2845               @(target):= _highgui.so
2846   ------------------------------------------------*/
2847 #if PY_VERSION_HEX >= 0x03000000
2848 #  define SWIG_init    PyInit__highgui
2849
2850 #else
2851 #  define SWIG_init    init_highgui
2852
2853 #endif
2854 #define SWIG_name    "_highgui"
2855
2856 #define SWIGVERSION 0x010340 
2857 #define SWIG_VERSION SWIGVERSION
2858
2859
2860 #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) 
2861 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) 
2862
2863
2864 #include <stdexcept>
2865
2866
2867 namespace swig {
2868   class SwigPtr_PyObject {
2869   protected:
2870     PyObject *_obj;
2871
2872   public:
2873     SwigPtr_PyObject() :_obj(0)
2874     {
2875     }
2876
2877     SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
2878     {
2879       Py_XINCREF(_obj);      
2880     }
2881     
2882     SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
2883     {
2884       if (initial_ref) {
2885         Py_XINCREF(_obj);
2886       }
2887     }
2888     
2889     SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) 
2890     {
2891       Py_XINCREF(item._obj);
2892       Py_XDECREF(_obj);
2893       _obj = item._obj;
2894       return *this;      
2895     }
2896     
2897     ~SwigPtr_PyObject() 
2898     {
2899       Py_XDECREF(_obj);
2900     }
2901     
2902     operator PyObject *() const
2903     {
2904       return _obj;
2905     }
2906
2907     PyObject *operator->() const
2908     {
2909       return _obj;
2910     }
2911   };
2912 }
2913
2914
2915 namespace swig {
2916   struct SwigVar_PyObject : SwigPtr_PyObject {
2917     SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
2918     
2919     SwigVar_PyObject & operator = (PyObject* obj)
2920     {
2921       Py_XDECREF(_obj);
2922       _obj = obj;
2923       return *this;      
2924     }
2925   };
2926 }
2927
2928
2929         #include <cxtypes.h>
2930         #include <cv.h>
2931         #include <highgui.h>
2932         #include "pyhelpers.h"
2933         #include "pycvseq.hpp"
2934
2935
2936
2937 #include "pyhelpers.h"
2938
2939 static CvArr * PyObject_to_CvArr(PyObject * obj, bool * freearg);
2940
2941 // convert a python sequence/array/list object into a c-array
2942 #define PyObject_AsArrayImpl(func, ctype, ptype)                              \
2943   int func(PyObject * obj, ctype * array, int len){                         \
2944   void * mat_vptr=NULL;                                                     \
2945   void * im_vptr=NULL;                                                      \
2946   if(PyNumber_Check(obj)){                                                  \
2947     memset( array, 0, sizeof(ctype)*len );                                \
2948     array[0] = PyObject_As##ptype( obj );                                 \
2949   }                                                                         \
2950   else if(PyList_Check(obj) || PyTuple_Check(obj)){                         \
2951     int seqsize = PySequence_Size(obj);                                   \
2952     for(int i=0; i<len && i<seqsize; i++){                                \
2953       if(i<seqsize){                                                    \
2954               array[i] =  PyObject_As##ptype( PySequence_GetItem(obj, i) ); \
2955       }                                                                 \
2956       else{                                                             \
2957         array[i] = 0;                                                 \
2958       }                                                                 \
2959     }                                                                     \
2960   }                                                                         \
2961   else if( SWIG_ConvertPtr(obj, &mat_vptr, SWIGTYPE_p_CvMat, 0)!=-1 ||      \
2962            SWIG_ConvertPtr(obj, &im_vptr, SWIGTYPE_p__IplImage, 0)!=-1)     \
2963   {                                                                         \
2964     CvMat * mat = (CvMat *) mat_vptr;                                     \
2965     CvMat stub;                                                           \
2966     if(im_vptr) mat = cvGetMat(im_vptr, &stub);                           \
2967     if( mat->rows!=1 && mat->cols!=1 ){                                   \
2968       PyErr_SetString( PyExc_TypeError,                                 \
2969            "PyObject_As*Array: CvArr must be row or column vector" );   \
2970       return -1;                                                        \
2971     }                                                                     \
2972     if( mat->rows==1 && mat->cols==1 ){                                   \
2973       CvScalar val;                                                     \
2974       if( len!=CV_MAT_CN(mat->type) ){                                  \
2975         PyErr_SetString( PyExc_TypeError,                             \
2976         "PyObject_As*Array: CvArr channels != length" );              \
2977         return -1;                                                    \
2978       }                                                                 \
2979       val = cvGet1D(mat, 0);                                            \
2980       for(int i=0; i<len; i++){                                         \
2981         array[i] = (ctype) val.val[i];                                \
2982       }                                                                 \
2983     }                                                                     \
2984     else{                                                                 \
2985       mat = cvReshape(mat, &stub, -1, mat->rows*mat->cols);             \
2986       if( mat->rows != len ){                                           \
2987         PyErr_SetString( PyExc_TypeError,                             \
2988          "PyObject_As*Array: CvArr rows or cols must equal length" ); \
2989          return -1;                                                   \
2990       }                                                                 \
2991       for(int i=0; i<len; i++){                                         \
2992         CvScalar val = cvGet1D(mat, i);                               \
2993         array[i] = (ctype) val.val[0];                                \
2994       }                                                                 \
2995     }                                                                     \
2996   }                                                                         \
2997   else{                                                                     \
2998     PyErr_SetString( PyExc_TypeError,                                     \
2999         "PyObject_As*Array: Expected a number, sequence or CvArr" );  \
3000     return -1;                                                            \
3001   }                                                                         \
3002   return 0;                                                                 \
3003 }
3004
3005 PyObject_AsArrayImpl( PyObject_AsFloatArray, float, Double );
3006 PyObject_AsArrayImpl( PyObject_AsDoubleArray, double, Double );
3007 PyObject_AsArrayImpl( PyObject_AsLongArray, int, Long );
3008
3009 static CvPoint PyObject_to_CvPoint(PyObject * obj){
3010   CvPoint val;
3011   CvPoint *ptr;
3012   CvPoint2D32f * ptr2D32f;
3013   CvScalar * scalar;
3014
3015   if( SWIG_ConvertPtr(obj, (void**)&ptr, SWIGTYPE_p_CvPoint, 0) != -1) {
3016     return *ptr;
3017   }
3018   if( SWIG_ConvertPtr(obj, (void**)&ptr2D32f, SWIGTYPE_p_CvPoint2D32f, 0) != -1) {
3019     return cvPointFrom32f( *ptr2D32f );
3020   }
3021   if( SWIG_ConvertPtr(obj, (void**)&scalar, SWIGTYPE_p_CvScalar, 0) != -1) {
3022     return cvPointFrom32f(cvPoint2D32f( scalar->val[0], scalar->val[1] ));
3023   }
3024   if(PyObject_AsLongArray(obj, (int *) &val, 2) != -1){
3025     return val;
3026   }
3027
3028   PyErr_SetString( PyExc_TypeError, "could not convert to CvPoint");
3029   return cvPoint(0,0);
3030 }
3031
3032 static CvPoint2D32f PyObject_to_CvPoint2D32f(PyObject * obj){
3033     CvPoint2D32f val;
3034     CvPoint2D32f *ptr2D32f;
3035   CvPoint *ptr;
3036   CvScalar * scalar;
3037     if( SWIG_ConvertPtr(obj, (void**)&ptr2D32f, SWIGTYPE_p_CvPoint2D32f, 0) != -1) {
3038     return *ptr2D32f;
3039   }
3040   if( SWIG_ConvertPtr(obj, (void**)&ptr, SWIGTYPE_p_CvPoint, 0) != -1) {
3041     return cvPointTo32f(*ptr);
3042   }
3043   if( SWIG_ConvertPtr(obj, (void**)&scalar, SWIGTYPE_p_CvScalar, 0) != -1) {
3044     return cvPoint2D32f( scalar->val[0], scalar->val[1] );
3045   }
3046   if(PyObject_AsFloatArray(obj, (float *) &val, 2) != -1){
3047     return val;
3048   }
3049   PyErr_SetString(PyExc_TypeError, "could not convert to CvPoint2D32f");
3050   return cvPoint2D32f(0,0);
3051 }
3052
3053 /* Check if this object can be interpreted as a CvScalar */
3054 static bool CvScalar_Check(PyObject * obj){
3055   void * vptr;
3056     CvScalar val;
3057   return SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvScalar,     0 ) != -1 ||
3058          SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint2D32f, 0 ) != -1 ||
3059            SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint,      0 ) != -1 ||
3060          PyObject_AsDoubleArray(obj, val.val, 4) !=-1;
3061 }
3062
3063 static CvScalar PyObject_to_CvScalar(PyObject * obj){
3064   CvScalar val;
3065   CvScalar * ptr;
3066     CvPoint2D32f *ptr2D32f;
3067   CvPoint *pt_ptr;
3068   void * vptr;
3069   if( SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvScalar, 0 ) != -1)
3070   {
3071     ptr = (CvScalar *) vptr;
3072     return *ptr;
3073   }
3074   if( SWIG_ConvertPtr(obj, (void**)&ptr2D32f, SWIGTYPE_p_CvPoint2D32f, 0) != -1) {
3075         return cvScalar(ptr2D32f->x, ptr2D32f->y);
3076     }
3077     if( SWIG_ConvertPtr(obj, (void**)&pt_ptr, SWIGTYPE_p_CvPoint, 0) != -1) {
3078         return cvScalar(pt_ptr->x, pt_ptr->y);
3079     }
3080   if(PyObject_AsDoubleArray(obj, val.val, 4)!=-1){
3081     return val;
3082   }
3083   return cvScalar(-1,-1,-1,-1); 
3084 }
3085
3086 static int CvArr_Check( PyObject * obj )
3087 {
3088         void *ptr;
3089         if( obj == Py_None ||
3090             SWIG_IsOK( SWIG_ConvertPtr(obj, &ptr, SWIGTYPE_p_void,       0) ) ||
3091             SWIG_IsOK( SWIG_ConvertPtr(obj, &ptr, SWIGTYPE_p_CvMat,       0) ) ||
3092         SWIG_IsOK( SWIG_ConvertPtr(obj, &ptr, SWIGTYPE_p_CvSeq,       0) ) ||
3093         SWIG_IsOK( SWIG_ConvertPtr(obj, &ptr, SWIGTYPE_p_CvContour,   0) ) ||
3094         SWIG_IsOK( SWIG_ConvertPtr(obj, &ptr, SWIGTYPE_p_CvSparseMat, 0) ) ||
3095         SWIG_IsOK( SWIG_ConvertPtr(obj, &ptr, SWIGTYPE_p_CvMatND,     0) ) ||
3096         PyObject_HasAttrString(obj, "__array_interface__") ||
3097         PySequence_Check(obj) ) 
3098     { 
3099         return 1;
3100         }
3101     PyErr_Clear();
3102     return 0;
3103 }
3104
3105 /* if python sequence type, convert to CvMat or CvMatND */
3106 static CvArr * PyObject_to_CvArr (PyObject * obj, bool * freearg)
3107 {
3108   CvArr * cvarr = NULL;
3109   *freearg = false;
3110
3111   if ( obj == Py_None )
3112   {
3113     // Interpret None as NULL pointer 
3114     return NULL;
3115   }
3116   else if( SWIG_IsOK( SWIG_ConvertPtr(obj, (void **)& cvarr, SWIGTYPE_p_void,       0) ) ||
3117       SWIG_IsOK( SWIG_ConvertPtr (obj, (void** )& cvarr, SWIGTYPE_p_CvMat, 0) ) ||
3118       SWIG_IsOK( SWIG_ConvertPtr (obj, (void **)& cvarr, SWIGTYPE_p_CvSeq, 0) ) ||
3119       SWIG_IsOK( SWIG_ConvertPtr (obj, (void **)& cvarr, SWIGTYPE_p_CvContour, 0) ) ||
3120       SWIG_IsOK( SWIG_ConvertPtr (obj, (void **)& cvarr, SWIGTYPE_p_CvSparseMat, 0) ) ||
3121       SWIG_IsOK( SWIG_ConvertPtr (obj, (void **)& cvarr, SWIGTYPE_p_CvMatND, 0) ))
3122   {
3123     // we got a directly wrapped void * pointer, OpenCV array or sequence type
3124     return cvarr;
3125   }
3126   else if (PyObject_HasAttrString (obj, "__array_interface__"))
3127   {
3128     // if we didn't get our own datatype, let's see if it supports the array protocol
3129     // array protocol is great because we just have to create another header but can
3130     // use the original data without copying
3131     cvarr = PyArray_to_CvArr (obj);
3132     *freearg = (cvarr != NULL);
3133   }
3134   else if (PySequence_Check (obj))
3135   {
3136     // our next bet is a tuple or list of tuples or lists this has to be copied over, however
3137     cvarr = PySequence_to_CvArr (obj);
3138     *freearg = (cvarr != NULL);
3139   }
3140   else if (PyLong_Check (obj) && PyLong_AsLong (obj) == 0)
3141   {
3142     // Interpret a '0' integer as a NULL pointer
3143     * freearg = false;
3144     return NULL;
3145   }
3146   else 
3147   {
3148     // TODO, throw an error here
3149     return NULL;
3150   }
3151   
3152   return cvarr;
3153 }
3154
3155
3156 static int PyObject_GetElemType(PyObject * obj){
3157   void *vptr;
3158   if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint, 0) != -1) return CV_32SC2; 
3159   if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvSize, 0) != -1) return CV_32SC2;  
3160   if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvRect, 0) != -1) return CV_32SC4;  
3161   if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvSize2D32f, 0) != -1) return CV_32FC2; 
3162   if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint2D32f, 0) != -1) return CV_32FC2;  
3163   if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint3D32f, 0) != -1) return CV_32FC3;  
3164   if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint2D64f, 0) != -1) return CV_64FC2;  
3165   if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvPoint3D64f, 0) != -1) return CV_64FC3;  
3166   if(SWIG_ConvertPtr(obj, &vptr, SWIGTYPE_p_CvScalar, 0) != -1) return CV_64FC4;  
3167   if(PyTuple_Check(obj) || PyList_Check(obj)) return CV_MAKE_TYPE(CV_32F, PySequence_Size( obj ));
3168   if(PyLong_Check(obj)) return CV_32S;
3169   return CV_32F;
3170 }
3171
3172
3173
3174 // Wrapper class
3175 class CvRNG_Wrapper {
3176 private:
3177         CvRNG m_val;
3178 public:
3179         CvRNG_Wrapper( const CvRNG & val ) :
3180                 m_val(val)
3181         {
3182         }
3183         CvRNG * ptr() { return &m_val; }
3184         CvRNG & ref() { return m_val; }
3185         bool operator==(const CvRNG_Wrapper & x){
3186                 return m_val==x.m_val;
3187         }
3188         bool operator!=(const CvRNG_Wrapper & x){
3189                 return m_val!=x.m_val;
3190         }
3191 };
3192
3193
3194 SWIGINTERNINLINE PyObject*
3195   SWIG_From_bool  (bool value)
3196 {
3197   return PyBool_FromLong(value ? 1 : 0);
3198 }
3199
3200
3201 // Wrapper class
3202 class CvSubdiv2DEdge_Wrapper {
3203 private:
3204         CvSubdiv2DEdge m_val;
3205 public:
3206         CvSubdiv2DEdge_Wrapper( const CvSubdiv2DEdge & val ) :
3207                 m_val(val)
3208         {
3209         }
3210         CvSubdiv2DEdge * ptr() { return &m_val; }
3211         CvSubdiv2DEdge & ref() { return m_val; }
3212         bool operator==(const CvSubdiv2DEdge_Wrapper & x){
3213                 return m_val==x.m_val;
3214         }
3215         bool operator!=(const CvSubdiv2DEdge_Wrapper & x){
3216                 return m_val!=x.m_val;
3217         }
3218 };
3219
3220
3221 SWIGINTERN int
3222 SWIG_AsVal_double (PyObject *obj, double *val)
3223 {
3224   int res = SWIG_TypeError;
3225   if (PyFloat_Check(obj)) {
3226     if (val) *val = PyFloat_AsDouble(obj);
3227     return SWIG_OK;
3228   } else if (PyInt_Check(obj)) {
3229     if (val) *val = PyInt_AsLong(obj);
3230     return SWIG_OK;
3231   } else if (PyLong_Check(obj)) {
3232     double v = PyLong_AsDouble(obj);
3233     if (!PyErr_Occurred()) {
3234       if (val) *val = v;
3235       return SWIG_OK;
3236     } else {
3237       PyErr_Clear();
3238     }
3239   }
3240 #ifdef SWIG_PYTHON_CAST_MODE
3241   {
3242     int dispatch = 0;
3243     double d = PyFloat_AsDouble(obj);
3244     if (!PyErr_Occurred()) {
3245       if (val) *val = d;
3246       return SWIG_AddCast(SWIG_OK);
3247     } else {
3248       PyErr_Clear();
3249     }
3250     if (!dispatch) {
3251       long v = PyLong_AsLong(obj);
3252       if (!PyErr_Occurred()) {
3253         if (val) *val = v;
3254         return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
3255       } else {
3256         PyErr_Clear();
3257       }
3258     }
3259   }
3260 #endif
3261   return res;
3262 }
3263
3264
3265 #include <float.h>
3266
3267
3268 #include <math.h>
3269
3270
3271 SWIGINTERNINLINE int
3272 SWIG_CanCastAsInteger(double *d, double min, double max) {
3273   double x = *d;
3274   if ((min <= x && x <= max)) {
3275    double fx = floor(x);
3276    double cx = ceil(x);
3277    double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
3278    if ((errno == EDOM) || (errno == ERANGE)) {
3279      errno = 0;
3280    } else {
3281      double summ, reps, diff;
3282      if (rd < x) {
3283        diff = x - rd;
3284      } else if (rd > x) {
3285        diff = rd - x;
3286      } else {
3287        return 1;
3288      }
3289      summ = rd + x;
3290      reps = diff/summ;
3291      if (reps < 8*DBL_EPSILON) {
3292        *d = rd;
3293        return 1;
3294      }
3295    }
3296   }
3297   return 0;
3298 }
3299
3300
3301 SWIGINTERN int
3302 SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) 
3303 {
3304   if (PyInt_Check(obj)) {
3305     long v = PyInt_AsLong(obj);
3306     if (v >= 0) {
3307       if (val) *val = v;
3308       return SWIG_OK;
3309     } else {
3310       return SWIG_OverflowError;
3311     }
3312   } else if (PyLong_Check(obj)) {
3313     unsigned long v = PyLong_AsUnsignedLong(obj);
3314     if (!PyErr_Occurred()) {
3315       if (val) *val = v;
3316       return SWIG_OK;
3317     } else {
3318       PyErr_Clear();
3319     }
3320   }
3321 #ifdef SWIG_PYTHON_CAST_MODE
3322   {
3323     int dispatch = 0;
3324     unsigned long v = PyLong_AsUnsignedLong(obj);
3325     if (!PyErr_Occurred()) {
3326       if (val) *val = v;
3327       return SWIG_AddCast(SWIG_OK);
3328     } else {
3329       PyErr_Clear();
3330     }
3331     if (!dispatch) {
3332       double d;
3333       int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3334       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
3335         if (val) *val = (unsigned long)(d);
3336         return res;
3337       }
3338     }
3339   }
3340 #endif
3341   return SWIG_TypeError;
3342 }
3343
3344
3345 SWIGINTERNINLINE int
3346 SWIG_AsVal_size_t (PyObject * obj, size_t *val)
3347 {
3348   unsigned long v;
3349   int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
3350   if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
3351   return res;
3352 }
3353
3354
3355         /* This encapsulates the python callback and user_data for mouse callback */
3356         struct PyCvMouseCBData {
3357                 PyObject * py_func;
3358                 PyObject * user_data;
3359         };
3360         /* This encapsulates the python callback and user_data for mouse callback */
3361     /* C helper function which is responsible for calling
3362        the Python real trackbar callback function */
3363     static void icvPyOnMouse (int event, int x, int y,
3364                                          int flags, PyCvMouseCBData * param) {
3365
3366                 /* Must ensure this thread has a lock on the interpreter */
3367                 PyGILState_STATE state = PyGILState_Ensure();
3368
3369                 PyObject *result;
3370
3371                 /* the argument of the callback ready to be passed to Python code */
3372                 PyObject *arg1 = PyInt_FromLong (event);
3373                 PyObject *arg2 = PyInt_FromLong (x);
3374                 PyObject *arg3 = PyInt_FromLong (y);
3375                 PyObject *arg4 = PyInt_FromLong (flags);
3376                 PyObject *arg5 = param->user_data;  // assume this is already a PyObject
3377
3378                 /* build the tuple for calling the Python callback */
3379                 PyObject *arglist = Py_BuildValue ("(OOOOO)",
3380                                 arg1, arg2, arg3, arg4, arg5);
3381
3382                 /* call the Python callback */
3383                 result = PyEval_CallObject (param->py_func, arglist);
3384
3385                 /* Errors in Python callback get swallowed, so report them here */
3386                 if(!result){
3387                         PyErr_Print();
3388                         cvError( CV_StsInternal, "icvPyOnMouse", "", __FILE__, __LINE__);
3389                 }
3390
3391                 /* cleanup */
3392                 Py_XDECREF (result);
3393
3394                 /* Release Interpreter lock */
3395                 PyGILState_Release(state);
3396         }
3397
3398
3399         void cvSetMouseCallbackPy( const char* window_name, PyObject * on_mouse, PyObject * param=NULL ){
3400                 // TODO potential memory leak if mouse callback is redefined
3401                 PyCvMouseCBData * py_callback = new PyCvMouseCBData;
3402                 py_callback->py_func = on_mouse;
3403                 py_callback->user_data = param ? param : Py_None;
3404
3405         Py_XINCREF(py_callback->py_func);
3406         Py_XINCREF(py_callback->user_data);
3407             
3408                 cvSetMouseCallback( window_name, (CvMouseCallback) icvPyOnMouse, (void *) py_callback );
3409         }
3410
3411
3412 SWIGINTERN swig_type_info*
3413 SWIG_pchar_descriptor(void)
3414 {
3415   static int init = 0;
3416   static swig_type_info* info = 0;
3417   if (!init) {
3418     info = SWIG_TypeQuery("_p_char");
3419     init = 1;
3420   }
3421   return info;
3422 }
3423
3424
3425 SWIGINTERN int
3426 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
3427 {
3428 #if PY_VERSION_HEX>=0x03000000
3429   if (PyUnicode_Check(obj))
3430 #else  
3431   if (PyString_Check(obj))
3432 #endif
3433   {
3434     char *cstr; Py_ssize_t len;
3435 #if PY_VERSION_HEX>=0x03000000
3436     if (!alloc && cptr) {
3437         /* We can't allow converting without allocation, since the internal
3438            representation of string in Python 3 is UCS-2/UCS-4 but we require
3439            a UTF-8 representation.
3440            TODO(bhy) More detailed explanation */
3441         return SWIG_RuntimeError;
3442     }
3443     obj = PyUnicode_AsUTF8String(obj);
3444     PyBytes_AsStringAndSize(obj, &cstr, &len);
3445     if(alloc) *alloc = SWIG_NEWOBJ;
3446 #else
3447     PyString_AsStringAndSize(obj, &cstr, &len);
3448 #endif
3449     if (cptr) {
3450       if (alloc) {
3451         /* 
3452            In python the user should not be able to modify the inner
3453            string representation. To warranty that, if you define
3454            SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
3455            buffer is always returned.
3456
3457            The default behavior is just to return the pointer value,
3458            so, be careful.
3459         */ 
3460 #if defined(SWIG_PYTHON_SAFE_CSTRINGS)
3461         if (*alloc != SWIG_OLDOBJ) 
3462 #else
3463         if (*alloc == SWIG_NEWOBJ) 
3464 #endif
3465           {
3466             *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1)));
3467             *alloc = SWIG_NEWOBJ;
3468           }
3469         else {
3470           *cptr = cstr;
3471           *alloc = SWIG_OLDOBJ;
3472         }
3473       } else {
3474         #if PY_VERSION_HEX>=0x03000000
3475         assert(0); /* Should never reach here in Python 3 */
3476         #endif
3477         *cptr = SWIG_Python_str_AsChar(obj);
3478       }
3479     }
3480     if (psize) *psize = len + 1;
3481 #if PY_VERSION_HEX>=0x03000000
3482     Py_XDECREF(obj);
3483 #endif
3484     return SWIG_OK;
3485   } else {
3486     swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3487     if (pchar_descriptor) {
3488       void* vptr = 0;
3489       if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
3490         if (cptr) *cptr = (char *) vptr;
3491         if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
3492         if (alloc) *alloc = SWIG_OLDOBJ;
3493         return SWIG_OK;
3494       }
3495     }
3496   }
3497   return SWIG_TypeError;
3498 }
3499
3500
3501
3502
3503
3504         PyObject * cvWaitKeyPy(int delay=0){
3505                 // In order for the event processing thread to run a python callback
3506                 // it must acquire the global interpreter lock, but  cvWaitKey blocks, so
3507                 // this thread can never release the lock. So release it here.
3508                 PyThreadState * thread_state = PyEval_SaveThread();
3509                 int res = cvWaitKey(delay);
3510                 PyEval_RestoreThread( thread_state );
3511                 
3512                 char str[2]={(char)res,0};
3513                 if(res==-1){
3514                         return PyLong_FromLong(-1);
3515                 }
3516                 return PyString_FromString(str);
3517         }
3518
3519
3520 #include <limits.h>
3521 #if !defined(SWIG_NO_LLONG_MAX)
3522 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
3523 #   define LLONG_MAX __LONG_LONG_MAX__
3524 #   define LLONG_MIN (-LLONG_MAX - 1LL)
3525 #   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
3526 # endif
3527 #endif
3528
3529
3530 SWIGINTERN int
3531 SWIG_AsVal_long (PyObject *obj, long* val)
3532 {
3533   if (PyInt_Check(obj)) {
3534     if (val) *val = PyInt_AsLong(obj);
3535     return SWIG_OK;
3536   } else if (PyLong_Check(obj)) {
3537     long v = PyLong_AsLong(obj);
3538     if (!PyErr_Occurred()) {
3539       if (val) *val = v;
3540       return SWIG_OK;
3541     } else {
3542       PyErr_Clear();
3543     }
3544   }
3545 #ifdef SWIG_PYTHON_CAST_MODE
3546   {
3547     int dispatch = 0;
3548     long v = PyInt_AsLong(obj);
3549     if (!PyErr_Occurred()) {
3550       if (val) *val = v;
3551       return SWIG_AddCast(SWIG_OK);
3552     } else {
3553       PyErr_Clear();
3554     }
3555     if (!dispatch) {
3556       double d;
3557       int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3558       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
3559         if (val) *val = (long)(d);
3560         return res;
3561       }
3562     }
3563   }
3564 #endif
3565   return SWIG_TypeError;
3566 }
3567
3568
3569 SWIGINTERN int
3570 SWIG_AsVal_int (PyObject * obj, int *val)
3571 {
3572   long v;
3573   int res = SWIG_AsVal_long (obj, &v);
3574   if (SWIG_IsOK(res)) {
3575     if ((v < INT_MIN || v > INT_MAX)) {
3576       return SWIG_OverflowError;
3577     } else {
3578       if (val) *val = static_cast< int >(v);
3579     }
3580   }  
3581   return res;
3582 }
3583
3584
3585 #include "highgui.h"
3586
3587   
3588 namespace swig {
3589   struct stop_iteration {
3590   };
3591
3592   struct SwigPyIterator {
3593   private:
3594     SwigPtr_PyObject _seq;
3595
3596   protected:
3597     SwigPyIterator(PyObject *seq) : _seq(seq)
3598     {
3599     }
3600       
3601   public:
3602     virtual ~SwigPyIterator() {}
3603
3604     // Access iterator method, required by Python
3605     virtual PyObject *value() const = 0;
3606
3607     // Forward iterator method, required by Python
3608     virtual SwigPyIterator *incr(size_t n = 1) = 0;
3609     
3610     // Backward iterator method, very common in C++, but not required in Python
3611     virtual SwigPyIterator *decr(size_t /*n*/ = 1)
3612     {
3613       throw stop_iteration();
3614     }
3615
3616     // Random access iterator methods, but not required in Python
3617     virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const
3618     {
3619       throw std::invalid_argument("operation not supported");
3620     }
3621
3622     virtual bool equal (const SwigPyIterator &/*x*/) const
3623     {
3624       throw std::invalid_argument("operation not supported");
3625     }
3626     
3627     // C++ common/needed methods
3628     virtual SwigPyIterator *copy() const = 0;
3629
3630     PyObject *next()     
3631     {
3632       SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads       
3633       PyObject *obj = value();
3634       incr();       
3635       SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads
3636       return obj;     
3637     }
3638
3639     /* Make an alias for Python 3.x */
3640     PyObject *__next__()
3641     {
3642       return next();
3643     }
3644
3645     PyObject *previous()
3646     {
3647       SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads       
3648       decr();
3649       PyObject *obj = value();
3650       SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads       
3651       return obj;
3652     }
3653
3654     SwigPyIterator *advance(ptrdiff_t n)
3655     {
3656       return  (n > 0) ?  incr(n) : decr(-n);
3657     }
3658       
3659     bool operator == (const SwigPyIterator& x)  const
3660     {
3661       return equal(x);
3662     }
3663       
3664     bool operator != (const SwigPyIterator& x) const
3665     {
3666       return ! operator==(x);
3667     }
3668       
3669     SwigPyIterator& operator += (ptrdiff_t n)
3670     {
3671       return *advance(n);
3672     }
3673
3674     SwigPyIterator& operator -= (ptrdiff_t n)
3675     {
3676       return *advance(-n);
3677     }
3678       
3679     SwigPyIterator* operator + (ptrdiff_t n) const
3680     {
3681       return copy()->advance(n);
3682     }
3683
3684     SwigPyIterator* operator - (ptrdiff_t n) const
3685     {
3686       return copy()->advance(-n);
3687     }
3688       
3689     ptrdiff_t operator - (const SwigPyIterator& x) const
3690     {
3691       return x.distance(*this);
3692     }
3693       
3694     static swig_type_info* descriptor() {
3695       static int init = 0;
3696       static swig_type_info* desc = 0;
3697       if (!init) {
3698         desc = SWIG_TypeQuery("swig::SwigPyIterator *");
3699         init = 1;
3700       } 
3701       return desc;
3702     }    
3703   };
3704 }
3705
3706
3707 namespace swig {  
3708   template <class Type>
3709   struct noconst_traits {
3710     typedef Type noconst_type;
3711   };
3712
3713   template <class Type>
3714   struct noconst_traits<const Type> {
3715     typedef Type noconst_type;
3716   };
3717
3718   /*
3719     type categories
3720   */
3721   struct pointer_category { };  
3722   struct value_category { };
3723
3724   /*
3725     General traits that provides type_name and type_info
3726   */
3727   template <class Type> struct traits { };
3728
3729   template <class Type>
3730   inline const char* type_name() {
3731     return traits<typename noconst_traits<Type >::noconst_type >::type_name();
3732   }
3733
3734   template <class Type> 
3735   struct traits_info {
3736     static swig_type_info *type_query(std::string name) {
3737       name += " *";
3738       return SWIG_TypeQuery(name.c_str());
3739     }    
3740     static swig_type_info *type_info() {
3741       static swig_type_info *info = type_query(type_name<Type>());
3742       return info;
3743     }
3744   };
3745
3746   template <class Type>
3747   inline swig_type_info *type_info() {
3748     return traits_info<Type>::type_info();
3749   }
3750
3751   /*
3752     Partial specialization for pointers
3753   */
3754   template <class Type> struct traits <Type *> {
3755     typedef pointer_category category;
3756     static std::string make_ptr_name(const char* name) {
3757       std::string ptrname = name;
3758       ptrname += " *";
3759       return ptrname;
3760     }    
3761     static const char* type_name() {
3762       static std::string name = make_ptr_name(swig::type_name<Type>());
3763       return name.c_str();
3764     }
3765   };
3766
3767   template <class Type, class Category> 
3768   struct traits_as { };
3769  
3770   template <class Type, class Category> 
3771   struct traits_check { };
3772
3773 }
3774
3775
3776 namespace swig {  
3777   /*
3778     Traits that provides the from method
3779   */
3780   template <class Type> struct traits_from_ptr {
3781     static PyObject *from(Type *val, int owner = 0) {
3782       return SWIG_NewPointerObj(val, type_info<Type>(), owner);
3783     }
3784   };
3785
3786   template <class Type> struct traits_from {
3787     static PyObject *from(const Type& val) {
3788       return traits_from_ptr<Type>::from(new Type(val), 1);
3789     }
3790   };
3791
3792   template <class Type> struct traits_from<Type *> {
3793     static PyObject *from(Type* val) {
3794       return traits_from_ptr<Type>::from(val, 0);
3795     }
3796   };
3797
3798   template <class Type> struct traits_from<const Type *> {
3799     static PyObject *from(const Type* val) {
3800       return traits_from_ptr<Type>::from(const_cast<Type*>(val), 0);
3801     }
3802   };
3803
3804
3805   template <class Type>
3806   inline PyObject *from(const Type& val) {
3807     return traits_from<Type>::from(val);
3808   }
3809
3810   template <class Type>
3811   inline PyObject *from_ptr(Type* val, int owner) {
3812     return traits_from_ptr<Type>::from(val, owner);
3813   }
3814
3815   /*
3816     Traits that provides the asval/as/check method
3817   */
3818   template <class Type>
3819   struct traits_asptr {   
3820     static int asptr(PyObject *obj, Type **val) {
3821       Type *p;
3822       int res = SWIG_ConvertPtr(obj, (void**)&p, type_info<Type>(), 0);
3823       if (SWIG_IsOK(res)) {
3824         if (val) *val = p;
3825       }
3826       return res;
3827     }
3828   }; 
3829
3830   template <class Type>
3831   inline int asptr(PyObject *obj, Type **vptr) {
3832     return traits_asptr<Type>::asptr(obj, vptr);
3833   }
3834
3835   template <class Type> 
3836   struct traits_asval {
3837     static int asval(PyObject *obj, Type *val) {
3838       if (val) {
3839         Type *p = 0;
3840         int res = traits_asptr<Type>::asptr(obj, &p);
3841         if (!SWIG_IsOK(res)) return res;        
3842         if (p) {
3843           typedef typename noconst_traits<Type>::noconst_type noconst_type;
3844           *(const_cast<noconst_type*>(val)) = *p;
3845           if (SWIG_IsNewObj(res)){
3846             delete p;
3847             res = SWIG_DelNewMask(res);
3848           }
3849           return res;
3850         } else {
3851           return SWIG_ERROR;
3852         }
3853       } else {
3854         return traits_asptr<Type>::asptr(obj, (Type **)(0));
3855       }
3856     }
3857   };
3858
3859   template <class Type> struct traits_asval<Type*> {
3860     static int asval(PyObject *obj, Type **val) {
3861       if (val) {
3862         typedef typename noconst_traits<Type>::noconst_type noconst_type;
3863         noconst_type *p = 0;
3864         int res = traits_asptr<noconst_type>::asptr(obj,  &p);
3865         if (SWIG_IsOK(res)) {
3866           *(const_cast<noconst_type**>(val)) = p;
3867         }
3868         return res;
3869       } else {
3870         return traits_asptr<Type>::asptr(obj, (Type **)(0));
3871       }
3872     }
3873   };
3874   
3875   template <class Type>
3876   inline int asval(PyObject *obj, Type *val) {
3877     return traits_asval<Type>::asval(obj, val);
3878   }
3879
3880   template <class Type> 
3881   struct traits_as<Type, value_category> {
3882     static Type as(PyObject *obj, bool throw_error) {
3883       Type v;
3884       int res = asval(obj, &v);
3885       if (!obj || !SWIG_IsOK(res)) {
3886         if (!PyErr_Occurred()) {
3887           ::SWIG_Error(SWIG_TypeError,  swig::type_name<Type>());
3888         }
3889         if (throw_error) throw std::invalid_argument("bad type");
3890       }
3891       return v;
3892     }
3893   };
3894
3895   template <class Type> 
3896   struct traits_as<Type, pointer_category> {
3897     static Type as(PyObject *obj, bool throw_error) {
3898       Type *v = 0;      
3899       int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR);
3900       if (SWIG_IsOK(res) && v) {
3901         if (SWIG_IsNewObj(res)) {
3902           Type r(*v);
3903           delete v;
3904           return r;
3905         } else {
3906           return *v;
3907         }
3908       } else {
3909         // Uninitialized return value, no Type() constructor required.
3910         static Type *v_def = (Type*) malloc(sizeof(Type));
3911         if (!PyErr_Occurred()) {
3912           SWIG_Error(SWIG_TypeError,  swig::type_name<Type>());
3913         }
3914         if (throw_error) throw std::invalid_argument("bad type");
3915         memset(v_def,0,sizeof(Type));
3916         return *v_def;
3917       }
3918     }
3919   };
3920
3921   template <class Type> 
3922   struct traits_as<Type*, pointer_category> {
3923     static Type* as(PyObject *obj, bool throw_error) {
3924       Type *v = 0;      
3925       int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR);
3926       if (SWIG_IsOK(res)) {
3927         return v;
3928       } else {
3929         if (!PyErr_Occurred()) {
3930           SWIG_Error(SWIG_TypeError,  swig::type_name<Type>());
3931         }
3932         if (throw_error) throw std::invalid_argument("bad type");
3933         return 0;
3934       }
3935     }
3936   };
3937     
3938   template <class Type>
3939   inline Type as(PyObject *obj, bool te = false) {
3940     return traits_as<Type, typename traits<Type>::category>::as(obj, te);
3941   }
3942
3943   template <class Type> 
3944   struct traits_check<Type, value_category> {
3945     static bool check(PyObject *obj) {
3946       int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR;
3947       return SWIG_IsOK(res) ? true : false;
3948     }
3949   };
3950
3951   template <class Type> 
3952   struct traits_check<Type, pointer_category> {
3953     static bool check(PyObject *obj) {
3954       int res = obj ? asptr(obj, (Type **)(0)) : SWIG_ERROR;
3955       return SWIG_IsOK(res) ? true : false;
3956     }
3957   };
3958
3959   template <class Type>
3960   inline bool check(PyObject *obj) {
3961     return traits_check<Type, typename traits<Type>::category>::check(obj);
3962   }
3963 }
3964
3965
3966 #include <functional>
3967
3968 namespace std {
3969   template <>
3970   struct less <PyObject *>: public binary_function<PyObject *, PyObject *, bool>
3971   {
3972     bool
3973     operator()(PyObject * v, PyObject *w) const
3974     { 
3975       bool res;
3976       SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3977       res = PyObject_RichCompareBool(v, w, Py_LT) ? true : false;
3978       /* This may fall into a case of inconsistent
3979                eg. ObjA > ObjX > ObjB
3980                but ObjA < ObjB
3981       */
3982       if( PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_TypeError) )
3983       {
3984         /* Objects can't be compared, this mostly occurred in Python 3.0 */
3985         /* Compare their ptr directly for a workaround */
3986         res = (v < w);
3987         PyErr_Clear();
3988       }
3989       SWIG_PYTHON_THREAD_END_BLOCK;
3990       return res;
3991     }
3992   };
3993
3994   template <>
3995   struct less <swig::SwigPtr_PyObject>: public binary_function<swig::SwigPtr_PyObject, swig::SwigPtr_PyObject, bool>
3996   {
3997     bool
3998     operator()(const swig::SwigPtr_PyObject& v, const swig::SwigPtr_PyObject& w) const
3999     {
4000       return std::less<PyObject *>()(v, w);
4001     }
4002   };
4003
4004   template <>
4005   struct less <swig::SwigVar_PyObject>: public binary_function<swig::SwigVar_PyObject, swig::SwigVar_PyObject, bool>
4006   {
4007     bool
4008     operator()(const swig::SwigVar_PyObject& v, const swig::SwigVar_PyObject& w) const
4009     {
4010       return std::less<PyObject *>()(v, w);
4011     }
4012   };
4013
4014 }
4015
4016 namespace swig {
4017   template <> struct traits<PyObject *> {
4018     typedef value_category category;
4019     static const char* type_name() { return "PyObject *"; }
4020   };  
4021
4022   template <>  struct traits_asval<PyObject * > {   
4023     typedef PyObject * value_type;
4024     static int asval(PyObject *obj, value_type *val) {
4025       if (val) *val = obj;
4026       return SWIG_OK;
4027     }
4028   };
4029
4030   template <> 
4031   struct traits_check<PyObject *, value_category> {
4032     static bool check(PyObject *) {
4033       return true;
4034     }
4035   };
4036
4037   template <>  struct traits_from<PyObject *> {
4038     typedef PyObject * value_type;
4039     static PyObject *from(const value_type& val) {
4040       Py_XINCREF(val);
4041       return val;
4042     }
4043   };
4044   
4045 }
4046
4047 namespace swig {
4048   inline size_t
4049   check_index(ptrdiff_t i, size_t size, bool insert = false) {
4050     if ( i < 0 ) {
4051       if ((size_t) (-i) <= size)
4052         return (size_t) (i + size);
4053     } else if ( (size_t) i < size ) {
4054       return (size_t) i;
4055     } else if (insert && ((size_t) i == size)) {
4056       return size;
4057     }
4058     
4059     throw std::out_of_range("index out of range");
4060   }
4061
4062   inline size_t
4063   slice_index(ptrdiff_t i, size_t size) {
4064     if ( i < 0 ) {
4065       if ((size_t) (-i) <= size) {
4066         return (size_t) (i + size);
4067       } else {
4068         throw std::out_of_range("index out of range");
4069       }
4070     } else {
4071       return ( (size_t) i < size ) ? ((size_t) i) : size;
4072     }
4073   }
4074
4075   template <class Sequence, class Difference>
4076   inline typename Sequence::iterator
4077   getpos(Sequence* self, Difference i)  {
4078     typename Sequence::iterator pos = self->begin();
4079     std::advance(pos, check_index(i,self->size()));
4080     return pos;
4081   }
4082
4083   template <class Sequence, class Difference>
4084   inline typename Sequence::const_iterator
4085   cgetpos(const Sequence* self, Difference i)  {
4086     typename Sequence::const_iterator pos = self->begin();
4087     std::advance(pos, check_index(i,self->size()));
4088     return pos;
4089   }
4090
4091   template <class Sequence, class Difference>
4092   inline Sequence*
4093   getslice(const Sequence* self, Difference i, Difference j) {
4094     typename Sequence::size_type size = self->size();
4095     typename Sequence::size_type ii = swig::check_index(i, size);
4096     typename Sequence::size_type jj = swig::slice_index(j, size);
4097
4098     if (jj > ii) {
4099       typename Sequence::const_iterator vb = self->begin();
4100       typename Sequence::const_iterator ve = self->begin();
4101       std::advance(vb,ii);
4102       std::advance(ve,jj);
4103       return new Sequence(vb, ve);
4104     } else {
4105       return new Sequence();
4106     }
4107   }
4108
4109   template <class Sequence, class Difference, class InputSeq>
4110   inline void
4111   setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) {
4112     typename Sequence::size_type size = self->size();
4113     typename Sequence::size_type ii = swig::check_index(i, size, true);
4114     typename Sequence::size_type jj = swig::slice_index(j, size);
4115     if (jj < ii) jj = ii;
4116     size_t ssize = jj - ii;
4117     if (ssize <= v.size()) {
4118       typename Sequence::iterator sb = self->begin();
4119       typename InputSeq::const_iterator vmid = v.begin();
4120       std::advance(sb,ii);
4121       std::advance(vmid, jj - ii);
4122       self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end());
4123     } else {
4124       typename Sequence::iterator sb = self->begin();
4125       typename Sequence::iterator se = self->begin();
4126       std::advance(sb,ii);
4127       std::advance(se,jj);
4128       self->erase(sb,se);
4129       self->insert(sb, v.begin(), v.end());
4130     }
4131   }
4132
4133   template <class Sequence, class Difference>
4134   inline void
4135   delslice(Sequence* self, Difference i, Difference j) {
4136     typename Sequence::size_type size = self->size();
4137     typename Sequence::size_type ii = swig::check_index(i, size, true);
4138     typename Sequence::size_type jj = swig::slice_index(j, size);
4139     if (jj > ii) {
4140       typename Sequence::iterator sb = self->begin();
4141       typename Sequence::iterator se = self->begin();
4142       std::advance(sb,ii);
4143       std::advance(se,jj);
4144       self->erase(sb,se);
4145     }
4146   }
4147 }
4148
4149
4150 #if defined(__SUNPRO_CC) && defined(_RWSTD_VER)
4151 #  if !defined(SWIG_NO_STD_NOITERATOR_TRAITS_STL)
4152 #    define SWIG_STD_NOITERATOR_TRAITS_STL
4153 #  endif
4154 #endif
4155
4156 #if !defined(SWIG_STD_NOITERATOR_TRAITS_STL)
4157 #include <iterator>
4158 #else
4159 namespace std {
4160   template <class Iterator>
4161   struct iterator_traits {
4162     typedef ptrdiff_t difference_type;
4163     typedef typename Iterator::value_type value_type;
4164   };
4165
4166   template <class Iterator, class Category,class T, class Reference, class Pointer, class Distance>
4167   struct iterator_traits<__reverse_bi_iterator<Iterator,Category,T,Reference,Pointer,Distance> > {
4168     typedef Distance difference_type;
4169     typedef T value_type;
4170   };
4171
4172   template <class T>
4173   struct iterator_traits<T*> {
4174     typedef T value_type;
4175     typedef ptrdiff_t difference_type;
4176   };
4177
4178   template<typename _InputIterator>
4179   inline typename iterator_traits<_InputIterator>::difference_type
4180   distance(_InputIterator __first, _InputIterator __last)
4181   {
4182     typename iterator_traits<_InputIterator>::difference_type __n = 0;
4183     while (__first != __last) {
4184       ++__first; ++__n;
4185     }
4186     return __n;
4187   }
4188 }
4189 #endif
4190
4191
4192 namespace swig {
4193   template<typename OutIterator>
4194   class SwigPyIterator_T :  public SwigPyIterator
4195   {
4196   public:
4197     typedef OutIterator out_iterator;
4198     typedef typename std::iterator_traits<out_iterator>::value_type value_type;    
4199     typedef SwigPyIterator_T<out_iterator> self_type;
4200
4201     SwigPyIterator_T(out_iterator curr, PyObject *seq)
4202       : SwigPyIterator(seq), current(curr)
4203     {
4204     }
4205
4206     const out_iterator& get_current() const
4207     {
4208       return current;
4209     }
4210
4211     
4212     bool equal (const SwigPyIterator &iter) const
4213     {
4214       const self_type *iters = dynamic_cast<const self_type *>(&iter);
4215       if (iters) {
4216         return (current == iters->get_current());
4217       } else {
4218         throw std::invalid_argument("bad iterator type");
4219       }
4220     }
4221     
4222     ptrdiff_t distance(const SwigPyIterator &iter) const
4223     {
4224       const self_type *iters = dynamic_cast<const self_type *>(&iter);
4225       if (iters) {
4226         return std::distance(current, iters->get_current());
4227       } else {
4228         throw std::invalid_argument("bad iterator type");
4229       }
4230     }    
4231     
4232   protected:
4233     out_iterator current;
4234   };
4235   
4236   template <class ValueType>
4237   struct from_oper 
4238   {
4239     typedef const ValueType& argument_type;
4240     typedef PyObject *result_type;
4241     result_type operator()(argument_type v) const
4242     {
4243       return swig::from(v);
4244     }
4245   };
4246
4247   template<typename OutIterator, 
4248            typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
4249            typename FromOper = from_oper<ValueType> >
4250   class SwigPyIteratorOpen_T :  public SwigPyIterator_T<OutIterator>
4251   {
4252   public:
4253     FromOper from;
4254     typedef OutIterator out_iterator;
4255     typedef ValueType value_type;
4256     typedef SwigPyIterator_T<out_iterator>  base;
4257     typedef SwigPyIteratorOpen_T<OutIterator, ValueType, FromOper> self_type;
4258     
4259     SwigPyIteratorOpen_T(out_iterator curr, PyObject *seq)
4260       : SwigPyIterator_T<OutIterator>(curr, seq)
4261     {
4262     }
4263     
4264     PyObject *value() const {
4265       return from(static_cast<const value_type&>(*(base::current)));
4266     }
4267     
4268     SwigPyIterator *copy() const
4269     {
4270       return new self_type(*this);
4271     }
4272
4273     SwigPyIterator *incr(size_t n = 1)
4274     {
4275       while (n--) {
4276         ++base::current;
4277       }
4278       return this;
4279     }
4280
4281     SwigPyIterator *decr(size_t n = 1)
4282     {
4283       while (n--) {
4284         --base::current;
4285       }
4286       return this;
4287     }
4288   };
4289
4290   template<typename OutIterator, 
4291            typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
4292            typename FromOper = from_oper<ValueType> >
4293   class SwigPyIteratorClosed_T :  public SwigPyIterator_T<OutIterator>
4294   {
4295   public:
4296     FromOper from;
4297     typedef OutIterator out_iterator;
4298     typedef ValueType value_type;
4299     typedef SwigPyIterator_T<out_iterator>  base;    
4300     typedef SwigPyIteratorClosed_T<OutIterator, ValueType, FromOper> self_type;
4301     
4302     SwigPyIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq)
4303       : SwigPyIterator_T<OutIterator>(curr, seq), begin(first), end(last)
4304     {
4305     }
4306     
4307     PyObject *value() const {
4308       if (base::current == end) {
4309         throw stop_iteration();
4310       } else {
4311         return from(static_cast<const value_type&>(*(base::current)));
4312       }
4313     }
4314     
4315     SwigPyIterator *copy() const
4316     {
4317       return new self_type(*this);
4318     }
4319
4320     SwigPyIterator *incr(size_t n = 1)
4321     {
4322       while (n--) {
4323         if (base::current == end) {
4324           throw stop_iteration();
4325         } else {
4326           ++base::current;
4327         }
4328       }
4329       return this;
4330     }
4331
4332     SwigPyIterator *decr(size_t n = 1)
4333     {
4334       while (n--) {
4335         if (base::current == begin) {
4336           throw stop_iteration();
4337         } else {
4338           --base::current;
4339         }
4340       }
4341       return this;
4342     }
4343
4344   private:
4345     out_iterator begin;
4346     out_iterator end;
4347   };
4348
4349   template<typename OutIter>
4350   inline SwigPyIterator*
4351   make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, PyObject *seq = 0)
4352   {
4353     return new SwigPyIteratorClosed_T<OutIter>(current, begin, end, seq);
4354   }
4355
4356   template<typename OutIter>
4357   inline SwigPyIterator*
4358   make_output_iterator(const OutIter& current, PyObject *seq = 0)
4359   {
4360     return new SwigPyIteratorOpen_T<OutIter>(current, seq);
4361   }
4362 }
4363
4364
4365 namespace swig
4366 {
4367   template <class T>
4368   struct SwigPySequence_Ref
4369   {
4370     SwigPySequence_Ref(PyObject* seq, int index)
4371       : _seq(seq), _index(index)
4372     {
4373     }
4374     
4375     operator T () const
4376     {
4377       swig::SwigVar_PyObject item = PySequence_GetItem(_seq, _index);
4378       try {
4379         return swig::as<T>(item, true);
4380       } catch (std::exception& e) {
4381         char msg[1024];
4382         sprintf(msg, "in sequence element %d ", _index);
4383         if (!PyErr_Occurred()) {
4384           ::SWIG_Error(SWIG_TypeError,  swig::type_name<T>());
4385         }
4386         SWIG_Python_AddErrorMsg(msg);
4387         SWIG_Python_AddErrorMsg(e.what());
4388         throw;
4389       }
4390     }
4391
4392     SwigPySequence_Ref& operator=(const T& v)
4393     {
4394       PySequence_SetItem(_seq, _index, swig::from<T>(v));
4395       return *this;
4396     }
4397
4398   private:
4399     PyObject* _seq;
4400     int _index;
4401   };
4402
4403   template <class T>
4404   struct SwigPySequence_ArrowProxy
4405   {
4406     SwigPySequence_ArrowProxy(const T& x): m_value(x) {}
4407     const T* operator->() const { return &m_value; }
4408     operator const T*() const { return &m_value; }
4409     T m_value;
4410   };
4411
4412   template <class T, class Reference >
4413   struct SwigPySequence_InputIterator
4414   {
4415     typedef SwigPySequence_InputIterator<T, Reference > self;
4416
4417     typedef std::random_access_iterator_tag iterator_category;
4418     typedef Reference reference;
4419     typedef T value_type;
4420     typedef T* pointer;
4421     typedef int difference_type;
4422
4423     SwigPySequence_InputIterator()
4424     {
4425     }
4426
4427     SwigPySequence_InputIterator(PyObject* seq, int index)
4428       : _seq(seq), _index(index)
4429     {
4430     }
4431
4432     reference operator*() const
4433     {
4434       return reference(_seq, _index);
4435     }
4436
4437     SwigPySequence_ArrowProxy<T>
4438     operator->() const {
4439       return SwigPySequence_ArrowProxy<T>(operator*());
4440     }
4441
4442     bool operator==(const self& ri) const
4443     {
4444       return (_index == ri._index) && (_seq == ri._seq);
4445     }
4446
4447     bool operator!=(const self& ri) const
4448     {
4449       return !(operator==(ri));
4450     }
4451
4452     self& operator ++ ()
4453     {
4454       ++_index;
4455       return *this;
4456     }
4457
4458     self& operator -- ()
4459     {
4460       --_index;
4461       return *this;
4462     }
4463
4464     self& operator += (difference_type n)
4465     {
4466       _index += n;
4467       return *this;
4468     }
4469
4470     self operator +(difference_type n) const
4471     {
4472       return self(_seq, _index + n);
4473     }
4474
4475     self& operator -= (difference_type n)
4476     {
4477       _index -= n;
4478       return *this;
4479     }
4480
4481     self operator -(difference_type n) const
4482     {
4483       return self(_seq, _index - n);
4484     }
4485
4486     difference_type operator - (const self& ri) const
4487     {
4488       return _index - ri._index;
4489     }
4490
4491     bool operator < (const self& ri) const
4492     {
4493       return _index < ri._index;
4494     }
4495
4496     reference
4497     operator[](difference_type n) const
4498     {
4499       return reference(_seq, _index + n);
4500     }
4501
4502   private:
4503     PyObject* _seq;
4504     difference_type _index;
4505   };
4506
4507   template <class T>
4508   struct SwigPySequence_Cont
4509   {
4510     typedef SwigPySequence_Ref<T> reference;
4511     typedef const SwigPySequence_Ref<T> const_reference;
4512     typedef T value_type;
4513     typedef T* pointer;
4514     typedef int difference_type;
4515     typedef int size_type;
4516     typedef const pointer const_pointer;
4517     typedef SwigPySequence_InputIterator<T, reference> iterator;
4518     typedef SwigPySequence_InputIterator<T, const_reference> const_iterator;
4519
4520     SwigPySequence_Cont(PyObject* seq) : _seq(0)
4521     {
4522       if (!PySequence_Check(seq)) {
4523         throw std::invalid_argument("a sequence is expected");
4524       }
4525       _seq = seq;
4526       Py_INCREF(_seq);
4527     }
4528
4529     ~SwigPySequence_Cont()
4530     {
4531       Py_XDECREF(_seq);
4532     }
4533
4534     size_type size() const
4535     {
4536       return static_cast<size_type>(PySequence_Size(_seq));
4537     }
4538
4539     bool empty() const
4540     {
4541       return size() == 0;
4542     }
4543
4544     iterator begin()
4545     {
4546       return iterator(_seq, 0);
4547     }
4548
4549     const_iterator begin() const
4550     {
4551       return const_iterator(_seq, 0);
4552     }
4553
4554     iterator end()
4555     {
4556       return iterator(_seq, size());
4557     }
4558
4559     const_iterator end() const
4560     {
4561       return const_iterator(_seq, size());
4562     }
4563
4564     reference operator[](difference_type n)
4565     {
4566       return reference(_seq, n);
4567     }
4568
4569     const_reference operator[](difference_type n)  const
4570     {
4571       return const_reference(_seq, n);
4572     }
4573
4574     bool check(bool set_err = true) const
4575     {
4576       int s = size();
4577       for (int i = 0; i < s; ++i) {
4578         swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i);
4579         if (!swig::check<value_type>(item)) {
4580           if (set_err) {
4581             char msg[1024];
4582             sprintf(msg, "in sequence element %d", i);
4583             SWIG_Error(SWIG_RuntimeError, msg);
4584           }
4585           return false;
4586         }
4587       }
4588       return true;
4589     }
4590
4591   private:
4592     PyObject* _seq;
4593   };
4594
4595 }
4596
4597
4598 CvMat * cvLoadImageMat(const char* filename, int iscolor=CV_LOAD_IMAGE_COLOR ){
4599         return cvLoadImageM(filename, iscolor);
4600 }
4601
4602
4603 CvMat * cvRetrieveFrame__CvMat( CvCapture* capture ){
4604         IplImage * im = cvRetrieveFrame(capture);
4605         if(im){
4606                 CvMat * mat = (CvMat *)cvAlloc(sizeof(CvMat));
4607                 mat = cvGetMat(im, mat);
4608                 return mat;
4609         }
4610         return false;
4611 }
4612
4613
4614 CvMat * cvQueryFrame__CvMat( CvCapture * capture ){
4615         IplImage * im = cvQueryFrame(capture);
4616         if(im){
4617                 CvMat * mat = (CvMat *)cvAlloc(sizeof(CvMat));
4618                 mat = cvGetMat(im, mat);
4619                 return mat;
4620         }
4621         return false;
4622 }
4623
4624
4625   #define SWIG_From_long   PyInt_FromLong 
4626
4627
4628 SWIGINTERNINLINE PyObject *
4629 SWIG_From_int  (int value)
4630 {    
4631   return SWIG_From_long  (value);
4632 }
4633
4634
4635 SWIGINTERNINLINE PyObject *
4636 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
4637 {
4638   if (carray) {
4639     if (size > INT_MAX) {
4640       swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
4641       return pchar_descriptor ? 
4642         SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
4643     } else {
4644 #if PY_VERSION_HEX >= 0x03000000
4645       return PyUnicode_FromStringAndSize(carray, static_cast< int >(size));
4646 #else
4647       return PyString_FromStringAndSize(carray, static_cast< int >(size));
4648 #endif
4649     }
4650   } else {
4651     return SWIG_Py_Void();
4652   }
4653 }
4654
4655
4656 SWIGINTERNINLINE PyObject * 
4657 SWIG_FromCharPtr(const char *cptr)
4658
4659   return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
4660 }
4661
4662
4663   #define SWIG_From_double   PyFloat_FromDouble 
4664
4665
4666 SWIGINTERN int
4667 SWIG_AsCharArray(PyObject * obj, char *val, size_t size)
4668
4669   char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ;
4670   int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc);
4671   if (SWIG_IsOK(res)) {
4672     if ((csize == size + 1) && cptr && !(cptr[csize-1])) --csize;
4673     if (csize <= size) {
4674       if (val) {
4675         if (csize) memcpy(val, cptr, csize*sizeof(char));
4676         if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char));
4677       }
4678       if (alloc == SWIG_NEWOBJ) {
4679         delete[] cptr;
4680         res = SWIG_DelNewMask(res);
4681       }      
4682       return res;
4683     }
4684     if (alloc == SWIG_NEWOBJ) delete[] cptr;
4685   }
4686   return SWIG_TypeError;
4687 }
4688
4689
4690 SWIGINTERN int
4691 SWIG_AsVal_char (PyObject * obj, char *val)
4692 {    
4693   int res = SWIG_AsCharArray(obj, val, 1);
4694   if (!SWIG_IsOK(res)) {
4695     long v;
4696     res = SWIG_AddCast(SWIG_AsVal_long (obj, &v));
4697     if (SWIG_IsOK(res)) {
4698       if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) {
4699         if (val) *val = static_cast< char >(v);
4700       } else {
4701         res = SWIG_OverflowError;
4702       }
4703     }
4704   }
4705   return res;
4706 }
4707
4708 SWIGINTERN void delete_CvCapture(CvCapture *self){ CvCapture *     dummy = self; cvReleaseCapture     (& dummy); }
4709 SWIGINTERN void delete_CvVideoWriter(CvVideoWriter *self){ CvVideoWriter * dummy = self; cvReleaseVideoWriter (& dummy); }
4710 #ifdef __cplusplus
4711 extern "C" {
4712 #endif
4713 SWIGINTERN PyObject *_wrap_new_CvRNG_Wrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4714   PyObject *resultobj = 0;
4715   CvRNG *arg1 = 0 ;
4716   void *argp1 = 0 ;
4717   int res1 = 0 ;
4718   PyObject * obj0 = 0 ;
4719   CvRNG_Wrapper *result = 0 ;
4720   
4721   if (!PyArg_ParseTuple(args,(char *)"O:new_CvRNG_Wrapper",&obj0)) SWIG_fail;
4722   res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_uint64_t,  0  | 0);
4723   if (!SWIG_IsOK(res1)) {
4724     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CvRNG_Wrapper" "', argument " "1"" of type '" "CvRNG const &""'"); 
4725   }
4726   if (!argp1) {
4727     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_CvRNG_Wrapper" "', argument " "1"" of type '" "CvRNG const &""'"); 
4728   }
4729   arg1 = reinterpret_cast< CvRNG * >(argp1);
4730   result = (CvRNG_Wrapper *)new CvRNG_Wrapper((CvRNG const &)*arg1);
4731   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvRNG_Wrapper, SWIG_POINTER_NEW |  0 );
4732   return resultobj;
4733 fail:
4734   return NULL;
4735 }
4736
4737
4738 SWIGINTERN PyObject *_wrap_CvRNG_Wrapper_ptr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4739   PyObject *resultobj = 0;
4740   CvRNG_Wrapper *arg1 = (CvRNG_Wrapper *) 0 ;
4741   void *argp1 = 0 ;
4742   int res1 = 0 ;
4743   PyObject * obj0 = 0 ;
4744   CvRNG *result = 0 ;
4745   
4746   if (!PyArg_ParseTuple(args,(char *)"O:CvRNG_Wrapper_ptr",&obj0)) SWIG_fail;
4747   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRNG_Wrapper, 0 |  0 );
4748   if (!SWIG_IsOK(res1)) {
4749     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRNG_Wrapper_ptr" "', argument " "1"" of type '" "CvRNG_Wrapper *""'"); 
4750   }
4751   arg1 = reinterpret_cast< CvRNG_Wrapper * >(argp1);
4752   result = (CvRNG *)(arg1)->ptr();
4753   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_uint64_t, 0 |  0 );
4754   return resultobj;
4755 fail:
4756   return NULL;
4757 }
4758
4759
4760 SWIGINTERN PyObject *_wrap_CvRNG_Wrapper_ref(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4761   PyObject *resultobj = 0;
4762   CvRNG_Wrapper *arg1 = (CvRNG_Wrapper *) 0 ;
4763   void *argp1 = 0 ;
4764   int res1 = 0 ;
4765   PyObject * obj0 = 0 ;
4766   CvRNG *result = 0 ;
4767   
4768   if (!PyArg_ParseTuple(args,(char *)"O:CvRNG_Wrapper_ref",&obj0)) SWIG_fail;
4769   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRNG_Wrapper, 0 |  0 );
4770   if (!SWIG_IsOK(res1)) {
4771     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRNG_Wrapper_ref" "', argument " "1"" of type '" "CvRNG_Wrapper *""'"); 
4772   }
4773   arg1 = reinterpret_cast< CvRNG_Wrapper * >(argp1);
4774   result = (CvRNG *) &(arg1)->ref();
4775   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_uint64_t, 0 |  0 );
4776   return resultobj;
4777 fail:
4778   return NULL;
4779 }
4780
4781
4782 SWIGINTERN PyObject *_wrap_CvRNG_Wrapper___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4783   PyObject *resultobj = 0;
4784   CvRNG_Wrapper *arg1 = (CvRNG_Wrapper *) 0 ;
4785   CvRNG_Wrapper *arg2 = 0 ;
4786   void *argp1 = 0 ;
4787   int res1 = 0 ;
4788   void *argp2 = 0 ;
4789   int res2 = 0 ;
4790   PyObject * obj0 = 0 ;
4791   PyObject * obj1 = 0 ;
4792   bool result;
4793   
4794   if (!PyArg_ParseTuple(args,(char *)"OO:CvRNG_Wrapper___eq__",&obj0,&obj1)) SWIG_fail;
4795   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRNG_Wrapper, 0 |  0 );
4796   if (!SWIG_IsOK(res1)) {
4797     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRNG_Wrapper___eq__" "', argument " "1"" of type '" "CvRNG_Wrapper *""'"); 
4798   }
4799   arg1 = reinterpret_cast< CvRNG_Wrapper * >(argp1);
4800   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_CvRNG_Wrapper,  0  | 0);
4801   if (!SWIG_IsOK(res2)) {
4802     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRNG_Wrapper___eq__" "', argument " "2"" of type '" "CvRNG_Wrapper const &""'"); 
4803   }
4804   if (!argp2) {
4805     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvRNG_Wrapper___eq__" "', argument " "2"" of type '" "CvRNG_Wrapper const &""'"); 
4806   }
4807   arg2 = reinterpret_cast< CvRNG_Wrapper * >(argp2);
4808   result = (bool)(arg1)->operator ==((CvRNG_Wrapper const &)*arg2);
4809   resultobj = SWIG_From_bool(static_cast< bool >(result));
4810   return resultobj;
4811 fail:
4812   return NULL;
4813 }
4814
4815
4816 SWIGINTERN PyObject *_wrap_CvRNG_Wrapper___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4817   PyObject *resultobj = 0;
4818   CvRNG_Wrapper *arg1 = (CvRNG_Wrapper *) 0 ;
4819   CvRNG_Wrapper *arg2 = 0 ;
4820   void *argp1 = 0 ;
4821   int res1 = 0 ;
4822   void *argp2 = 0 ;
4823   int res2 = 0 ;
4824   PyObject * obj0 = 0 ;
4825   PyObject * obj1 = 0 ;
4826   bool result;
4827   
4828   if (!PyArg_ParseTuple(args,(char *)"OO:CvRNG_Wrapper___ne__",&obj0,&obj1)) SWIG_fail;
4829   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRNG_Wrapper, 0 |  0 );
4830   if (!SWIG_IsOK(res1)) {
4831     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvRNG_Wrapper___ne__" "', argument " "1"" of type '" "CvRNG_Wrapper *""'"); 
4832   }
4833   arg1 = reinterpret_cast< CvRNG_Wrapper * >(argp1);
4834   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_CvRNG_Wrapper,  0  | 0);
4835   if (!SWIG_IsOK(res2)) {
4836     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvRNG_Wrapper___ne__" "', argument " "2"" of type '" "CvRNG_Wrapper const &""'"); 
4837   }
4838   if (!argp2) {
4839     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvRNG_Wrapper___ne__" "', argument " "2"" of type '" "CvRNG_Wrapper const &""'"); 
4840   }
4841   arg2 = reinterpret_cast< CvRNG_Wrapper * >(argp2);
4842   result = (bool)(arg1)->operator !=((CvRNG_Wrapper const &)*arg2);
4843   resultobj = SWIG_From_bool(static_cast< bool >(result));
4844   return resultobj;
4845 fail:
4846   return NULL;
4847 }
4848
4849
4850 SWIGINTERN PyObject *_wrap_delete_CvRNG_Wrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4851   PyObject *resultobj = 0;
4852   CvRNG_Wrapper *arg1 = (CvRNG_Wrapper *) 0 ;
4853   void *argp1 = 0 ;
4854   int res1 = 0 ;
4855   PyObject * obj0 = 0 ;
4856   
4857   if (!PyArg_ParseTuple(args,(char *)"O:delete_CvRNG_Wrapper",&obj0)) SWIG_fail;
4858   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvRNG_Wrapper, SWIG_POINTER_DISOWN |  0 );
4859   if (!SWIG_IsOK(res1)) {
4860     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvRNG_Wrapper" "', argument " "1"" of type '" "CvRNG_Wrapper *""'"); 
4861   }
4862   arg1 = reinterpret_cast< CvRNG_Wrapper * >(argp1);
4863   {
4864     try {
4865       delete arg1; 
4866     } 
4867     catch (...) 
4868     {
4869       SWIG_fail;
4870     } 
4871   }
4872   resultobj = SWIG_Py_Void();
4873   return resultobj;
4874 fail:
4875   return NULL;
4876 }
4877
4878
4879 SWIGINTERN PyObject *CvRNG_Wrapper_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4880   PyObject *obj;
4881   if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
4882   SWIG_TypeNewClientData(SWIGTYPE_p_CvRNG_Wrapper, SWIG_NewClientData(obj));
4883   return SWIG_Py_Void();
4884 }
4885
4886 SWIGINTERN PyObject *_wrap_new_CvSubdiv2DEdge_Wrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4887   PyObject *resultobj = 0;
4888   CvSubdiv2DEdge *arg1 = 0 ;
4889   CvSubdiv2DEdge temp1 ;
4890   size_t val1 ;
4891   int ecode1 = 0 ;
4892   PyObject * obj0 = 0 ;
4893   CvSubdiv2DEdge_Wrapper *result = 0 ;
4894   
4895   if (!PyArg_ParseTuple(args,(char *)"O:new_CvSubdiv2DEdge_Wrapper",&obj0)) SWIG_fail;
4896   ecode1 = SWIG_AsVal_size_t(obj0, &val1);
4897   if (!SWIG_IsOK(ecode1)) {
4898     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CvSubdiv2DEdge_Wrapper" "', argument " "1"" of type '" "CvSubdiv2DEdge""'");
4899   } 
4900   temp1 = static_cast< CvSubdiv2DEdge >(val1);
4901   arg1 = &temp1;
4902   result = (CvSubdiv2DEdge_Wrapper *)new CvSubdiv2DEdge_Wrapper((CvSubdiv2DEdge const &)*arg1);
4903   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvSubdiv2DEdge_Wrapper, SWIG_POINTER_NEW |  0 );
4904   return resultobj;
4905 fail:
4906   return NULL;
4907 }
4908
4909
4910 SWIGINTERN PyObject *_wrap_CvSubdiv2DEdge_Wrapper_ptr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4911   PyObject *resultobj = 0;
4912   CvSubdiv2DEdge_Wrapper *arg1 = (CvSubdiv2DEdge_Wrapper *) 0 ;
4913   void *argp1 = 0 ;
4914   int res1 = 0 ;
4915   PyObject * obj0 = 0 ;
4916   CvSubdiv2DEdge *result = 0 ;
4917   
4918   if (!PyArg_ParseTuple(args,(char *)"O:CvSubdiv2DEdge_Wrapper_ptr",&obj0)) SWIG_fail;
4919   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSubdiv2DEdge_Wrapper, 0 |  0 );
4920   if (!SWIG_IsOK(res1)) {
4921     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSubdiv2DEdge_Wrapper_ptr" "', argument " "1"" of type '" "CvSubdiv2DEdge_Wrapper *""'"); 
4922   }
4923   arg1 = reinterpret_cast< CvSubdiv2DEdge_Wrapper * >(argp1);
4924   result = (CvSubdiv2DEdge *)(arg1)->ptr();
4925   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_size_t, 0 |  0 );
4926   return resultobj;
4927 fail:
4928   return NULL;
4929 }
4930
4931
4932 SWIGINTERN PyObject *_wrap_CvSubdiv2DEdge_Wrapper_ref(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4933   PyObject *resultobj = 0;
4934   CvSubdiv2DEdge_Wrapper *arg1 = (CvSubdiv2DEdge_Wrapper *) 0 ;
4935   void *argp1 = 0 ;
4936   int res1 = 0 ;
4937   PyObject * obj0 = 0 ;
4938   CvSubdiv2DEdge *result = 0 ;
4939   
4940   if (!PyArg_ParseTuple(args,(char *)"O:CvSubdiv2DEdge_Wrapper_ref",&obj0)) SWIG_fail;
4941   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSubdiv2DEdge_Wrapper, 0 |  0 );
4942   if (!SWIG_IsOK(res1)) {
4943     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSubdiv2DEdge_Wrapper_ref" "', argument " "1"" of type '" "CvSubdiv2DEdge_Wrapper *""'"); 
4944   }
4945   arg1 = reinterpret_cast< CvSubdiv2DEdge_Wrapper * >(argp1);
4946   result = (CvSubdiv2DEdge *) &(arg1)->ref();
4947   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_size_t, 0 |  0 );
4948   return resultobj;
4949 fail:
4950   return NULL;
4951 }
4952
4953
4954 SWIGINTERN PyObject *_wrap_CvSubdiv2DEdge_Wrapper___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4955   PyObject *resultobj = 0;
4956   CvSubdiv2DEdge_Wrapper *arg1 = (CvSubdiv2DEdge_Wrapper *) 0 ;
4957   CvSubdiv2DEdge_Wrapper *arg2 = 0 ;
4958   void *argp1 = 0 ;
4959   int res1 = 0 ;
4960   void *argp2 = 0 ;
4961   int res2 = 0 ;
4962   PyObject * obj0 = 0 ;
4963   PyObject * obj1 = 0 ;
4964   bool result;
4965   
4966   if (!PyArg_ParseTuple(args,(char *)"OO:CvSubdiv2DEdge_Wrapper___eq__",&obj0,&obj1)) SWIG_fail;
4967   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSubdiv2DEdge_Wrapper, 0 |  0 );
4968   if (!SWIG_IsOK(res1)) {
4969     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSubdiv2DEdge_Wrapper___eq__" "', argument " "1"" of type '" "CvSubdiv2DEdge_Wrapper *""'"); 
4970   }
4971   arg1 = reinterpret_cast< CvSubdiv2DEdge_Wrapper * >(argp1);
4972   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_CvSubdiv2DEdge_Wrapper,  0  | 0);
4973   if (!SWIG_IsOK(res2)) {
4974     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSubdiv2DEdge_Wrapper___eq__" "', argument " "2"" of type '" "CvSubdiv2DEdge_Wrapper const &""'"); 
4975   }
4976   if (!argp2) {
4977     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvSubdiv2DEdge_Wrapper___eq__" "', argument " "2"" of type '" "CvSubdiv2DEdge_Wrapper const &""'"); 
4978   }
4979   arg2 = reinterpret_cast< CvSubdiv2DEdge_Wrapper * >(argp2);
4980   result = (bool)(arg1)->operator ==((CvSubdiv2DEdge_Wrapper const &)*arg2);
4981   resultobj = SWIG_From_bool(static_cast< bool >(result));
4982   return resultobj;
4983 fail:
4984   return NULL;
4985 }
4986
4987
4988 SWIGINTERN PyObject *_wrap_CvSubdiv2DEdge_Wrapper___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4989   PyObject *resultobj = 0;
4990   CvSubdiv2DEdge_Wrapper *arg1 = (CvSubdiv2DEdge_Wrapper *) 0 ;
4991   CvSubdiv2DEdge_Wrapper *arg2 = 0 ;
4992   void *argp1 = 0 ;
4993   int res1 = 0 ;
4994   void *argp2 = 0 ;
4995   int res2 = 0 ;
4996   PyObject * obj0 = 0 ;
4997   PyObject * obj1 = 0 ;
4998   bool result;
4999   
5000   if (!PyArg_ParseTuple(args,(char *)"OO:CvSubdiv2DEdge_Wrapper___ne__",&obj0,&obj1)) SWIG_fail;
5001   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSubdiv2DEdge_Wrapper, 0 |  0 );
5002   if (!SWIG_IsOK(res1)) {
5003     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvSubdiv2DEdge_Wrapper___ne__" "', argument " "1"" of type '" "CvSubdiv2DEdge_Wrapper *""'"); 
5004   }
5005   arg1 = reinterpret_cast< CvSubdiv2DEdge_Wrapper * >(argp1);
5006   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_CvSubdiv2DEdge_Wrapper,  0  | 0);
5007   if (!SWIG_IsOK(res2)) {
5008     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvSubdiv2DEdge_Wrapper___ne__" "', argument " "2"" of type '" "CvSubdiv2DEdge_Wrapper const &""'"); 
5009   }
5010   if (!argp2) {
5011     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvSubdiv2DEdge_Wrapper___ne__" "', argument " "2"" of type '" "CvSubdiv2DEdge_Wrapper const &""'"); 
5012   }
5013   arg2 = reinterpret_cast< CvSubdiv2DEdge_Wrapper * >(argp2);
5014   result = (bool)(arg1)->operator !=((CvSubdiv2DEdge_Wrapper const &)*arg2);
5015   resultobj = SWIG_From_bool(static_cast< bool >(result));
5016   return resultobj;
5017 fail:
5018   return NULL;
5019 }
5020
5021
5022 SWIGINTERN PyObject *_wrap_delete_CvSubdiv2DEdge_Wrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5023   PyObject *resultobj = 0;
5024   CvSubdiv2DEdge_Wrapper *arg1 = (CvSubdiv2DEdge_Wrapper *) 0 ;
5025   void *argp1 = 0 ;
5026   int res1 = 0 ;
5027   PyObject * obj0 = 0 ;
5028   
5029   if (!PyArg_ParseTuple(args,(char *)"O:delete_CvSubdiv2DEdge_Wrapper",&obj0)) SWIG_fail;
5030   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvSubdiv2DEdge_Wrapper, SWIG_POINTER_DISOWN |  0 );
5031   if (!SWIG_IsOK(res1)) {
5032     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvSubdiv2DEdge_Wrapper" "', argument " "1"" of type '" "CvSubdiv2DEdge_Wrapper *""'"); 
5033   }
5034   arg1 = reinterpret_cast< CvSubdiv2DEdge_Wrapper * >(argp1);
5035   {
5036     try {
5037       delete arg1; 
5038     } 
5039     catch (...) 
5040     {
5041       SWIG_fail;
5042     } 
5043   }
5044   resultobj = SWIG_Py_Void();
5045   return resultobj;
5046 fail:
5047   return NULL;
5048 }
5049
5050
5051 SWIGINTERN PyObject *CvSubdiv2DEdge_Wrapper_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5052   PyObject *obj;
5053   if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
5054   SWIG_TypeNewClientData(SWIGTYPE_p_CvSubdiv2DEdge_Wrapper, SWIG_NewClientData(obj));
5055   return SWIG_Py_Void();
5056 }
5057
5058 SWIGINTERN PyObject *_wrap_cvSetMouseCallback__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5059   PyObject *resultobj = 0;
5060   char *arg1 = (char *) 0 ;
5061   PyObject *arg2 = (PyObject *) 0 ;
5062   PyObject *arg3 = (PyObject *) 0 ;
5063   int res1 ;
5064   char *buf1 = 0 ;
5065   int alloc1 = 0 ;
5066   PyObject * obj0 = 0 ;
5067   PyObject * obj1 = 0 ;
5068   PyObject * obj2 = 0 ;
5069   
5070   if (!PyArg_ParseTuple(args,(char *)"OOO:cvSetMouseCallback",&obj0,&obj1,&obj2)) SWIG_fail;
5071   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5072   if (!SWIG_IsOK(res1)) {
5073     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvSetMouseCallback" "', argument " "1"" of type '" "char const *""'");
5074   }
5075   arg1 = reinterpret_cast< char * >(buf1);
5076   arg2 = obj1;
5077   arg3 = obj2;
5078   cvSetMouseCallbackPy((char const *)arg1,arg2,arg3);
5079   resultobj = SWIG_Py_Void();
5080   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5081   return resultobj;
5082 fail:
5083   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5084   return NULL;
5085 }
5086
5087
5088 SWIGINTERN PyObject *_wrap_cvSetMouseCallback__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5089   PyObject *resultobj = 0;
5090   char *arg1 = (char *) 0 ;
5091   PyObject *arg2 = (PyObject *) 0 ;
5092   int res1 ;
5093   char *buf1 = 0 ;
5094   int alloc1 = 0 ;
5095   PyObject * obj0 = 0 ;
5096   PyObject * obj1 = 0 ;
5097   
5098   if (!PyArg_ParseTuple(args,(char *)"OO:cvSetMouseCallback",&obj0,&obj1)) SWIG_fail;
5099   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5100   if (!SWIG_IsOK(res1)) {
5101     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvSetMouseCallback" "', argument " "1"" of type '" "char const *""'");
5102   }
5103   arg1 = reinterpret_cast< char * >(buf1);
5104   arg2 = obj1;
5105   cvSetMouseCallbackPy((char const *)arg1,arg2);
5106   resultobj = SWIG_Py_Void();
5107   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5108   return resultobj;
5109 fail:
5110   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5111   return NULL;
5112 }
5113
5114
5115 SWIGINTERN PyObject *_wrap_cvSetMouseCallback(PyObject *self, PyObject *args) {
5116   int argc;
5117   PyObject *argv[4];
5118   int ii;
5119   
5120   if (!PyTuple_Check(args)) SWIG_fail;
5121   argc = (int)PyObject_Length(args);
5122   for (ii = 0; (ii < argc) && (ii < 3); ii++) {
5123     argv[ii] = PyTuple_GET_ITEM(args,ii);
5124   }
5125   if (argc == 2) {
5126     int _v;
5127     int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
5128     _v = SWIG_CheckState(res);
5129     if (_v) {
5130       _v = (argv[1] != 0);
5131       if (_v) {
5132         return _wrap_cvSetMouseCallback__SWIG_1(self, args);
5133       }
5134     }
5135   }
5136   if (argc == 3) {
5137     int _v;
5138     int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
5139     _v = SWIG_CheckState(res);
5140     if (_v) {
5141       _v = (argv[1] != 0);
5142       if (_v) {
5143         _v = (argv[2] != 0);
5144         if (_v) {
5145           return _wrap_cvSetMouseCallback__SWIG_0(self, args);
5146         }
5147       }
5148     }
5149   }
5150   
5151 fail:
5152   SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'cvSetMouseCallback'.\n"
5153     "  Possible C/C++ prototypes are:\n"
5154     "    cvSetMouseCallbackPy(char const *,PyObject *,PyObject *)\n"
5155     "    cvSetMouseCallbackPy(char const *,PyObject *)\n");
5156   return NULL;
5157 }
5158
5159
5160
5161     /* C helper function which is responsible for calling
5162        the Python real trackbar callback function */
5163     static void icvPyOnTrackbar( PyObject * py_cb_func, int pos) {
5164         
5165                 /* Must ensure this thread has a lock on the interpreter */
5166                 PyGILState_STATE state = PyGILState_Ensure();
5167
5168                 PyObject *result;
5169
5170                 /* the argument of the callback ready to be passed to Python code */
5171                 PyObject *arg1 = PyInt_FromLong (pos);
5172
5173                 /* build the tuple for calling the Python callback */
5174                 PyObject *arglist = Py_BuildValue ("(O)", arg1);
5175
5176                 /* call the Python callback */
5177                 result = PyEval_CallObject (py_cb_func, arglist);
5178
5179                 /* Errors in Python callback get swallowed, so report them here */
5180                 if(!result){
5181                         PyErr_Print();
5182                         cvError( CV_StsInternal, "icvPyOnTrackbar", "", __FILE__, __LINE__);
5183                 }
5184
5185
5186                 /* cleanup */
5187                 Py_XDECREF (result);
5188
5189                 /* Release Interpreter lock */
5190                 PyGILState_Release(state);
5191         }
5192
5193 #define ICV_PY_MAX_CB 10
5194
5195         struct PyCvTrackbar {
5196                 CvTrackbarCallback cv_func;
5197                 PyObject * py_func;
5198                 PyObject * py_pos;
5199         };
5200
5201         static int my_trackbar_cb_size=0;
5202         extern PyCvTrackbar my_trackbar_cb_funcs[ICV_PY_MAX_CB];
5203
5204
5205 static void icvPyTrackbarCB0(int pos){                                      
5206         if(!my_trackbar_cb_funcs[0].py_func) return;                              
5207         icvPyOnTrackbar( my_trackbar_cb_funcs[0].py_func, pos );                    
5208 }                                                                               
5209
5210
5211 static void icvPyTrackbarCB1(int pos){                                      
5212         if(!my_trackbar_cb_funcs[1].py_func) return;                              
5213         icvPyOnTrackbar( my_trackbar_cb_funcs[1].py_func, pos );                    
5214 }                                                                               
5215
5216
5217 static void icvPyTrackbarCB2(int pos){                                      
5218         if(!my_trackbar_cb_funcs[2].py_func) return;                              
5219         icvPyOnTrackbar( my_trackbar_cb_funcs[2].py_func, pos );                    
5220 }                                                                               
5221
5222
5223 static void icvPyTrackbarCB3(int pos){                                      
5224         if(!my_trackbar_cb_funcs[3].py_func) return;                              
5225         icvPyOnTrackbar( my_trackbar_cb_funcs[3].py_func, pos );                    
5226 }                                                                               
5227
5228
5229 static void icvPyTrackbarCB4(int pos){                                      
5230         if(!my_trackbar_cb_funcs[4].py_func) return;                              
5231         icvPyOnTrackbar( my_trackbar_cb_funcs[4].py_func, pos );                    
5232 }                                                                               
5233
5234
5235 static void icvPyTrackbarCB5(int pos){                                      
5236         if(!my_trackbar_cb_funcs[5].py_func) return;                              
5237         icvPyOnTrackbar( my_trackbar_cb_funcs[5].py_func, pos );                    
5238 }                                                                               
5239
5240
5241 static void icvPyTrackbarCB6(int pos){                                      
5242         if(!my_trackbar_cb_funcs[6].py_func) return;                              
5243         icvPyOnTrackbar( my_trackbar_cb_funcs[6].py_func, pos );                    
5244 }                                                                               
5245
5246
5247 static void icvPyTrackbarCB7(int pos){                                      
5248         if(!my_trackbar_cb_funcs[7].py_func) return;                              
5249         icvPyOnTrackbar( my_trackbar_cb_funcs[7].py_func, pos );                    
5250 }                                                                               
5251
5252
5253 static void icvPyTrackbarCB8(int pos){                                      
5254         if(!my_trackbar_cb_funcs[8].py_func) return;                              
5255         icvPyOnTrackbar( my_trackbar_cb_funcs[8].py_func, pos );                    
5256 }                                                                               
5257
5258
5259 static void icvPyTrackbarCB9(int pos){                                      
5260         if(!my_trackbar_cb_funcs[9].py_func) return;                              
5261         icvPyOnTrackbar( my_trackbar_cb_funcs[9].py_func, pos );                    
5262 }                                                                               
5263
5264
5265         PyCvTrackbar my_trackbar_cb_funcs[ICV_PY_MAX_CB] = {
5266                 /*@SWIG:highgui.i,181,%ICV_PY_CB_TAB_ENTRY@*/
5267         {(CvTrackbarCallback) icvPyTrackbarCB0, NULL, NULL }
5268 /*@SWIG@*/,
5269                 /*@SWIG:highgui.i,181,%ICV_PY_CB_TAB_ENTRY@*/
5270         {(CvTrackbarCallback) icvPyTrackbarCB1, NULL, NULL }
5271 /*@SWIG@*/,
5272                 /*@SWIG:highgui.i,181,%ICV_PY_CB_TAB_ENTRY@*/
5273         {(CvTrackbarCallback) icvPyTrackbarCB2, NULL, NULL }
5274 /*@SWIG@*/,
5275                 /*@SWIG:highgui.i,181,%ICV_PY_CB_TAB_ENTRY@*/
5276         {(CvTrackbarCallback) icvPyTrackbarCB3, NULL, NULL }
5277 /*@SWIG@*/,
5278                 /*@SWIG:highgui.i,181,%ICV_PY_CB_TAB_ENTRY@*/
5279         {(CvTrackbarCallback) icvPyTrackbarCB4, NULL, NULL }
5280 /*@SWIG@*/,
5281                 /*@SWIG:highgui.i,181,%ICV_PY_CB_TAB_ENTRY@*/
5282         {(CvTrackbarCallback) icvPyTrackbarCB5, NULL, NULL }
5283 /*@SWIG@*/,
5284                 /*@SWIG:highgui.i,181,%ICV_PY_CB_TAB_ENTRY@*/
5285         {(CvTrackbarCallback) icvPyTrackbarCB6, NULL, NULL }
5286 /*@SWIG@*/,
5287                 /*@SWIG:highgui.i,181,%ICV_PY_CB_TAB_ENTRY@*/
5288         {(CvTrackbarCallback) icvPyTrackbarCB7, NULL, NULL }
5289 /*@SWIG@*/,
5290                 /*@SWIG:highgui.i,181,%ICV_PY_CB_TAB_ENTRY@*/
5291         {(CvTrackbarCallback) icvPyTrackbarCB8, NULL, NULL }
5292 /*@SWIG@*/,
5293                 /*@SWIG:highgui.i,181,%ICV_PY_CB_TAB_ENTRY@*/
5294         {(CvTrackbarCallback) icvPyTrackbarCB9, NULL, NULL }
5295 /*@SWIG@*/
5296         };
5297
5298 SWIGINTERN PyObject *_wrap_cvWaitKey__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5299   PyObject *resultobj = 0;
5300   int arg1 ;
5301   int val1 ;
5302   int ecode1 = 0 ;
5303   PyObject * obj0 = 0 ;
5304   PyObject *result = 0 ;
5305   
5306   if (!PyArg_ParseTuple(args,(char *)"O:cvWaitKey",&obj0)) SWIG_fail;
5307   ecode1 = SWIG_AsVal_int(obj0, &val1);
5308   if (!SWIG_IsOK(ecode1)) {
5309     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cvWaitKey" "', argument " "1"" of type '" "int""'");
5310   } 
5311   arg1 = static_cast< int >(val1);
5312   result = (PyObject *)cvWaitKeyPy(arg1);
5313   resultobj = result;
5314   return resultobj;
5315 fail:
5316   return NULL;
5317 }
5318
5319
5320 SWIGINTERN PyObject *_wrap_cvWaitKey__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5321   PyObject *resultobj = 0;
5322   PyObject *result = 0 ;
5323   
5324   if (!PyArg_ParseTuple(args,(char *)":cvWaitKey")) SWIG_fail;
5325   result = (PyObject *)cvWaitKeyPy();
5326   resultobj = result;
5327   return resultobj;
5328 fail:
5329   return NULL;
5330 }
5331
5332
5333 SWIGINTERN PyObject *_wrap_cvWaitKey(PyObject *self, PyObject *args) {
5334   int argc;
5335   PyObject *argv[2];
5336   int ii;
5337   
5338   if (!PyTuple_Check(args)) SWIG_fail;
5339   argc = (int)PyObject_Length(args);
5340   for (ii = 0; (ii < argc) && (ii < 1); ii++) {
5341     argv[ii] = PyTuple_GET_ITEM(args,ii);
5342   }
5343   if (argc == 0) {
5344     return _wrap_cvWaitKey__SWIG_1(self, args);
5345   }
5346   if (argc == 1) {
5347     int _v;
5348     {
5349       int res = SWIG_AsVal_int(argv[0], NULL);
5350       _v = SWIG_CheckState(res);
5351     }
5352     if (_v) {
5353       return _wrap_cvWaitKey__SWIG_0(self, args);
5354     }
5355   }
5356   
5357 fail:
5358   SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'cvWaitKey'.\n"
5359     "  Possible C/C++ prototypes are:\n"
5360     "    cvWaitKeyPy(int)\n"
5361     "    cvWaitKeyPy()\n");
5362   return NULL;
5363 }
5364
5365
5366 SWIGINTERN PyObject *_wrap_cvLoadImage__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5367   PyObject *resultobj = 0;
5368   char *arg1 = (char *) 0 ;
5369   int arg2 ;
5370   int res1 ;
5371   char *buf1 = 0 ;
5372   int alloc1 = 0 ;
5373   int val2 ;
5374   int ecode2 = 0 ;
5375   PyObject * obj0 = 0 ;
5376   PyObject * obj1 = 0 ;
5377   CvMat *result = 0 ;
5378   
5379   if (!PyArg_ParseTuple(args,(char *)"OO:cvLoadImage",&obj0,&obj1)) SWIG_fail;
5380   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5381   if (!SWIG_IsOK(res1)) {
5382     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvLoadImage" "', argument " "1"" of type '" "char const *""'");
5383   }
5384   arg1 = reinterpret_cast< char * >(buf1);
5385   ecode2 = SWIG_AsVal_int(obj1, &val2);
5386   if (!SWIG_IsOK(ecode2)) {
5387     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cvLoadImage" "', argument " "2"" of type '" "int""'");
5388   } 
5389   arg2 = static_cast< int >(val2);
5390   {
5391     try {
5392       result = (CvMat *)cvLoadImageMat((char const *)arg1,arg2); 
5393     } 
5394     catch (...) 
5395     {
5396       SWIG_fail;
5397     } 
5398   }
5399   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, SWIG_POINTER_OWN |  0 );
5400   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5401   return resultobj;
5402 fail:
5403   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5404   return NULL;
5405 }
5406
5407
5408 SWIGINTERN PyObject *_wrap_cvLoadImage__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5409   PyObject *resultobj = 0;
5410   char *arg1 = (char *) 0 ;
5411   int res1 ;
5412   char *buf1 = 0 ;
5413   int alloc1 = 0 ;
5414   PyObject * obj0 = 0 ;
5415   CvMat *result = 0 ;
5416   
5417   if (!PyArg_ParseTuple(args,(char *)"O:cvLoadImage",&obj0)) SWIG_fail;
5418   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5419   if (!SWIG_IsOK(res1)) {
5420     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvLoadImage" "', argument " "1"" of type '" "char const *""'");
5421   }
5422   arg1 = reinterpret_cast< char * >(buf1);
5423   {
5424     try {
5425       result = (CvMat *)cvLoadImageMat((char const *)arg1); 
5426     } 
5427     catch (...) 
5428     {
5429       SWIG_fail;
5430     } 
5431   }
5432   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, SWIG_POINTER_OWN |  0 );
5433   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5434   return resultobj;
5435 fail:
5436   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5437   return NULL;
5438 }
5439
5440
5441 SWIGINTERN PyObject *_wrap_cvLoadImage(PyObject *self, PyObject *args) {
5442   int argc;
5443   PyObject *argv[3];
5444   int ii;
5445   
5446   if (!PyTuple_Check(args)) SWIG_fail;
5447   argc = (int)PyObject_Length(args);
5448   for (ii = 0; (ii < argc) && (ii < 2); ii++) {
5449     argv[ii] = PyTuple_GET_ITEM(args,ii);
5450   }
5451   if (argc == 1) {
5452     int _v;
5453     int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
5454     _v = SWIG_CheckState(res);
5455     if (_v) {
5456       return _wrap_cvLoadImage__SWIG_1(self, args);
5457     }
5458   }
5459   if (argc == 2) {
5460     int _v;
5461     int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
5462     _v = SWIG_CheckState(res);
5463     if (_v) {
5464       {
5465         int res = SWIG_AsVal_int(argv[1], NULL);
5466         _v = SWIG_CheckState(res);
5467       }
5468       if (_v) {
5469         return _wrap_cvLoadImage__SWIG_0(self, args);
5470       }
5471     }
5472   }
5473   
5474 fail:
5475   SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'cvLoadImage'.\n"
5476     "  Possible C/C++ prototypes are:\n"
5477     "    cvLoadImageMat(char const *,int)\n"
5478     "    cvLoadImageMat(char const *)\n");
5479   return NULL;
5480 }
5481
5482
5483 SWIGINTERN PyObject *_wrap_cvRetrieveFrame(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5484   PyObject *resultobj = 0;
5485   CvCapture *arg1 = (CvCapture *) 0 ;
5486   void *argp1 = 0 ;
5487   int res1 = 0 ;
5488   PyObject * obj0 = 0 ;
5489   CvMat *result = 0 ;
5490   
5491   if (!PyArg_ParseTuple(args,(char *)"O:cvRetrieveFrame",&obj0)) SWIG_fail;
5492   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvCapture, 0 |  0 );
5493   if (!SWIG_IsOK(res1)) {
5494     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvRetrieveFrame" "', argument " "1"" of type '" "CvCapture *""'"); 
5495   }
5496   arg1 = reinterpret_cast< CvCapture * >(argp1);
5497   {
5498     try {
5499       result = (CvMat *)cvRetrieveFrame__CvMat(arg1); 
5500     } 
5501     catch (...) 
5502     {
5503       SWIG_fail;
5504     } 
5505   }
5506   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
5507   return resultobj;
5508 fail:
5509   return NULL;
5510 }
5511
5512
5513 SWIGINTERN PyObject *_wrap_cvQueryFrame(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5514   PyObject *resultobj = 0;
5515   CvCapture *arg1 = (CvCapture *) 0 ;
5516   void *argp1 = 0 ;
5517   int res1 = 0 ;
5518   PyObject * obj0 = 0 ;
5519   CvMat *result = 0 ;
5520   
5521   if (!PyArg_ParseTuple(args,(char *)"O:cvQueryFrame",&obj0)) SWIG_fail;
5522   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvCapture, 0 |  0 );
5523   if (!SWIG_IsOK(res1)) {
5524     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvQueryFrame" "', argument " "1"" of type '" "CvCapture *""'"); 
5525   }
5526   arg1 = reinterpret_cast< CvCapture * >(argp1);
5527   {
5528     try {
5529       result = (CvMat *)cvQueryFrame__CvMat(arg1); 
5530     } 
5531     catch (...) 
5532     {
5533       SWIG_fail;
5534     } 
5535   }
5536   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
5537   return resultobj;
5538 fail:
5539   return NULL;
5540 }
5541
5542
5543 SWIGINTERN PyObject *_wrap_cvInitSystem(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5544   PyObject *resultobj = 0;
5545   int arg1 ;
5546   char **arg2 = (char **) 0 ;
5547   int val1 ;
5548   int ecode1 = 0 ;
5549   void *vptr2 ;
5550   char *buffer2 ;
5551   PyObject * obj0 = 0 ;
5552   PyObject * obj1 = 0 ;
5553   int result;
5554   
5555   if (!PyArg_ParseTuple(args,(char *)"OO:cvInitSystem",&obj0,&obj1)) SWIG_fail;
5556   ecode1 = SWIG_AsVal_int(obj0, &val1);
5557   if (!SWIG_IsOK(ecode1)) {
5558     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cvInitSystem" "', argument " "1"" of type '" "int""'");
5559   } 
5560   arg1 = static_cast< int >(val1);
5561   {
5562     if ((SWIG_ConvertPtr(obj1, &vptr2, SWIGTYPE_p_char, 1)) == -1){
5563       SWIG_fail;
5564     }
5565     buffer2 = (char *) vptr2;
5566     arg2=&buffer2;
5567   }
5568   {
5569     try {
5570       result = (int)cvInitSystem(arg1,arg2); 
5571     } 
5572     catch (...) 
5573     {
5574       SWIG_fail;
5575     } 
5576   }
5577   resultobj = SWIG_From_int(static_cast< int >(result));
5578   return resultobj;
5579 fail:
5580   return NULL;
5581 }
5582
5583
5584 SWIGINTERN PyObject *_wrap_cvStartWindowThread(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5585   PyObject *resultobj = 0;
5586   int result;
5587   
5588   if (!PyArg_ParseTuple(args,(char *)":cvStartWindowThread")) SWIG_fail;
5589   {
5590     try {
5591       result = (int)cvStartWindowThread(); 
5592     } 
5593     catch (...) 
5594     {
5595       SWIG_fail;
5596     } 
5597   }
5598   resultobj = SWIG_From_int(static_cast< int >(result));
5599   return resultobj;
5600 fail:
5601   return NULL;
5602 }
5603
5604
5605 SWIGINTERN PyObject *_wrap_cvNamedWindow(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5606   PyObject *resultobj = 0;
5607   char *arg1 = (char *) 0 ;
5608   int arg2 = (int) 1 ;
5609   int res1 ;
5610   char *buf1 = 0 ;
5611   int alloc1 = 0 ;
5612   int val2 ;
5613   int ecode2 = 0 ;
5614   PyObject * obj0 = 0 ;
5615   PyObject * obj1 = 0 ;
5616   int result;
5617   
5618   if (!PyArg_ParseTuple(args,(char *)"O|O:cvNamedWindow",&obj0,&obj1)) SWIG_fail;
5619   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5620   if (!SWIG_IsOK(res1)) {
5621     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvNamedWindow" "', argument " "1"" of type '" "char const *""'");
5622   }
5623   arg1 = reinterpret_cast< char * >(buf1);
5624   if (obj1) {
5625     ecode2 = SWIG_AsVal_int(obj1, &val2);
5626     if (!SWIG_IsOK(ecode2)) {
5627       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cvNamedWindow" "', argument " "2"" of type '" "int""'");
5628     } 
5629     arg2 = static_cast< int >(val2);
5630   }
5631   {
5632     try {
5633       result = (int)cvNamedWindow((char const *)arg1,arg2); 
5634     } 
5635     catch (...) 
5636     {
5637       SWIG_fail;
5638     } 
5639   }
5640   resultobj = SWIG_From_int(static_cast< int >(result));
5641   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5642   return resultobj;
5643 fail:
5644   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5645   return NULL;
5646 }
5647
5648
5649 SWIGINTERN PyObject *_wrap_cvShowImage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5650   PyObject *resultobj = 0;
5651   char *arg1 = (char *) 0 ;
5652   CvArr *arg2 = (CvArr *) 0 ;
5653   int res1 ;
5654   char *buf1 = 0 ;
5655   int alloc1 = 0 ;
5656   bool freearg2 = false ;
5657   PyObject * obj0 = 0 ;
5658   PyObject * obj1 = 0 ;
5659   
5660   if (!PyArg_ParseTuple(args,(char *)"OO:cvShowImage",&obj0,&obj1)) SWIG_fail;
5661   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5662   if (!SWIG_IsOK(res1)) {
5663     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvShowImage" "', argument " "1"" of type '" "char const *""'");
5664   }
5665   arg1 = reinterpret_cast< char * >(buf1);
5666   {
5667     arg2 = PyObject_to_CvArr(obj1, &freearg2);
5668   }
5669   {
5670     try {
5671       cvShowImage((char const *)arg1,(void const *)arg2); 
5672     } 
5673     catch (...) 
5674     {
5675       SWIG_fail;
5676     } 
5677   }
5678   resultobj = SWIG_Py_Void();
5679   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5680   {
5681     if(arg2!=NULL && freearg2)
5682     {
5683       cvReleaseData( arg2 );
5684       cvFree(&(arg2));
5685     }
5686   }
5687   return resultobj;
5688 fail:
5689   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5690   {
5691     if(arg2!=NULL && freearg2)
5692     {
5693       cvReleaseData( arg2 );
5694       cvFree(&(arg2));
5695     }
5696   }
5697   return NULL;
5698 }
5699
5700
5701 SWIGINTERN PyObject *_wrap_cvResizeWindow(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5702   PyObject *resultobj = 0;
5703   char *arg1 = (char *) 0 ;
5704   int arg2 ;
5705   int arg3 ;
5706   int res1 ;
5707   char *buf1 = 0 ;
5708   int alloc1 = 0 ;
5709   int val2 ;
5710   int ecode2 = 0 ;
5711   int val3 ;
5712   int ecode3 = 0 ;
5713   PyObject * obj0 = 0 ;
5714   PyObject * obj1 = 0 ;
5715   PyObject * obj2 = 0 ;
5716   
5717   if (!PyArg_ParseTuple(args,(char *)"OOO:cvResizeWindow",&obj0,&obj1,&obj2)) SWIG_fail;
5718   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5719   if (!SWIG_IsOK(res1)) {
5720     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvResizeWindow" "', argument " "1"" of type '" "char const *""'");
5721   }
5722   arg1 = reinterpret_cast< char * >(buf1);
5723   ecode2 = SWIG_AsVal_int(obj1, &val2);
5724   if (!SWIG_IsOK(ecode2)) {
5725     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cvResizeWindow" "', argument " "2"" of type '" "int""'");
5726   } 
5727   arg2 = static_cast< int >(val2);
5728   ecode3 = SWIG_AsVal_int(obj2, &val3);
5729   if (!SWIG_IsOK(ecode3)) {
5730     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cvResizeWindow" "', argument " "3"" of type '" "int""'");
5731   } 
5732   arg3 = static_cast< int >(val3);
5733   {
5734     try {
5735       cvResizeWindow((char const *)arg1,arg2,arg3); 
5736     } 
5737     catch (...) 
5738     {
5739       SWIG_fail;
5740     } 
5741   }
5742   resultobj = SWIG_Py_Void();
5743   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5744   return resultobj;
5745 fail:
5746   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5747   return NULL;
5748 }
5749
5750
5751 SWIGINTERN PyObject *_wrap_cvMoveWindow(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5752   PyObject *resultobj = 0;
5753   char *arg1 = (char *) 0 ;
5754   int arg2 ;
5755   int arg3 ;
5756   int res1 ;
5757   char *buf1 = 0 ;
5758   int alloc1 = 0 ;
5759   int val2 ;
5760   int ecode2 = 0 ;
5761   int val3 ;
5762   int ecode3 = 0 ;
5763   PyObject * obj0 = 0 ;
5764   PyObject * obj1 = 0 ;
5765   PyObject * obj2 = 0 ;
5766   
5767   if (!PyArg_ParseTuple(args,(char *)"OOO:cvMoveWindow",&obj0,&obj1,&obj2)) SWIG_fail;
5768   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5769   if (!SWIG_IsOK(res1)) {
5770     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvMoveWindow" "', argument " "1"" of type '" "char const *""'");
5771   }
5772   arg1 = reinterpret_cast< char * >(buf1);
5773   ecode2 = SWIG_AsVal_int(obj1, &val2);
5774   if (!SWIG_IsOK(ecode2)) {
5775     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cvMoveWindow" "', argument " "2"" of type '" "int""'");
5776   } 
5777   arg2 = static_cast< int >(val2);
5778   ecode3 = SWIG_AsVal_int(obj2, &val3);
5779   if (!SWIG_IsOK(ecode3)) {
5780     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cvMoveWindow" "', argument " "3"" of type '" "int""'");
5781   } 
5782   arg3 = static_cast< int >(val3);
5783   {
5784     try {
5785       cvMoveWindow((char const *)arg1,arg2,arg3); 
5786     } 
5787     catch (...) 
5788     {
5789       SWIG_fail;
5790     } 
5791   }
5792   resultobj = SWIG_Py_Void();
5793   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5794   return resultobj;
5795 fail:
5796   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5797   return NULL;
5798 }
5799
5800
5801 SWIGINTERN PyObject *_wrap_cvDestroyWindow(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5802   PyObject *resultobj = 0;
5803   char *arg1 = (char *) 0 ;
5804   int res1 ;
5805   char *buf1 = 0 ;
5806   int alloc1 = 0 ;
5807   PyObject * obj0 = 0 ;
5808   
5809   if (!PyArg_ParseTuple(args,(char *)"O:cvDestroyWindow",&obj0)) SWIG_fail;
5810   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5811   if (!SWIG_IsOK(res1)) {
5812     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvDestroyWindow" "', argument " "1"" of type '" "char const *""'");
5813   }
5814   arg1 = reinterpret_cast< char * >(buf1);
5815   {
5816     try {
5817       cvDestroyWindow((char const *)arg1); 
5818     } 
5819     catch (...) 
5820     {
5821       SWIG_fail;
5822     } 
5823   }
5824   resultobj = SWIG_Py_Void();
5825   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5826   return resultobj;
5827 fail:
5828   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5829   return NULL;
5830 }
5831
5832
5833 SWIGINTERN PyObject *_wrap_cvDestroyAllWindows(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5834   PyObject *resultobj = 0;
5835   
5836   if (!PyArg_ParseTuple(args,(char *)":cvDestroyAllWindows")) SWIG_fail;
5837   {
5838     try {
5839       cvDestroyAllWindows(); 
5840     } 
5841     catch (...) 
5842     {
5843       SWIG_fail;
5844     } 
5845   }
5846   resultobj = SWIG_Py_Void();
5847   return resultobj;
5848 fail:
5849   return NULL;
5850 }
5851
5852
5853 SWIGINTERN PyObject *_wrap_cvGetWindowHandle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5854   PyObject *resultobj = 0;
5855   char *arg1 = (char *) 0 ;
5856   int res1 ;
5857   char *buf1 = 0 ;
5858   int alloc1 = 0 ;
5859   PyObject * obj0 = 0 ;
5860   void *result = 0 ;
5861   
5862   if (!PyArg_ParseTuple(args,(char *)"O:cvGetWindowHandle",&obj0)) SWIG_fail;
5863   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5864   if (!SWIG_IsOK(res1)) {
5865     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvGetWindowHandle" "', argument " "1"" of type '" "char const *""'");
5866   }
5867   arg1 = reinterpret_cast< char * >(buf1);
5868   {
5869     try {
5870       result = (void *)cvGetWindowHandle((char const *)arg1); 
5871     } 
5872     catch (...) 
5873     {
5874       SWIG_fail;
5875     } 
5876   }
5877   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
5878   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5879   return resultobj;
5880 fail:
5881   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5882   return NULL;
5883 }
5884
5885
5886 SWIGINTERN PyObject *_wrap_cvGetWindowName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5887   PyObject *resultobj = 0;
5888   void *arg1 = (void *) 0 ;
5889   int res1 ;
5890   PyObject * obj0 = 0 ;
5891   char *result = 0 ;
5892   
5893   if (!PyArg_ParseTuple(args,(char *)"O:cvGetWindowName",&obj0)) SWIG_fail;
5894   res1 = SWIG_ConvertPtr(obj0,SWIG_as_voidptrptr(&arg1), 0, 0);
5895   if (!SWIG_IsOK(res1)) {
5896     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvGetWindowName" "', argument " "1"" of type '" "void *""'"); 
5897   }
5898   {
5899     try {
5900       result = (char *)cvGetWindowName(arg1); 
5901     } 
5902     catch (...) 
5903     {
5904       SWIG_fail;
5905     } 
5906   }
5907   resultobj = SWIG_FromCharPtr((const char *)result);
5908   return resultobj;
5909 fail:
5910   return NULL;
5911 }
5912
5913
5914 SWIGINTERN PyObject *_wrap_cvCreateTrackbar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5915   PyObject *resultobj = 0;
5916   char *arg1 = (char *) 0 ;
5917   char *arg2 = (char *) 0 ;
5918   int *arg3 = (int *) 0 ;
5919   int arg4 ;
5920   CvTrackbarCallback arg5 = (CvTrackbarCallback) 0 ;
5921   int res1 ;
5922   char *buf1 = 0 ;
5923   int alloc1 = 0 ;
5924   int res2 ;
5925   char *buf2 = 0 ;
5926   int alloc2 = 0 ;
5927   int val4 ;
5928   int ecode4 = 0 ;
5929   PyObject * obj0 = 0 ;
5930   PyObject * obj1 = 0 ;
5931   PyObject * obj2 = 0 ;
5932   PyObject * obj3 = 0 ;
5933   PyObject * obj4 = 0 ;
5934   int result;
5935   
5936   if (!PyArg_ParseTuple(args,(char *)"OOOOO:cvCreateTrackbar",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
5937   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
5938   if (!SWIG_IsOK(res1)) {
5939     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvCreateTrackbar" "', argument " "1"" of type '" "char const *""'");
5940   }
5941   arg1 = reinterpret_cast< char * >(buf1);
5942   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
5943   if (!SWIG_IsOK(res2)) {
5944     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "cvCreateTrackbar" "', argument " "2"" of type '" "char const *""'");
5945   }
5946   arg2 = reinterpret_cast< char * >(buf2);
5947   {
5948     arg3 = (int *)malloc (sizeof (int));
5949     *arg3 = PyInt_AsLong (obj2);
5950   }
5951   ecode4 = SWIG_AsVal_int(obj3, &val4);
5952   if (!SWIG_IsOK(ecode4)) {
5953     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "cvCreateTrackbar" "', argument " "4"" of type '" "int""'");
5954   } 
5955   arg4 = static_cast< int >(val4);
5956   {
5957     if(my_trackbar_cb_size == ICV_PY_MAX_CB){
5958       SWIG_exception(SWIG_IndexError, "Exceeded maximum number of trackbars");
5959     }
5960     
5961     my_trackbar_cb_size++;
5962     
5963     if (!PyCallable_Check(obj4)) {
5964       PyErr_SetString(PyExc_TypeError, "parameter must be callable");
5965       return 0;
5966     }
5967     Py_XINCREF((PyObject*) obj4);         /* Add a reference to new callback */
5968     Py_XDECREF(my_trackbar_cb_funcs[my_trackbar_cb_size-1].py_func);  /* Dispose of previous callback */
5969     my_trackbar_cb_funcs[my_trackbar_cb_size-1].py_func = (PyObject *) obj4;
5970     
5971     /* prepare to call the C function who will register the callback */
5972     arg5 = my_trackbar_cb_funcs[ my_trackbar_cb_size-1 ].cv_func;
5973   }
5974   {
5975     try {
5976       result = (int)cvCreateTrackbar((char const *)arg1,(char const *)arg2,arg3,arg4,arg5); 
5977     } 
5978     catch (...) 
5979     {
5980       SWIG_fail;
5981     } 
5982   }
5983   resultobj = SWIG_From_int(static_cast< int >(result));
5984   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5985   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
5986   return resultobj;
5987 fail:
5988   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
5989   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
5990   return NULL;
5991 }
5992
5993
5994 SWIGINTERN PyObject *_wrap_cvCreateTrackbar2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5995   PyObject *resultobj = 0;
5996   char *arg1 = (char *) 0 ;
5997   char *arg2 = (char *) 0 ;
5998   int *arg3 = (int *) 0 ;
5999   int arg4 ;
6000   CvTrackbarCallback2 arg5 = (CvTrackbarCallback2) 0 ;
6001   void *arg6 = (void *) 0 ;
6002   int res1 ;
6003   char *buf1 = 0 ;
6004   int alloc1 = 0 ;
6005   int res2 ;
6006   char *buf2 = 0 ;
6007   int alloc2 = 0 ;
6008   int val4 ;
6009   int ecode4 = 0 ;
6010   int res6 ;
6011   PyObject * obj0 = 0 ;
6012   PyObject * obj1 = 0 ;
6013   PyObject * obj2 = 0 ;
6014   PyObject * obj3 = 0 ;
6015   PyObject * obj4 = 0 ;
6016   PyObject * obj5 = 0 ;
6017   int result;
6018   
6019   if (!PyArg_ParseTuple(args,(char *)"OOOOO|O:cvCreateTrackbar2",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
6020   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
6021   if (!SWIG_IsOK(res1)) {
6022     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvCreateTrackbar2" "', argument " "1"" of type '" "char const *""'");
6023   }
6024   arg1 = reinterpret_cast< char * >(buf1);
6025   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
6026   if (!SWIG_IsOK(res2)) {
6027     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "cvCreateTrackbar2" "', argument " "2"" of type '" "char const *""'");
6028   }
6029   arg2 = reinterpret_cast< char * >(buf2);
6030   {
6031     arg3 = (int *)malloc (sizeof (int));
6032     *arg3 = PyInt_AsLong (obj2);
6033   }
6034   ecode4 = SWIG_AsVal_int(obj3, &val4);
6035   if (!SWIG_IsOK(ecode4)) {
6036     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "cvCreateTrackbar2" "', argument " "4"" of type '" "int""'");
6037   } 
6038   arg4 = static_cast< int >(val4);
6039   {
6040     int res = SWIG_ConvertFunctionPtr(obj4, (void**)(&arg5), SWIGTYPE_p_f_int_p_void__void);
6041     if (!SWIG_IsOK(res)) {
6042       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "cvCreateTrackbar2" "', argument " "5"" of type '" "CvTrackbarCallback2""'"); 
6043     }
6044   }
6045   if (obj5) {
6046     res6 = SWIG_ConvertPtr(obj5,SWIG_as_voidptrptr(&arg6), 0, 0);
6047     if (!SWIG_IsOK(res6)) {
6048       SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "cvCreateTrackbar2" "', argument " "6"" of type '" "void *""'"); 
6049     }
6050   }
6051   {
6052     try {
6053       result = (int)cvCreateTrackbar2((char const *)arg1,(char const *)arg2,arg3,arg4,arg5,arg6); 
6054     } 
6055     catch (...) 
6056     {
6057       SWIG_fail;
6058     } 
6059   }
6060   resultobj = SWIG_From_int(static_cast< int >(result));
6061   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6062   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
6063   return resultobj;
6064 fail:
6065   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6066   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
6067   return NULL;
6068 }
6069
6070
6071 SWIGINTERN PyObject *_wrap_cvGetTrackbarPos(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6072   PyObject *resultobj = 0;
6073   char *arg1 = (char *) 0 ;
6074   char *arg2 = (char *) 0 ;
6075   int res1 ;
6076   char *buf1 = 0 ;
6077   int alloc1 = 0 ;
6078   int res2 ;
6079   char *buf2 = 0 ;
6080   int alloc2 = 0 ;
6081   PyObject * obj0 = 0 ;
6082   PyObject * obj1 = 0 ;
6083   int result;
6084   
6085   if (!PyArg_ParseTuple(args,(char *)"OO:cvGetTrackbarPos",&obj0,&obj1)) SWIG_fail;
6086   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
6087   if (!SWIG_IsOK(res1)) {
6088     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvGetTrackbarPos" "', argument " "1"" of type '" "char const *""'");
6089   }
6090   arg1 = reinterpret_cast< char * >(buf1);
6091   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
6092   if (!SWIG_IsOK(res2)) {
6093     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "cvGetTrackbarPos" "', argument " "2"" of type '" "char const *""'");
6094   }
6095   arg2 = reinterpret_cast< char * >(buf2);
6096   {
6097     try {
6098       result = (int)cvGetTrackbarPos((char const *)arg1,(char const *)arg2); 
6099     } 
6100     catch (...) 
6101     {
6102       SWIG_fail;
6103     } 
6104   }
6105   resultobj = SWIG_From_int(static_cast< int >(result));
6106   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6107   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
6108   return resultobj;
6109 fail:
6110   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6111   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
6112   return NULL;
6113 }
6114
6115
6116 SWIGINTERN PyObject *_wrap_cvSetTrackbarPos(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6117   PyObject *resultobj = 0;
6118   char *arg1 = (char *) 0 ;
6119   char *arg2 = (char *) 0 ;
6120   int arg3 ;
6121   int res1 ;
6122   char *buf1 = 0 ;
6123   int alloc1 = 0 ;
6124   int res2 ;
6125   char *buf2 = 0 ;
6126   int alloc2 = 0 ;
6127   int val3 ;
6128   int ecode3 = 0 ;
6129   PyObject * obj0 = 0 ;
6130   PyObject * obj1 = 0 ;
6131   PyObject * obj2 = 0 ;
6132   
6133   if (!PyArg_ParseTuple(args,(char *)"OOO:cvSetTrackbarPos",&obj0,&obj1,&obj2)) SWIG_fail;
6134   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
6135   if (!SWIG_IsOK(res1)) {
6136     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvSetTrackbarPos" "', argument " "1"" of type '" "char const *""'");
6137   }
6138   arg1 = reinterpret_cast< char * >(buf1);
6139   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
6140   if (!SWIG_IsOK(res2)) {
6141     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "cvSetTrackbarPos" "', argument " "2"" of type '" "char const *""'");
6142   }
6143   arg2 = reinterpret_cast< char * >(buf2);
6144   ecode3 = SWIG_AsVal_int(obj2, &val3);
6145   if (!SWIG_IsOK(ecode3)) {
6146     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cvSetTrackbarPos" "', argument " "3"" of type '" "int""'");
6147   } 
6148   arg3 = static_cast< int >(val3);
6149   {
6150     try {
6151       cvSetTrackbarPos((char const *)arg1,(char const *)arg2,arg3); 
6152     } 
6153     catch (...) 
6154     {
6155       SWIG_fail;
6156     } 
6157   }
6158   resultobj = SWIG_Py_Void();
6159   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6160   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
6161   return resultobj;
6162 fail:
6163   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6164   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
6165   return NULL;
6166 }
6167
6168
6169 SWIGINTERN PyObject *_wrap_cvSetMouseCallbackOld(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6170   PyObject *resultobj = 0;
6171   char *arg1 = (char *) 0 ;
6172   CvMouseCallback arg2 = (CvMouseCallback) 0 ;
6173   void *arg3 = (void *) NULL ;
6174   int res1 ;
6175   char *buf1 = 0 ;
6176   int alloc1 = 0 ;
6177   int res3 ;
6178   PyObject * obj0 = 0 ;
6179   PyObject * obj1 = 0 ;
6180   PyObject * obj2 = 0 ;
6181   
6182   if (!PyArg_ParseTuple(args,(char *)"OO|O:cvSetMouseCallbackOld",&obj0,&obj1,&obj2)) SWIG_fail;
6183   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
6184   if (!SWIG_IsOK(res1)) {
6185     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvSetMouseCallbackOld" "', argument " "1"" of type '" "char const *""'");
6186   }
6187   arg1 = reinterpret_cast< char * >(buf1);
6188   {
6189     int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_int_int_int_int_p_void__void);
6190     if (!SWIG_IsOK(res)) {
6191       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "cvSetMouseCallbackOld" "', argument " "2"" of type '" "CvMouseCallback""'"); 
6192     }
6193   }
6194   if (obj2) {
6195     res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
6196     if (!SWIG_IsOK(res3)) {
6197       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "cvSetMouseCallbackOld" "', argument " "3"" of type '" "void *""'"); 
6198     }
6199   }
6200   {
6201     try {
6202       cvSetMouseCallback((char const *)arg1,arg2,arg3); 
6203     } 
6204     catch (...) 
6205     {
6206       SWIG_fail;
6207     } 
6208   }
6209   resultobj = SWIG_Py_Void();
6210   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6211   return resultobj;
6212 fail:
6213   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6214   return NULL;
6215 }
6216
6217
6218 SWIGINTERN PyObject *_wrap_cvLoadImageM(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6219   PyObject *resultobj = 0;
6220   char *arg1 = (char *) 0 ;
6221   int arg2 = (int) 1 ;
6222   int res1 ;
6223   char *buf1 = 0 ;
6224   int alloc1 = 0 ;
6225   int val2 ;
6226   int ecode2 = 0 ;
6227   PyObject * obj0 = 0 ;
6228   PyObject * obj1 = 0 ;
6229   CvMat *result = 0 ;
6230   
6231   if (!PyArg_ParseTuple(args,(char *)"O|O:cvLoadImageM",&obj0,&obj1)) SWIG_fail;
6232   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
6233   if (!SWIG_IsOK(res1)) {
6234     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvLoadImageM" "', argument " "1"" of type '" "char const *""'");
6235   }
6236   arg1 = reinterpret_cast< char * >(buf1);
6237   if (obj1) {
6238     ecode2 = SWIG_AsVal_int(obj1, &val2);
6239     if (!SWIG_IsOK(ecode2)) {
6240       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cvLoadImageM" "', argument " "2"" of type '" "int""'");
6241     } 
6242     arg2 = static_cast< int >(val2);
6243   }
6244   {
6245     try {
6246       result = (CvMat *)cvLoadImageM((char const *)arg1,arg2); 
6247     } 
6248     catch (...) 
6249     {
6250       SWIG_fail;
6251     } 
6252   }
6253   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, SWIG_POINTER_OWN |  0 );
6254   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6255   return resultobj;
6256 fail:
6257   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6258   return NULL;
6259 }
6260
6261
6262 SWIGINTERN PyObject *_wrap_cvSaveImage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6263   PyObject *resultobj = 0;
6264   char *arg1 = (char *) 0 ;
6265   CvArr *arg2 = (CvArr *) 0 ;
6266   int *arg3 = (int *) 0 ;
6267   int res1 ;
6268   char *buf1 = 0 ;
6269   int alloc1 = 0 ;
6270   bool freearg2 = false ;
6271   void *argp3 = 0 ;
6272   int res3 = 0 ;
6273   PyObject * obj0 = 0 ;
6274   PyObject * obj1 = 0 ;
6275   PyObject * obj2 = 0 ;
6276   int result;
6277   
6278   if (!PyArg_ParseTuple(args,(char *)"OO|O:cvSaveImage",&obj0,&obj1,&obj2)) SWIG_fail;
6279   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
6280   if (!SWIG_IsOK(res1)) {
6281     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvSaveImage" "', argument " "1"" of type '" "char const *""'");
6282   }
6283   arg1 = reinterpret_cast< char * >(buf1);
6284   {
6285     arg2 = PyObject_to_CvArr(obj1, &freearg2);
6286   }
6287   if (obj2) {
6288     res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 |  0 );
6289     if (!SWIG_IsOK(res3)) {
6290       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "cvSaveImage" "', argument " "3"" of type '" "int const *""'"); 
6291     }
6292     arg3 = reinterpret_cast< int * >(argp3);
6293   }
6294   {
6295     try {
6296       result = (int)cvSaveImage((char const *)arg1,(void const *)arg2,(int const *)arg3); 
6297     } 
6298     catch (...) 
6299     {
6300       SWIG_fail;
6301     } 
6302   }
6303   resultobj = SWIG_From_int(static_cast< int >(result));
6304   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6305   {
6306     if(arg2!=NULL && freearg2)
6307     {
6308       cvReleaseData( arg2 );
6309       cvFree(&(arg2));
6310     }
6311   }
6312   return resultobj;
6313 fail:
6314   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6315   {
6316     if(arg2!=NULL && freearg2)
6317     {
6318       cvReleaseData( arg2 );
6319       cvFree(&(arg2));
6320     }
6321   }
6322   return NULL;
6323 }
6324
6325
6326 SWIGINTERN PyObject *_wrap_cvDecodeImage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6327   PyObject *resultobj = 0;
6328   CvMat *arg1 = (CvMat *) 0 ;
6329   int arg2 = (int) 1 ;
6330   bool freearg1 = false ;
6331   int val2 ;
6332   int ecode2 = 0 ;
6333   PyObject * obj0 = 0 ;
6334   PyObject * obj1 = 0 ;
6335   IplImage *result = 0 ;
6336   
6337   if (!PyArg_ParseTuple(args,(char *)"O|O:cvDecodeImage",&obj0,&obj1)) SWIG_fail;
6338   {
6339     arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
6340   }
6341   if (obj1) {
6342     ecode2 = SWIG_AsVal_int(obj1, &val2);
6343     if (!SWIG_IsOK(ecode2)) {
6344       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cvDecodeImage" "', argument " "2"" of type '" "int""'");
6345     } 
6346     arg2 = static_cast< int >(val2);
6347   }
6348   {
6349     try {
6350       result = (IplImage *)cvDecodeImage((CvMat const *)arg1,arg2); 
6351     } 
6352     catch (...) 
6353     {
6354       SWIG_fail;
6355     } 
6356   }
6357   {
6358     SWIG_exception( SWIG_TypeError, "IplImage * return type is deprecated. Please file a bug report at www.sourceforge.net/opencvlibrary if you see this error message.");
6359     SWIG_fail;
6360   }
6361   {
6362     if(arg1!=NULL && freearg1){
6363       cvReleaseData( arg1 );
6364       cvFree(&(arg1));
6365     }
6366   }
6367   return resultobj;
6368 fail:
6369   {
6370     if(arg1!=NULL && freearg1){
6371       cvReleaseData( arg1 );
6372       cvFree(&(arg1));
6373     }
6374   }
6375   return NULL;
6376 }
6377
6378
6379 SWIGINTERN PyObject *_wrap_cvDecodeImageM(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6380   PyObject *resultobj = 0;
6381   CvMat *arg1 = (CvMat *) 0 ;
6382   int arg2 = (int) 1 ;
6383   bool freearg1 = false ;
6384   int val2 ;
6385   int ecode2 = 0 ;
6386   PyObject * obj0 = 0 ;
6387   PyObject * obj1 = 0 ;
6388   CvMat *result = 0 ;
6389   
6390   if (!PyArg_ParseTuple(args,(char *)"O|O:cvDecodeImageM",&obj0,&obj1)) SWIG_fail;
6391   {
6392     arg1 = (CvMat*)PyObject_to_CvArr(obj0, &freearg1);
6393   }
6394   if (obj1) {
6395     ecode2 = SWIG_AsVal_int(obj1, &val2);
6396     if (!SWIG_IsOK(ecode2)) {
6397       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cvDecodeImageM" "', argument " "2"" of type '" "int""'");
6398     } 
6399     arg2 = static_cast< int >(val2);
6400   }
6401   {
6402     try {
6403       result = (CvMat *)cvDecodeImageM((CvMat const *)arg1,arg2); 
6404     } 
6405     catch (...) 
6406     {
6407       SWIG_fail;
6408     } 
6409   }
6410   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
6411   {
6412     if(arg1!=NULL && freearg1){
6413       cvReleaseData( arg1 );
6414       cvFree(&(arg1));
6415     }
6416   }
6417   return resultobj;
6418 fail:
6419   {
6420     if(arg1!=NULL && freearg1){
6421       cvReleaseData( arg1 );
6422       cvFree(&(arg1));
6423     }
6424   }
6425   return NULL;
6426 }
6427
6428
6429 SWIGINTERN PyObject *_wrap_cvEncodeImage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6430   PyObject *resultobj = 0;
6431   char *arg1 = (char *) 0 ;
6432   CvArr *arg2 = (CvArr *) 0 ;
6433   int *arg3 = (int *) 0 ;
6434   int res1 ;
6435   char *buf1 = 0 ;
6436   int alloc1 = 0 ;
6437   bool freearg2 = false ;
6438   void *argp3 = 0 ;
6439   int res3 = 0 ;
6440   PyObject * obj0 = 0 ;
6441   PyObject * obj1 = 0 ;
6442   PyObject * obj2 = 0 ;
6443   CvMat *result = 0 ;
6444   
6445   if (!PyArg_ParseTuple(args,(char *)"OO|O:cvEncodeImage",&obj0,&obj1,&obj2)) SWIG_fail;
6446   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
6447   if (!SWIG_IsOK(res1)) {
6448     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvEncodeImage" "', argument " "1"" of type '" "char const *""'");
6449   }
6450   arg1 = reinterpret_cast< char * >(buf1);
6451   {
6452     arg2 = PyObject_to_CvArr(obj1, &freearg2);
6453   }
6454   if (obj2) {
6455     res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 |  0 );
6456     if (!SWIG_IsOK(res3)) {
6457       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "cvEncodeImage" "', argument " "3"" of type '" "int const *""'"); 
6458     }
6459     arg3 = reinterpret_cast< int * >(argp3);
6460   }
6461   {
6462     try {
6463       result = (CvMat *)cvEncodeImage((char const *)arg1,(void const *)arg2,(int const *)arg3); 
6464     } 
6465     catch (...) 
6466     {
6467       SWIG_fail;
6468     } 
6469   }
6470   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvMat, 0 |  0 );
6471   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6472   {
6473     if(arg2!=NULL && freearg2)
6474     {
6475       cvReleaseData( arg2 );
6476       cvFree(&(arg2));
6477     }
6478   }
6479   return resultobj;
6480 fail:
6481   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6482   {
6483     if(arg2!=NULL && freearg2)
6484     {
6485       cvReleaseData( arg2 );
6486       cvFree(&(arg2));
6487     }
6488   }
6489   return NULL;
6490 }
6491
6492
6493 SWIGINTERN PyObject *_wrap_cvConvertImage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6494   PyObject *resultobj = 0;
6495   CvArr *arg1 = (CvArr *) 0 ;
6496   CvArr *arg2 = (CvArr *) 0 ;
6497   int arg3 = (int) 0 ;
6498   bool freearg1 = false ;
6499   bool freearg2 = false ;
6500   int val3 ;
6501   int ecode3 = 0 ;
6502   PyObject * obj0 = 0 ;
6503   PyObject * obj1 = 0 ;
6504   PyObject * obj2 = 0 ;
6505   
6506   if (!PyArg_ParseTuple(args,(char *)"OO|O:cvConvertImage",&obj0,&obj1,&obj2)) SWIG_fail;
6507   {
6508     arg1 = PyObject_to_CvArr(obj0, &freearg1);
6509   }
6510   {
6511     arg2 = PyObject_to_CvArr(obj1, &freearg2);
6512   }
6513   if (obj2) {
6514     ecode3 = SWIG_AsVal_int(obj2, &val3);
6515     if (!SWIG_IsOK(ecode3)) {
6516       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cvConvertImage" "', argument " "3"" of type '" "int""'");
6517     } 
6518     arg3 = static_cast< int >(val3);
6519   }
6520   {
6521     try {
6522       cvConvertImage((void const *)arg1,arg2,arg3); 
6523     } 
6524     catch (...) 
6525     {
6526       SWIG_fail;
6527     } 
6528   }
6529   resultobj = SWIG_Py_Void();
6530   {
6531     if(arg1!=NULL && freearg1)
6532     {
6533       cvReleaseData( arg1 );
6534       cvFree(&(arg1));
6535     }
6536   }
6537   {
6538     if(arg2!=NULL && freearg2)
6539     {
6540       cvReleaseData( arg2 );
6541       cvFree(&(arg2));
6542     }
6543   }
6544   return resultobj;
6545 fail:
6546   {
6547     if(arg1!=NULL && freearg1)
6548     {
6549       cvReleaseData( arg1 );
6550       cvFree(&(arg1));
6551     }
6552   }
6553   {
6554     if(arg2!=NULL && freearg2)
6555     {
6556       cvReleaseData( arg2 );
6557       cvFree(&(arg2));
6558     }
6559   }
6560   return NULL;
6561 }
6562
6563
6564 SWIGINTERN PyObject *_wrap_cvWaitKeyC(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6565   PyObject *resultobj = 0;
6566   int arg1 = (int) 0 ;
6567   int val1 ;
6568   int ecode1 = 0 ;
6569   PyObject * obj0 = 0 ;
6570   int result;
6571   
6572   if (!PyArg_ParseTuple(args,(char *)"|O:cvWaitKeyC",&obj0)) SWIG_fail;
6573   if (obj0) {
6574     ecode1 = SWIG_AsVal_int(obj0, &val1);
6575     if (!SWIG_IsOK(ecode1)) {
6576       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cvWaitKeyC" "', argument " "1"" of type '" "int""'");
6577     } 
6578     arg1 = static_cast< int >(val1);
6579   }
6580   {
6581     try {
6582       result = (int)cvWaitKey(arg1); 
6583     } 
6584     catch (...) 
6585     {
6586       SWIG_fail;
6587     } 
6588   }
6589   resultobj = SWIG_From_int(static_cast< int >(result));
6590   return resultobj;
6591 fail:
6592   return NULL;
6593 }
6594
6595
6596 SWIGINTERN PyObject *_wrap_cvCreateFileCapture(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6597   PyObject *resultobj = 0;
6598   char *arg1 = (char *) 0 ;
6599   int res1 ;
6600   char *buf1 = 0 ;
6601   int alloc1 = 0 ;
6602   PyObject * obj0 = 0 ;
6603   CvCapture *result = 0 ;
6604   
6605   if (!PyArg_ParseTuple(args,(char *)"O:cvCreateFileCapture",&obj0)) SWIG_fail;
6606   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
6607   if (!SWIG_IsOK(res1)) {
6608     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvCreateFileCapture" "', argument " "1"" of type '" "char const *""'");
6609   }
6610   arg1 = reinterpret_cast< char * >(buf1);
6611   {
6612     try {
6613       result = (CvCapture *)cvCreateFileCapture((char const *)arg1); 
6614     } 
6615     catch (...) 
6616     {
6617       SWIG_fail;
6618     } 
6619   }
6620   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvCapture, 0 |  0 );
6621   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6622   return resultobj;
6623 fail:
6624   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
6625   return NULL;
6626 }
6627
6628
6629 SWIGINTERN PyObject *_wrap_cvCreateCameraCapture(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6630   PyObject *resultobj = 0;
6631   int arg1 ;
6632   int val1 ;
6633   int ecode1 = 0 ;
6634   PyObject * obj0 = 0 ;
6635   CvCapture *result = 0 ;
6636   
6637   if (!PyArg_ParseTuple(args,(char *)"O:cvCreateCameraCapture",&obj0)) SWIG_fail;
6638   ecode1 = SWIG_AsVal_int(obj0, &val1);
6639   if (!SWIG_IsOK(ecode1)) {
6640     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cvCreateCameraCapture" "', argument " "1"" of type '" "int""'");
6641   } 
6642   arg1 = static_cast< int >(val1);
6643   {
6644     try {
6645       result = (CvCapture *)cvCreateCameraCapture(arg1); 
6646     } 
6647     catch (...) 
6648     {
6649       SWIG_fail;
6650     } 
6651   }
6652   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvCapture, 0 |  0 );
6653   return resultobj;
6654 fail:
6655   return NULL;
6656 }
6657
6658
6659 SWIGINTERN PyObject *_wrap_cvGrabFrame(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6660   PyObject *resultobj = 0;
6661   CvCapture *arg1 = (CvCapture *) 0 ;
6662   void *argp1 = 0 ;
6663   int res1 = 0 ;
6664   PyObject * obj0 = 0 ;
6665   int result;
6666   
6667   if (!PyArg_ParseTuple(args,(char *)"O:cvGrabFrame",&obj0)) SWIG_fail;
6668   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvCapture, 0 |  0 );
6669   if (!SWIG_IsOK(res1)) {
6670     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvGrabFrame" "', argument " "1"" of type '" "CvCapture *""'"); 
6671   }
6672   arg1 = reinterpret_cast< CvCapture * >(argp1);
6673   {
6674     try {
6675       result = (int)cvGrabFrame(arg1); 
6676     } 
6677     catch (...) 
6678     {
6679       SWIG_fail;
6680     } 
6681   }
6682   resultobj = SWIG_From_int(static_cast< int >(result));
6683   return resultobj;
6684 fail:
6685   return NULL;
6686 }
6687
6688
6689 SWIGINTERN PyObject *_wrap_cvRetrieveFrame__Deprecated(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6690   PyObject *resultobj = 0;
6691   CvCapture *arg1 = (CvCapture *) 0 ;
6692   int arg2 = (int) 0 ;
6693   void *argp1 = 0 ;
6694   int res1 = 0 ;
6695   int val2 ;
6696   int ecode2 = 0 ;
6697   PyObject * obj0 = 0 ;
6698   PyObject * obj1 = 0 ;
6699   IplImage *result = 0 ;
6700   
6701   if (!PyArg_ParseTuple(args,(char *)"O|O:cvRetrieveFrame__Deprecated",&obj0,&obj1)) SWIG_fail;
6702   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvCapture, 0 |  0 );
6703   if (!SWIG_IsOK(res1)) {
6704     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvRetrieveFrame__Deprecated" "', argument " "1"" of type '" "CvCapture *""'"); 
6705   }
6706   arg1 = reinterpret_cast< CvCapture * >(argp1);
6707   if (obj1) {
6708     ecode2 = SWIG_AsVal_int(obj1, &val2);
6709     if (!SWIG_IsOK(ecode2)) {
6710       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cvRetrieveFrame__Deprecated" "', argument " "2"" of type '" "int""'");
6711     } 
6712     arg2 = static_cast< int >(val2);
6713   }
6714   {
6715     try {
6716       result = (IplImage *)cvRetrieveFrame(arg1,arg2); 
6717     } 
6718     catch (...) 
6719     {
6720       SWIG_fail;
6721     } 
6722   }
6723   {
6724     SWIG_exception( SWIG_TypeError, "IplImage * return type is deprecated. Please file a bug report at www.sourceforge.net/opencvlibrary if you see this error message.");
6725     SWIG_fail;
6726   }
6727   return resultobj;
6728 fail:
6729   return NULL;
6730 }
6731
6732
6733 SWIGINTERN PyObject *_wrap_cvQueryFrame__Deprecated(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6734   PyObject *resultobj = 0;
6735   CvCapture *arg1 = (CvCapture *) 0 ;
6736   void *argp1 = 0 ;
6737   int res1 = 0 ;
6738   PyObject * obj0 = 0 ;
6739   IplImage *result = 0 ;
6740   
6741   if (!PyArg_ParseTuple(args,(char *)"O:cvQueryFrame__Deprecated",&obj0)) SWIG_fail;
6742   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvCapture, 0 |  0 );
6743   if (!SWIG_IsOK(res1)) {
6744     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvQueryFrame__Deprecated" "', argument " "1"" of type '" "CvCapture *""'"); 
6745   }
6746   arg1 = reinterpret_cast< CvCapture * >(argp1);
6747   {
6748     try {
6749       result = (IplImage *)cvQueryFrame(arg1); 
6750     } 
6751     catch (...) 
6752     {
6753       SWIG_fail;
6754     } 
6755   }
6756   {
6757     SWIG_exception( SWIG_TypeError, "IplImage * return type is deprecated. Please file a bug report at www.sourceforge.net/opencvlibrary if you see this error message.");
6758     SWIG_fail;
6759   }
6760   return resultobj;
6761 fail:
6762   return NULL;
6763 }
6764
6765
6766 SWIGINTERN PyObject *_wrap_cvGetCaptureProperty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6767   PyObject *resultobj = 0;
6768   CvCapture *arg1 = (CvCapture *) 0 ;
6769   int arg2 ;
6770   void *argp1 = 0 ;
6771   int res1 = 0 ;
6772   int val2 ;
6773   int ecode2 = 0 ;
6774   PyObject * obj0 = 0 ;
6775   PyObject * obj1 = 0 ;
6776   double result;
6777   
6778   if (!PyArg_ParseTuple(args,(char *)"OO:cvGetCaptureProperty",&obj0,&obj1)) SWIG_fail;
6779   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvCapture, 0 |  0 );
6780   if (!SWIG_IsOK(res1)) {
6781     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvGetCaptureProperty" "', argument " "1"" of type '" "CvCapture *""'"); 
6782   }
6783   arg1 = reinterpret_cast< CvCapture * >(argp1);
6784   ecode2 = SWIG_AsVal_int(obj1, &val2);
6785   if (!SWIG_IsOK(ecode2)) {
6786     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cvGetCaptureProperty" "', argument " "2"" of type '" "int""'");
6787   } 
6788   arg2 = static_cast< int >(val2);
6789   {
6790     try {
6791       result = (double)cvGetCaptureProperty(arg1,arg2); 
6792     } 
6793     catch (...) 
6794     {
6795       SWIG_fail;
6796     } 
6797   }
6798   resultobj = SWIG_From_double(static_cast< double >(result));
6799   return resultobj;
6800 fail:
6801   return NULL;
6802 }
6803
6804
6805 SWIGINTERN PyObject *_wrap_cvSetCaptureProperty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6806   PyObject *resultobj = 0;
6807   CvCapture *arg1 = (CvCapture *) 0 ;
6808   int arg2 ;
6809   double arg3 ;
6810   void *argp1 = 0 ;
6811   int res1 = 0 ;
6812   int val2 ;
6813   int ecode2 = 0 ;
6814   double val3 ;
6815   int ecode3 = 0 ;
6816   PyObject * obj0 = 0 ;
6817   PyObject * obj1 = 0 ;
6818   PyObject * obj2 = 0 ;
6819   int result;
6820   
6821   if (!PyArg_ParseTuple(args,(char *)"OOO:cvSetCaptureProperty",&obj0,&obj1,&obj2)) SWIG_fail;
6822   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvCapture, 0 |  0 );
6823   if (!SWIG_IsOK(res1)) {
6824     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvSetCaptureProperty" "', argument " "1"" of type '" "CvCapture *""'"); 
6825   }
6826   arg1 = reinterpret_cast< CvCapture * >(argp1);
6827   ecode2 = SWIG_AsVal_int(obj1, &val2);
6828   if (!SWIG_IsOK(ecode2)) {
6829     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cvSetCaptureProperty" "', argument " "2"" of type '" "int""'");
6830   } 
6831   arg2 = static_cast< int >(val2);
6832   ecode3 = SWIG_AsVal_double(obj2, &val3);
6833   if (!SWIG_IsOK(ecode3)) {
6834     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cvSetCaptureProperty" "', argument " "3"" of type '" "double""'");
6835   } 
6836   arg3 = static_cast< double >(val3);
6837   {
6838     try {
6839       result = (int)cvSetCaptureProperty(arg1,arg2,arg3); 
6840     } 
6841     catch (...) 
6842     {
6843       SWIG_fail;
6844     } 
6845   }
6846   resultobj = SWIG_From_int(static_cast< int >(result));
6847   return resultobj;
6848 fail:
6849   return NULL;
6850 }
6851
6852
6853 SWIGINTERN PyObject *_wrap_cvGetCaptureDomain(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6854   PyObject *resultobj = 0;
6855   CvCapture *arg1 = (CvCapture *) 0 ;
6856   void *argp1 = 0 ;
6857   int res1 = 0 ;
6858   PyObject * obj0 = 0 ;
6859   int result;
6860   
6861   if (!PyArg_ParseTuple(args,(char *)"O:cvGetCaptureDomain",&obj0)) SWIG_fail;
6862   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvCapture, 0 |  0 );
6863   if (!SWIG_IsOK(res1)) {
6864     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvGetCaptureDomain" "', argument " "1"" of type '" "CvCapture *""'"); 
6865   }
6866   arg1 = reinterpret_cast< CvCapture * >(argp1);
6867   {
6868     try {
6869       result = (int)cvGetCaptureDomain(arg1); 
6870     } 
6871     catch (...) 
6872     {
6873       SWIG_fail;
6874     } 
6875   }
6876   resultobj = SWIG_From_int(static_cast< int >(result));
6877   return resultobj;
6878 fail:
6879   return NULL;
6880 }
6881
6882
6883 SWIGINTERN PyObject *_wrap_CV_FOURCC(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6884   PyObject *resultobj = 0;
6885   char arg1 ;
6886   char arg2 ;
6887   char arg3 ;
6888   char arg4 ;
6889   char val1 ;
6890   int ecode1 = 0 ;
6891   char val2 ;
6892   int ecode2 = 0 ;
6893   char val3 ;
6894   int ecode3 = 0 ;
6895   char val4 ;
6896   int ecode4 = 0 ;
6897   PyObject * obj0 = 0 ;
6898   PyObject * obj1 = 0 ;
6899   PyObject * obj2 = 0 ;
6900   PyObject * obj3 = 0 ;
6901   int result;
6902   
6903   if (!PyArg_ParseTuple(args,(char *)"OOOO:CV_FOURCC",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
6904   ecode1 = SWIG_AsVal_char(obj0, &val1);
6905   if (!SWIG_IsOK(ecode1)) {
6906     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "CV_FOURCC" "', argument " "1"" of type '" "char""'");
6907   } 
6908   arg1 = static_cast< char >(val1);
6909   ecode2 = SWIG_AsVal_char(obj1, &val2);
6910   if (!SWIG_IsOK(ecode2)) {
6911     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CV_FOURCC" "', argument " "2"" of type '" "char""'");
6912   } 
6913   arg2 = static_cast< char >(val2);
6914   ecode3 = SWIG_AsVal_char(obj2, &val3);
6915   if (!SWIG_IsOK(ecode3)) {
6916     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CV_FOURCC" "', argument " "3"" of type '" "char""'");
6917   } 
6918   arg3 = static_cast< char >(val3);
6919   ecode4 = SWIG_AsVal_char(obj3, &val4);
6920   if (!SWIG_IsOK(ecode4)) {
6921     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CV_FOURCC" "', argument " "4"" of type '" "char""'");
6922   } 
6923   arg4 = static_cast< char >(val4);
6924   {
6925     try {
6926       result = (int)CV_FOURCC(arg1,arg2,arg3,arg4); 
6927     } 
6928     catch (...) 
6929     {
6930       SWIG_fail;
6931     } 
6932   }
6933   resultobj = SWIG_From_int(static_cast< int >(result));
6934   return resultobj;
6935 fail:
6936   return NULL;
6937 }
6938
6939
6940 SWIGINTERN PyObject *_wrap_cvCreateVideoWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6941   PyObject *resultobj = 0;
6942   char *arg1 = (char *) 0 ;
6943   int arg2 ;
6944   double arg3 ;
6945   CvSize arg4 ;
6946   int arg5 = (int) 1 ;
6947   int res1 ;
6948   char *buf1 = 0 ;
6949   int alloc1 = 0 ;
6950   int val2 ;
6951   int ecode2 = 0 ;
6952   double val3 ;
6953   int ecode3 = 0 ;
6954   CvSize temp4 ;
6955   int val5 ;
6956   int ecode5 = 0 ;
6957   PyObject * obj0 = 0 ;
6958   PyObject * obj1 = 0 ;
6959   PyObject * obj2 = 0 ;
6960   PyObject * obj3 = 0 ;
6961   PyObject * obj4 = 0 ;
6962   CvVideoWriter *result = 0 ;
6963   
6964   if (!PyArg_ParseTuple(args,(char *)"OOOO|O:cvCreateVideoWriter",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
6965   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
6966   if (!SWIG_IsOK(res1)) {
6967     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvCreateVideoWriter" "', argument " "1"" of type '" "char const *""'");
6968   }
6969   arg1 = reinterpret_cast< char * >(buf1);
6970   ecode2 = SWIG_AsVal_int(obj1, &val2);
6971   if (!SWIG_IsOK(ecode2)) {
6972     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cvCreateVideoWriter" "', argument " "2"" of type '" "int""'");
6973   } 
6974   arg2 = static_cast< int >(val2);
6975   ecode3 = SWIG_AsVal_double(obj2, &val3);
6976   if (!SWIG_IsOK(ecode3)) {
6977     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "cvCreateVideoWriter" "', argument " "3"" of type '" "double""'");
6978   } 
6979   arg3 = static_cast< double >(val3);
6980   {
6981     if (PyTuple_Check(obj3)) 
6982     {
6983       if (!PyArg_ParseTuple(obj3,"ii", & temp4.width, & temp4.height)) 
6984       {
6985         PyErr_SetString(PyExc_TypeError,"tuple must consist of 2 integers (width, height)");
6986         return NULL;
6987       }
6988       arg4 = temp4;
6989     } 
6990     else
6991     {
6992       CvSize * ptr;
6993       if (SWIG_ConvertPtr (obj3, (void **) & ptr, SWIGTYPE_p_CvSize, SWIG_POINTER_EXCEPTION) == -1)
6994       {
6995         PyErr_SetString (PyExc_TypeError,"expected a tuple or a CvSize");
6996         return NULL;
6997       }
6998       arg4 = *ptr;
6999     }
7000   }
7001   if (obj4) {
7002     ecode5 = SWIG_AsVal_int(obj4, &val5);
7003     if (!SWIG_IsOK(ecode5)) {
7004       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "cvCreateVideoWriter" "', argument " "5"" of type '" "int""'");
7005     } 
7006     arg5 = static_cast< int >(val5);
7007   }
7008   {
7009     try {
7010       result = (CvVideoWriter *)cvCreateVideoWriter((char const *)arg1,arg2,arg3,arg4,arg5); 
7011     } 
7012     catch (...) 
7013     {
7014       SWIG_fail;
7015     } 
7016   }
7017   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvVideoWriter, SWIG_POINTER_OWN |  0 );
7018   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
7019   return resultobj;
7020 fail:
7021   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
7022   return NULL;
7023 }
7024
7025
7026 SWIGINTERN PyObject *_wrap_cvWriteFrame(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7027   PyObject *resultobj = 0;
7028   CvVideoWriter *arg1 = (CvVideoWriter *) 0 ;
7029   IplImage *arg2 = (IplImage *) 0 ;
7030   void *argp1 = 0 ;
7031   int res1 = 0 ;
7032   IplImage header2 ;
7033   PyObject * obj0 = 0 ;
7034   PyObject * obj1 = 0 ;
7035   int result;
7036   
7037   if (!PyArg_ParseTuple(args,(char *)"OO:cvWriteFrame",&obj0,&obj1)) SWIG_fail;
7038   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvVideoWriter, 0 |  0 );
7039   if (!SWIG_IsOK(res1)) {
7040     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cvWriteFrame" "', argument " "1"" of type '" "CvVideoWriter *""'"); 
7041   }
7042   arg1 = reinterpret_cast< CvVideoWriter * >(argp1);
7043   {
7044     void * vptr;
7045     int res = SWIG_ConvertPtr(obj1, (&vptr), SWIGTYPE_p_CvMat, 0);
7046     if ( res == -1 ){
7047       SWIG_exception( SWIG_TypeError, "%%typemap(in) IplImage * : could not convert to CvMat");
7048       SWIG_fail;
7049     }
7050     arg2 = cvGetImage((CvMat *)vptr, &header2);
7051   }
7052   {
7053     try {
7054       result = (int)cvWriteFrame(arg1,(_IplImage const *)arg2); 
7055     } 
7056     catch (...) 
7057     {
7058       SWIG_fail;
7059     } 
7060   }
7061   resultobj = SWIG_From_int(static_cast< int >(result));
7062   return resultobj;
7063 fail:
7064   return NULL;
7065 }
7066
7067
7068 SWIGINTERN PyObject *_wrap_new_CvvImage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7069   PyObject *resultobj = 0;
7070   CvvImage *result = 0 ;
7071   
7072   if (!PyArg_ParseTuple(args,(char *)":new_CvvImage")) SWIG_fail;
7073   {
7074     try {
7075       result = (CvvImage *)new CvvImage(); 
7076     } 
7077     catch (...) 
7078     {
7079       SWIG_fail;
7080     } 
7081   }
7082   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CvvImage, SWIG_POINTER_NEW |  0 );
7083   return resultobj;
7084 fail:
7085   return NULL;
7086 }
7087
7088
7089 SWIGINTERN PyObject *_wrap_delete_CvvImage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7090   PyObject *resultobj = 0;
7091   CvvImage *arg1 = (CvvImage *) 0 ;
7092   void *argp1 = 0 ;
7093   int res1 = 0 ;
7094   PyObject * obj0 = 0 ;
7095   
7096   if (!PyArg_ParseTuple(args,(char *)"O:delete_CvvImage",&obj0)) SWIG_fail;
7097   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, SWIG_POINTER_DISOWN |  0 );
7098   if (!SWIG_IsOK(res1)) {
7099     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvvImage" "', argument " "1"" of type '" "CvvImage *""'"); 
7100   }
7101   arg1 = reinterpret_cast< CvvImage * >(argp1);
7102   {
7103     try {
7104       delete arg1; 
7105     } 
7106     catch (...) 
7107     {
7108       SWIG_fail;
7109     } 
7110   }
7111   resultobj = SWIG_Py_Void();
7112   return resultobj;
7113 fail:
7114   return NULL;
7115 }
7116
7117
7118 SWIGINTERN PyObject *_wrap_CvvImage_Create__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7119   PyObject *resultobj = 0;
7120   CvvImage *arg1 = (CvvImage *) 0 ;
7121   int arg2 ;
7122   int arg3 ;
7123   int arg4 ;
7124   int arg5 ;
7125   void *argp1 = 0 ;
7126   int res1 = 0 ;
7127   int val2 ;
7128   int ecode2 = 0 ;
7129   int val3 ;
7130   int ecode3 = 0 ;
7131   int val4 ;
7132   int ecode4 = 0 ;
7133   int val5 ;
7134   int ecode5 = 0 ;
7135   PyObject * obj0 = 0 ;
7136   PyObject * obj1 = 0 ;
7137   PyObject * obj2 = 0 ;
7138   PyObject * obj3 = 0 ;
7139   PyObject * obj4 = 0 ;
7140   bool result;
7141   
7142   if (!PyArg_ParseTuple(args,(char *)"OOOOO:CvvImage_Create",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
7143   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
7144   if (!SWIG_IsOK(res1)) {
7145     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_Create" "', argument " "1"" of type '" "CvvImage *""'"); 
7146   }
7147   arg1 = reinterpret_cast< CvvImage * >(argp1);
7148   ecode2 = SWIG_AsVal_int(obj1, &val2);
7149   if (!SWIG_IsOK(ecode2)) {
7150     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvvImage_Create" "', argument " "2"" of type '" "int""'");
7151   } 
7152   arg2 = static_cast< int >(val2);
7153   ecode3 = SWIG_AsVal_int(obj2, &val3);
7154   if (!SWIG_IsOK(ecode3)) {
7155     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvvImage_Create" "', argument " "3"" of type '" "int""'");
7156   } 
7157   arg3 = static_cast< int >(val3);
7158   ecode4 = SWIG_AsVal_int(obj3, &val4);
7159   if (!SWIG_IsOK(ecode4)) {
7160     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CvvImage_Create" "', argument " "4"" of type '" "int""'");
7161   } 
7162   arg4 = static_cast< int >(val4);
7163   ecode5 = SWIG_AsVal_int(obj4, &val5);
7164   if (!SWIG_IsOK(ecode5)) {
7165     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CvvImage_Create" "', argument " "5"" of type '" "int""'");
7166   } 
7167   arg5 = static_cast< int >(val5);
7168   {
7169     try {
7170       result = (bool)(arg1)->Create(arg2,arg3,arg4,arg5); 
7171     } 
7172     catch (...) 
7173     {
7174       SWIG_fail;
7175     } 
7176   }
7177   resultobj = SWIG_From_bool(static_cast< bool >(result));
7178   return resultobj;
7179 fail:
7180   return NULL;
7181 }
7182
7183
7184 SWIGINTERN PyObject *_wrap_CvvImage_Create__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7185   PyObject *resultobj = 0;
7186   CvvImage *arg1 = (CvvImage *) 0 ;
7187   int arg2 ;
7188   int arg3 ;
7189   int arg4 ;
7190   void *argp1 = 0 ;
7191   int res1 = 0 ;
7192   int val2 ;
7193   int ecode2 = 0 ;
7194   int val3 ;
7195   int ecode3 = 0 ;
7196   int val4 ;
7197   int ecode4 = 0 ;
7198   PyObject * obj0 = 0 ;
7199   PyObject * obj1 = 0 ;
7200   PyObject * obj2 = 0 ;
7201   PyObject * obj3 = 0 ;
7202   bool result;
7203   
7204   if (!PyArg_ParseTuple(args,(char *)"OOOO:CvvImage_Create",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
7205   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
7206   if (!SWIG_IsOK(res1)) {
7207     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_Create" "', argument " "1"" of type '" "CvvImage *""'"); 
7208   }
7209   arg1 = reinterpret_cast< CvvImage * >(argp1);
7210   ecode2 = SWIG_AsVal_int(obj1, &val2);
7211   if (!SWIG_IsOK(ecode2)) {
7212     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvvImage_Create" "', argument " "2"" of type '" "int""'");
7213   } 
7214   arg2 = static_cast< int >(val2);
7215   ecode3 = SWIG_AsVal_int(obj2, &val3);
7216   if (!SWIG_IsOK(ecode3)) {
7217     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvvImage_Create" "', argument " "3"" of type '" "int""'");
7218   } 
7219   arg3 = static_cast< int >(val3);
7220   ecode4 = SWIG_AsVal_int(obj3, &val4);
7221   if (!SWIG_IsOK(ecode4)) {
7222     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CvvImage_Create" "', argument " "4"" of type '" "int""'");
7223   } 
7224   arg4 = static_cast< int >(val4);
7225   {
7226     try {
7227       result = (bool)(arg1)->Create(arg2,arg3,arg4); 
7228     } 
7229     catch (...) 
7230     {
7231       SWIG_fail;
7232     } 
7233   }
7234   resultobj = SWIG_From_bool(static_cast< bool >(result));
7235   return resultobj;
7236 fail:
7237   return NULL;
7238 }
7239
7240
7241 SWIGINTERN PyObject *_wrap_CvvImage_Create(PyObject *self, PyObject *args) {
7242   int argc;
7243   PyObject *argv[6];
7244   int ii;
7245   
7246   if (!PyTuple_Check(args)) SWIG_fail;
7247   argc = (int)PyObject_Length(args);
7248   for (ii = 0; (ii < argc) && (ii < 5); ii++) {
7249     argv[ii] = PyTuple_GET_ITEM(args,ii);
7250   }
7251   if (argc == 4) {
7252     int _v;
7253     void *vptr = 0;
7254     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvvImage, 0);
7255     _v = SWIG_CheckState(res);
7256     if (_v) {
7257       {
7258         int res = SWIG_AsVal_int(argv[1], NULL);
7259         _v = SWIG_CheckState(res);
7260       }
7261       if (_v) {
7262         {
7263           int res = SWIG_AsVal_int(argv[2], NULL);
7264           _v = SWIG_CheckState(res);
7265         }
7266         if (_v) {
7267           {
7268             int res = SWIG_AsVal_int(argv[3], NULL);
7269             _v = SWIG_CheckState(res);
7270           }
7271           if (_v) {
7272             return _wrap_CvvImage_Create__SWIG_1(self, args);
7273           }
7274         }
7275       }
7276     }
7277   }
7278   if (argc == 5) {
7279     int _v;
7280     void *vptr = 0;
7281     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvvImage, 0);
7282     _v = SWIG_CheckState(res);
7283     if (_v) {
7284       {
7285         int res = SWIG_AsVal_int(argv[1], NULL);
7286         _v = SWIG_CheckState(res);
7287       }
7288       if (_v) {
7289         {
7290           int res = SWIG_AsVal_int(argv[2], NULL);
7291           _v = SWIG_CheckState(res);
7292         }
7293         if (_v) {
7294           {
7295             int res = SWIG_AsVal_int(argv[3], NULL);
7296             _v = SWIG_CheckState(res);
7297           }
7298           if (_v) {
7299             {
7300               int res = SWIG_AsVal_int(argv[4], NULL);
7301               _v = SWIG_CheckState(res);
7302             }
7303             if (_v) {
7304               return _wrap_CvvImage_Create__SWIG_0(self, args);
7305             }
7306           }
7307         }
7308       }
7309     }
7310   }
7311   
7312 fail:
7313   SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvvImage_Create'.\n"
7314     "  Possible C/C++ prototypes are:\n"
7315     "    Create(CvvImage *,int,int,int,int)\n"
7316     "    Create(CvvImage *,int,int,int)\n");
7317   return NULL;
7318 }
7319
7320
7321 SWIGINTERN PyObject *_wrap_CvvImage_Load__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7322   PyObject *resultobj = 0;
7323   CvvImage *arg1 = (CvvImage *) 0 ;
7324   char *arg2 = (char *) 0 ;
7325   int arg3 ;
7326   void *argp1 = 0 ;
7327   int res1 = 0 ;
7328   int res2 ;
7329   char *buf2 = 0 ;
7330   int alloc2 = 0 ;
7331   int val3 ;
7332   int ecode3 = 0 ;
7333   PyObject * obj0 = 0 ;
7334   PyObject * obj1 = 0 ;
7335   PyObject * obj2 = 0 ;
7336   bool result;
7337   
7338   if (!PyArg_ParseTuple(args,(char *)"OOO:CvvImage_Load",&obj0,&obj1,&obj2)) SWIG_fail;
7339   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
7340   if (!SWIG_IsOK(res1)) {
7341     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_Load" "', argument " "1"" of type '" "CvvImage *""'"); 
7342   }
7343   arg1 = reinterpret_cast< CvvImage * >(argp1);
7344   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
7345   if (!SWIG_IsOK(res2)) {
7346     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvvImage_Load" "', argument " "2"" of type '" "char const *""'");
7347   }
7348   arg2 = reinterpret_cast< char * >(buf2);
7349   ecode3 = SWIG_AsVal_int(obj2, &val3);
7350   if (!SWIG_IsOK(ecode3)) {
7351     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvvImage_Load" "', argument " "3"" of type '" "int""'");
7352   } 
7353   arg3 = static_cast< int >(val3);
7354   {
7355     try {
7356       result = (bool)(arg1)->Load((char const *)arg2,arg3); 
7357     } 
7358     catch (...) 
7359     {
7360       SWIG_fail;
7361     } 
7362   }
7363   resultobj = SWIG_From_bool(static_cast< bool >(result));
7364   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
7365   return resultobj;
7366 fail:
7367   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
7368   return NULL;
7369 }
7370
7371
7372 SWIGINTERN PyObject *_wrap_CvvImage_Load__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7373   PyObject *resultobj = 0;
7374   CvvImage *arg1 = (CvvImage *) 0 ;
7375   char *arg2 = (char *) 0 ;
7376   void *argp1 = 0 ;
7377   int res1 = 0 ;
7378   int res2 ;
7379   char *buf2 = 0 ;
7380   int alloc2 = 0 ;
7381   PyObject * obj0 = 0 ;
7382   PyObject * obj1 = 0 ;
7383   bool result;
7384   
7385   if (!PyArg_ParseTuple(args,(char *)"OO:CvvImage_Load",&obj0,&obj1)) SWIG_fail;
7386   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
7387   if (!SWIG_IsOK(res1)) {
7388     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_Load" "', argument " "1"" of type '" "CvvImage *""'"); 
7389   }
7390   arg1 = reinterpret_cast< CvvImage * >(argp1);
7391   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
7392   if (!SWIG_IsOK(res2)) {
7393     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvvImage_Load" "', argument " "2"" of type '" "char const *""'");
7394   }
7395   arg2 = reinterpret_cast< char * >(buf2);
7396   {
7397     try {
7398       result = (bool)(arg1)->Load((char const *)arg2); 
7399     } 
7400     catch (...) 
7401     {
7402       SWIG_fail;
7403     } 
7404   }
7405   resultobj = SWIG_From_bool(static_cast< bool >(result));
7406   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
7407   return resultobj;
7408 fail:
7409   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
7410   return NULL;
7411 }
7412
7413
7414 SWIGINTERN PyObject *_wrap_CvvImage_Load(PyObject *self, PyObject *args) {
7415   int argc;
7416   PyObject *argv[4];
7417   int ii;
7418   
7419   if (!PyTuple_Check(args)) SWIG_fail;
7420   argc = (int)PyObject_Length(args);
7421   for (ii = 0; (ii < argc) && (ii < 3); ii++) {
7422     argv[ii] = PyTuple_GET_ITEM(args,ii);
7423   }
7424   if (argc == 2) {
7425     int _v;
7426     void *vptr = 0;
7427     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvvImage, 0);
7428     _v = SWIG_CheckState(res);
7429     if (_v) {
7430       int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
7431       _v = SWIG_CheckState(res);
7432       if (_v) {
7433         return _wrap_CvvImage_Load__SWIG_1(self, args);
7434       }
7435     }
7436   }
7437   if (argc == 3) {
7438     int _v;
7439     void *vptr = 0;
7440     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvvImage, 0);
7441     _v = SWIG_CheckState(res);
7442     if (_v) {
7443       int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
7444       _v = SWIG_CheckState(res);
7445       if (_v) {
7446         {
7447           int res = SWIG_AsVal_int(argv[2], NULL);
7448           _v = SWIG_CheckState(res);
7449         }
7450         if (_v) {
7451           return _wrap_CvvImage_Load__SWIG_0(self, args);
7452         }
7453       }
7454     }
7455   }
7456   
7457 fail:
7458   SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvvImage_Load'.\n"
7459     "  Possible C/C++ prototypes are:\n"
7460     "    Load(CvvImage *,char const *,int)\n"
7461     "    Load(CvvImage *,char const *)\n");
7462   return NULL;
7463 }
7464
7465
7466 SWIGINTERN PyObject *_wrap_CvvImage_LoadRect(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7467   PyObject *resultobj = 0;
7468   CvvImage *arg1 = (CvvImage *) 0 ;
7469   char *arg2 = (char *) 0 ;
7470   int arg3 ;
7471   CvRect arg4 ;
7472   void *argp1 = 0 ;
7473   int res1 = 0 ;
7474   int res2 ;
7475   char *buf2 = 0 ;
7476   int alloc2 = 0 ;
7477   int val3 ;
7478   int ecode3 = 0 ;
7479   CvRect temp4 ;
7480   PyObject * obj0 = 0 ;
7481   PyObject * obj1 = 0 ;
7482   PyObject * obj2 = 0 ;
7483   PyObject * obj3 = 0 ;
7484   bool result;
7485   
7486   if (!PyArg_ParseTuple(args,(char *)"OOOO:CvvImage_LoadRect",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
7487   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
7488   if (!SWIG_IsOK(res1)) {
7489     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_LoadRect" "', argument " "1"" of type '" "CvvImage *""'"); 
7490   }
7491   arg1 = reinterpret_cast< CvvImage * >(argp1);
7492   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
7493   if (!SWIG_IsOK(res2)) {
7494     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvvImage_LoadRect" "', argument " "2"" of type '" "char const *""'");
7495   }
7496   arg2 = reinterpret_cast< char * >(buf2);
7497   ecode3 = SWIG_AsVal_int(obj2, &val3);
7498   if (!SWIG_IsOK(ecode3)) {
7499     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvvImage_LoadRect" "', argument " "3"" of type '" "int""'");
7500   } 
7501   arg3 = static_cast< int >(val3);
7502   {
7503     if (PyTuple_Check(obj3)) 
7504     {
7505       if (!PyArg_ParseTuple(obj3,"iiii", & temp4.x, & temp4.y, & temp4.width, & temp4.height)) 
7506       {
7507         PyErr_SetString(PyExc_TypeError,"tuple must consist of 4 integers (x, y, width, height)");
7508         return NULL;
7509       }
7510       arg4 = temp4;
7511     } 
7512     else
7513     {
7514       CvRect * ptr;
7515       if (SWIG_ConvertPtr (obj3, (void **) & ptr, SWIGTYPE_p_CvRect, SWIG_POINTER_EXCEPTION) == -1)
7516       {
7517         PyErr_SetString (PyExc_TypeError,"expected a tuple or a CvRect");
7518         return NULL;
7519       }
7520       arg4 = *ptr;
7521     }
7522   }
7523   {
7524     try {
7525       result = (bool)(arg1)->LoadRect((char const *)arg2,arg3,arg4); 
7526     } 
7527     catch (...) 
7528     {
7529       SWIG_fail;
7530     } 
7531   }
7532   resultobj = SWIG_From_bool(static_cast< bool >(result));
7533   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
7534   return resultobj;
7535 fail:
7536   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
7537   return NULL;
7538 }
7539
7540
7541 SWIGINTERN PyObject *_wrap_CvvImage_Save(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7542   PyObject *resultobj = 0;
7543   CvvImage *arg1 = (CvvImage *) 0 ;
7544   char *arg2 = (char *) 0 ;
7545   void *argp1 = 0 ;
7546   int res1 = 0 ;
7547   int res2 ;
7548   char *buf2 = 0 ;
7549   int alloc2 = 0 ;
7550   PyObject * obj0 = 0 ;
7551   PyObject * obj1 = 0 ;
7552   bool result;
7553   
7554   if (!PyArg_ParseTuple(args,(char *)"OO:CvvImage_Save",&obj0,&obj1)) SWIG_fail;
7555   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
7556   if (!SWIG_IsOK(res1)) {
7557     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_Save" "', argument " "1"" of type '" "CvvImage *""'"); 
7558   }
7559   arg1 = reinterpret_cast< CvvImage * >(argp1);
7560   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
7561   if (!SWIG_IsOK(res2)) {
7562     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvvImage_Save" "', argument " "2"" of type '" "char const *""'");
7563   }
7564   arg2 = reinterpret_cast< char * >(buf2);
7565   {
7566     try {
7567       result = (bool)(arg1)->Save((char const *)arg2); 
7568     } 
7569     catch (...) 
7570     {
7571       SWIG_fail;
7572     } 
7573   }
7574   resultobj = SWIG_From_bool(static_cast< bool >(result));
7575   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
7576   return resultobj;
7577 fail:
7578   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
7579   return NULL;
7580 }
7581
7582
7583 SWIGINTERN PyObject *_wrap_CvvImage_CopyOf__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7584   PyObject *resultobj = 0;
7585   CvvImage *arg1 = (CvvImage *) 0 ;
7586   CvvImage *arg2 = 0 ;
7587   int arg3 ;
7588   void *argp1 = 0 ;
7589   int res1 = 0 ;
7590   void *argp2 = 0 ;
7591   int res2 = 0 ;
7592   int val3 ;
7593   int ecode3 = 0 ;
7594   PyObject * obj0 = 0 ;
7595   PyObject * obj1 = 0 ;
7596   PyObject * obj2 = 0 ;
7597   
7598   if (!PyArg_ParseTuple(args,(char *)"OOO:CvvImage_CopyOf",&obj0,&obj1,&obj2)) SWIG_fail;
7599   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
7600   if (!SWIG_IsOK(res1)) {
7601     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_CopyOf" "', argument " "1"" of type '" "CvvImage *""'"); 
7602   }
7603   arg1 = reinterpret_cast< CvvImage * >(argp1);
7604   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_CvvImage,  0 );
7605   if (!SWIG_IsOK(res2)) {
7606     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvvImage_CopyOf" "', argument " "2"" of type '" "CvvImage &""'"); 
7607   }
7608   if (!argp2) {
7609     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvvImage_CopyOf" "', argument " "2"" of type '" "CvvImage &""'"); 
7610   }
7611   arg2 = reinterpret_cast< CvvImage * >(argp2);
7612   ecode3 = SWIG_AsVal_int(obj2, &val3);
7613   if (!SWIG_IsOK(ecode3)) {
7614     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvvImage_CopyOf" "', argument " "3"" of type '" "int""'");
7615   } 
7616   arg3 = static_cast< int >(val3);
7617   {
7618     try {
7619       (arg1)->CopyOf(*arg2,arg3); 
7620     } 
7621     catch (...) 
7622     {
7623       SWIG_fail;
7624     } 
7625   }
7626   resultobj = SWIG_Py_Void();
7627   return resultobj;
7628 fail:
7629   return NULL;
7630 }
7631
7632
7633 SWIGINTERN PyObject *_wrap_CvvImage_CopyOf__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7634   PyObject *resultobj = 0;
7635   CvvImage *arg1 = (CvvImage *) 0 ;
7636   CvvImage *arg2 = 0 ;
7637   void *argp1 = 0 ;
7638   int res1 = 0 ;
7639   void *argp2 = 0 ;
7640   int res2 = 0 ;
7641   PyObject * obj0 = 0 ;
7642   PyObject * obj1 = 0 ;
7643   
7644   if (!PyArg_ParseTuple(args,(char *)"OO:CvvImage_CopyOf",&obj0,&obj1)) SWIG_fail;
7645   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
7646   if (!SWIG_IsOK(res1)) {
7647     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_CopyOf" "', argument " "1"" of type '" "CvvImage *""'"); 
7648   }
7649   arg1 = reinterpret_cast< CvvImage * >(argp1);
7650   res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_CvvImage,  0 );
7651   if (!SWIG_IsOK(res2)) {
7652     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvvImage_CopyOf" "', argument " "2"" of type '" "CvvImage &""'"); 
7653   }
7654   if (!argp2) {
7655     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CvvImage_CopyOf" "', argument " "2"" of type '" "CvvImage &""'"); 
7656   }
7657   arg2 = reinterpret_cast< CvvImage * >(argp2);
7658   {
7659     try {
7660       (arg1)->CopyOf(*arg2); 
7661     } 
7662     catch (...) 
7663     {
7664       SWIG_fail;
7665     } 
7666   }
7667   resultobj = SWIG_Py_Void();
7668   return resultobj;
7669 fail:
7670   return NULL;
7671 }
7672
7673
7674 SWIGINTERN PyObject *_wrap_CvvImage_CopyOf__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7675   PyObject *resultobj = 0;
7676   CvvImage *arg1 = (CvvImage *) 0 ;
7677   IplImage *arg2 = (IplImage *) 0 ;
7678   int arg3 ;
7679   void *argp1 = 0 ;
7680   int res1 = 0 ;
7681   IplImage header2 ;
7682   int val3 ;
7683   int ecode3 = 0 ;
7684   PyObject * obj0 = 0 ;
7685   PyObject * obj1 = 0 ;
7686   PyObject * obj2 = 0 ;
7687   
7688   if (!PyArg_ParseTuple(args,(char *)"OOO:CvvImage_CopyOf",&obj0,&obj1,&obj2)) SWIG_fail;
7689   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
7690   if (!SWIG_IsOK(res1)) {
7691     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_CopyOf" "', argument " "1"" of type '" "CvvImage *""'"); 
7692   }
7693   arg1 = reinterpret_cast< CvvImage * >(argp1);
7694   {
7695     void * vptr;
7696     int res = SWIG_ConvertPtr(obj1, (&vptr), SWIGTYPE_p_CvMat, 0);
7697     if ( res == -1 ){
7698       SWIG_exception( SWIG_TypeError, "%%typemap(in) IplImage * : could not convert to CvMat");
7699       SWIG_fail;
7700     }
7701     arg2 = cvGetImage((CvMat *)vptr, &header2);
7702   }
7703   ecode3 = SWIG_AsVal_int(obj2, &val3);
7704   if (!SWIG_IsOK(ecode3)) {
7705     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CvvImage_CopyOf" "', argument " "3"" of type '" "int""'");
7706   } 
7707   arg3 = static_cast< int >(val3);
7708   {
7709     try {
7710       (arg1)->CopyOf(arg2,arg3); 
7711     } 
7712     catch (...) 
7713     {
7714       SWIG_fail;
7715     } 
7716   }
7717   resultobj = SWIG_Py_Void();
7718   return resultobj;
7719 fail:
7720   return NULL;
7721 }
7722
7723
7724 SWIGINTERN PyObject *_wrap_CvvImage_CopyOf__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7725   PyObject *resultobj = 0;
7726   CvvImage *arg1 = (CvvImage *) 0 ;
7727   IplImage *arg2 = (IplImage *) 0 ;
7728   void *argp1 = 0 ;
7729   int res1 = 0 ;
7730   IplImage header2 ;
7731   PyObject * obj0 = 0 ;
7732   PyObject * obj1 = 0 ;
7733   
7734   if (!PyArg_ParseTuple(args,(char *)"OO:CvvImage_CopyOf",&obj0,&obj1)) SWIG_fail;
7735   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
7736   if (!SWIG_IsOK(res1)) {
7737     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_CopyOf" "', argument " "1"" of type '" "CvvImage *""'"); 
7738   }
7739   arg1 = reinterpret_cast< CvvImage * >(argp1);
7740   {
7741     void * vptr;
7742     int res = SWIG_ConvertPtr(obj1, (&vptr), SWIGTYPE_p_CvMat, 0);
7743     if ( res == -1 ){
7744       SWIG_exception( SWIG_TypeError, "%%typemap(in) IplImage * : could not convert to CvMat");
7745       SWIG_fail;
7746     }
7747     arg2 = cvGetImage((CvMat *)vptr, &header2);
7748   }
7749   {
7750     try {
7751       (arg1)->CopyOf(arg2); 
7752     } 
7753     catch (...) 
7754     {
7755       SWIG_fail;
7756     } 
7757   }
7758   resultobj = SWIG_Py_Void();
7759   return resultobj;
7760 fail:
7761   return NULL;
7762 }
7763
7764
7765 SWIGINTERN PyObject *_wrap_CvvImage_CopyOf(PyObject *self, PyObject *args) {
7766   int argc;
7767   PyObject *argv[4];
7768   int ii;
7769   
7770   if (!PyTuple_Check(args)) SWIG_fail;
7771   argc = (int)PyObject_Length(args);
7772   for (ii = 0; (ii < argc) && (ii < 3); ii++) {
7773     argv[ii] = PyTuple_GET_ITEM(args,ii);
7774   }
7775   if (argc == 2) {
7776     int _v;
7777     void *vptr = 0;
7778     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvvImage, 0);
7779     _v = SWIG_CheckState(res);
7780     if (_v) {
7781       void *vptr = 0;
7782       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvvImage, 0);
7783       _v = SWIG_CheckState(res);
7784       if (_v) {
7785         return _wrap_CvvImage_CopyOf__SWIG_1(self, args);
7786       }
7787     }
7788   }
7789   if (argc == 2) {
7790     int _v;
7791     void *vptr = 0;
7792     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvvImage, 0);
7793     _v = SWIG_CheckState(res);
7794     if (_v) {
7795       void *vptr = 0;
7796       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p__IplImage, 0);
7797       _v = SWIG_CheckState(res);
7798       if (_v) {
7799         return _wrap_CvvImage_CopyOf__SWIG_3(self, args);
7800       }
7801     }
7802   }
7803   if (argc == 3) {
7804     int _v;
7805     void *vptr = 0;
7806     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvvImage, 0);
7807     _v = SWIG_CheckState(res);
7808     if (_v) {
7809       void *vptr = 0;
7810       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p__IplImage, 0);
7811       _v = SWIG_CheckState(res);
7812       if (_v) {
7813         {
7814           int res = SWIG_AsVal_int(argv[2], NULL);
7815           _v = SWIG_CheckState(res);
7816         }
7817         if (_v) {
7818           return _wrap_CvvImage_CopyOf__SWIG_2(self, args);
7819         }
7820       }
7821     }
7822   }
7823   if (argc == 3) {
7824     int _v;
7825     void *vptr = 0;
7826     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CvvImage, 0);
7827     _v = SWIG_CheckState(res);
7828     if (_v) {
7829       void *vptr = 0;
7830       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CvvImage, 0);
7831       _v = SWIG_CheckState(res);
7832       if (_v) {
7833         {
7834           int res = SWIG_AsVal_int(argv[2], NULL);
7835           _v = SWIG_CheckState(res);
7836         }
7837         if (_v) {
7838           return _wrap_CvvImage_CopyOf__SWIG_0(self, args);
7839         }
7840       }
7841     }
7842   }
7843   
7844 fail:
7845   SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CvvImage_CopyOf'.\n"
7846     "  Possible C/C++ prototypes are:\n"
7847     "    CopyOf(CvvImage *,CvvImage &,int)\n"
7848     "    CopyOf(CvvImage *,CvvImage &)\n"
7849     "    CopyOf(CvvImage *,IplImage *,int)\n"
7850     "    CopyOf(CvvImage *,IplImage *)\n");
7851   return NULL;
7852 }
7853
7854
7855 SWIGINTERN PyObject *_wrap_CvvImage_GetImage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7856   PyObject *resultobj = 0;
7857   CvvImage *arg1 = (CvvImage *) 0 ;
7858   void *argp1 = 0 ;
7859   int res1 = 0 ;
7860   PyObject * obj0 = 0 ;
7861   IplImage *result = 0 ;
7862   
7863   if (!PyArg_ParseTuple(args,(char *)"O:CvvImage_GetImage",&obj0)) SWIG_fail;
7864   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
7865   if (!SWIG_IsOK(res1)) {
7866     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_GetImage" "', argument " "1"" of type '" "CvvImage *""'"); 
7867   }
7868   arg1 = reinterpret_cast< CvvImage * >(argp1);
7869   {
7870     try {
7871       result = (IplImage *)(arg1)->GetImage(); 
7872     } 
7873     catch (...) 
7874     {
7875       SWIG_fail;
7876     } 
7877   }
7878   {
7879     SWIG_exception( SWIG_TypeError, "IplImage * return type is deprecated. Please file a bug report at www.sourceforge.net/opencvlibrary if you see this error message.");
7880     SWIG_fail;
7881   }
7882   return resultobj;
7883 fail:
7884   return NULL;
7885 }
7886
7887
7888 SWIGINTERN PyObject *_wrap_CvvImage_Destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7889   PyObject *resultobj = 0;
7890   CvvImage *arg1 = (CvvImage *) 0 ;
7891   void *argp1 = 0 ;
7892   int res1 = 0 ;
7893   PyObject * obj0 = 0 ;
7894   
7895   if (!PyArg_ParseTuple(args,(char *)"O:CvvImage_Destroy",&obj0)) SWIG_fail;
7896   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
7897   if (!SWIG_IsOK(res1)) {
7898     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_Destroy" "', argument " "1"" of type '" "CvvImage *""'"); 
7899   }
7900   arg1 = reinterpret_cast< CvvImage * >(argp1);
7901   {
7902     try {
7903       (arg1)->Destroy(); 
7904     } 
7905     catch (...) 
7906     {
7907       SWIG_fail;
7908     } 
7909   }
7910   resultobj = SWIG_Py_Void();
7911   return resultobj;
7912 fail:
7913   return NULL;
7914 }
7915
7916
7917 SWIGINTERN PyObject *_wrap_CvvImage_Width(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7918   PyObject *resultobj = 0;
7919   CvvImage *arg1 = (CvvImage *) 0 ;
7920   void *argp1 = 0 ;
7921   int res1 = 0 ;
7922   PyObject * obj0 = 0 ;
7923   int result;
7924   
7925   if (!PyArg_ParseTuple(args,(char *)"O:CvvImage_Width",&obj0)) SWIG_fail;
7926   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
7927   if (!SWIG_IsOK(res1)) {
7928     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_Width" "', argument " "1"" of type '" "CvvImage *""'"); 
7929   }
7930   arg1 = reinterpret_cast< CvvImage * >(argp1);
7931   {
7932     try {
7933       result = (int)(arg1)->Width(); 
7934     } 
7935     catch (...) 
7936     {
7937       SWIG_fail;
7938     } 
7939   }
7940   resultobj = SWIG_From_int(static_cast< int >(result));
7941   return resultobj;
7942 fail:
7943   return NULL;
7944 }
7945
7946
7947 SWIGINTERN PyObject *_wrap_CvvImage_Height(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7948   PyObject *resultobj = 0;
7949   CvvImage *arg1 = (CvvImage *) 0 ;
7950   void *argp1 = 0 ;
7951   int res1 = 0 ;
7952   PyObject * obj0 = 0 ;
7953   int result;
7954   
7955   if (!PyArg_ParseTuple(args,(char *)"O:CvvImage_Height",&obj0)) SWIG_fail;
7956   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
7957   if (!SWIG_IsOK(res1)) {
7958     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_Height" "', argument " "1"" of type '" "CvvImage *""'"); 
7959   }
7960   arg1 = reinterpret_cast< CvvImage * >(argp1);
7961   {
7962     try {
7963       result = (int)(arg1)->Height(); 
7964     } 
7965     catch (...) 
7966     {
7967       SWIG_fail;
7968     } 
7969   }
7970   resultobj = SWIG_From_int(static_cast< int >(result));
7971   return resultobj;
7972 fail:
7973   return NULL;
7974 }
7975
7976
7977 SWIGINTERN PyObject *_wrap_CvvImage_Bpp(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7978   PyObject *resultobj = 0;
7979   CvvImage *arg1 = (CvvImage *) 0 ;
7980   void *argp1 = 0 ;
7981   int res1 = 0 ;
7982   PyObject * obj0 = 0 ;
7983   int result;
7984   
7985   if (!PyArg_ParseTuple(args,(char *)"O:CvvImage_Bpp",&obj0)) SWIG_fail;
7986   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
7987   if (!SWIG_IsOK(res1)) {
7988     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_Bpp" "', argument " "1"" of type '" "CvvImage *""'"); 
7989   }
7990   arg1 = reinterpret_cast< CvvImage * >(argp1);
7991   {
7992     try {
7993       result = (int)(arg1)->Bpp(); 
7994     } 
7995     catch (...) 
7996     {
7997       SWIG_fail;
7998     } 
7999   }
8000   resultobj = SWIG_From_int(static_cast< int >(result));
8001   return resultobj;
8002 fail:
8003   return NULL;
8004 }
8005
8006
8007 SWIGINTERN PyObject *_wrap_CvvImage_Fill(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8008   PyObject *resultobj = 0;
8009   CvvImage *arg1 = (CvvImage *) 0 ;
8010   int arg2 ;
8011   void *argp1 = 0 ;
8012   int res1 = 0 ;
8013   int val2 ;
8014   int ecode2 = 0 ;
8015   PyObject * obj0 = 0 ;
8016   PyObject * obj1 = 0 ;
8017   
8018   if (!PyArg_ParseTuple(args,(char *)"OO:CvvImage_Fill",&obj0,&obj1)) SWIG_fail;
8019   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
8020   if (!SWIG_IsOK(res1)) {
8021     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_Fill" "', argument " "1"" of type '" "CvvImage *""'"); 
8022   }
8023   arg1 = reinterpret_cast< CvvImage * >(argp1);
8024   ecode2 = SWIG_AsVal_int(obj1, &val2);
8025   if (!SWIG_IsOK(ecode2)) {
8026     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CvvImage_Fill" "', argument " "2"" of type '" "int""'");
8027   } 
8028   arg2 = static_cast< int >(val2);
8029   {
8030     try {
8031       (arg1)->Fill(arg2); 
8032     } 
8033     catch (...) 
8034     {
8035       SWIG_fail;
8036     } 
8037   }
8038   resultobj = SWIG_Py_Void();
8039   return resultobj;
8040 fail:
8041   return NULL;
8042 }
8043
8044
8045 SWIGINTERN PyObject *_wrap_CvvImage_Show(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8046   PyObject *resultobj = 0;
8047   CvvImage *arg1 = (CvvImage *) 0 ;
8048   char *arg2 = (char *) 0 ;
8049   void *argp1 = 0 ;
8050   int res1 = 0 ;
8051   int res2 ;
8052   char *buf2 = 0 ;
8053   int alloc2 = 0 ;
8054   PyObject * obj0 = 0 ;
8055   PyObject * obj1 = 0 ;
8056   
8057   if (!PyArg_ParseTuple(args,(char *)"OO:CvvImage_Show",&obj0,&obj1)) SWIG_fail;
8058   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvvImage, 0 |  0 );
8059   if (!SWIG_IsOK(res1)) {
8060     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CvvImage_Show" "', argument " "1"" of type '" "CvvImage *""'"); 
8061   }
8062   arg1 = reinterpret_cast< CvvImage * >(argp1);
8063   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
8064   if (!SWIG_IsOK(res2)) {
8065     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CvvImage_Show" "', argument " "2"" of type '" "char const *""'");
8066   }
8067   arg2 = reinterpret_cast< char * >(buf2);
8068   {
8069     try {
8070       (arg1)->Show((char const *)arg2); 
8071     } 
8072     catch (...) 
8073     {
8074       SWIG_fail;
8075     } 
8076   }
8077   resultobj = SWIG_Py_Void();
8078   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
8079   return resultobj;
8080 fail:
8081   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
8082   return NULL;
8083 }
8084
8085
8086 SWIGINTERN PyObject *CvvImage_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8087   PyObject *obj;
8088   if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8089   SWIG_TypeNewClientData(SWIGTYPE_p_CvvImage, SWIG_NewClientData(obj));
8090   return SWIG_Py_Void();
8091 }
8092
8093 SWIGINTERN PyObject *_wrap_delete_CvCapture(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8094   PyObject *resultobj = 0;
8095   CvCapture *arg1 = (CvCapture *) 0 ;
8096   void *argp1 = 0 ;
8097   int res1 = 0 ;
8098   PyObject * obj0 = 0 ;
8099   
8100   if (!PyArg_ParseTuple(args,(char *)"O:delete_CvCapture",&obj0)) SWIG_fail;
8101   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvCapture, SWIG_POINTER_DISOWN |  0 );
8102   if (!SWIG_IsOK(res1)) {
8103     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvCapture" "', argument " "1"" of type '" "CvCapture *""'"); 
8104   }
8105   arg1 = reinterpret_cast< CvCapture * >(argp1);
8106   {
8107     try {
8108       delete_CvCapture(arg1); 
8109     } 
8110     catch (...) 
8111     {
8112       SWIG_fail;
8113     } 
8114   }
8115   resultobj = SWIG_Py_Void();
8116   return resultobj;
8117 fail:
8118   return NULL;
8119 }
8120
8121
8122 SWIGINTERN PyObject *CvCapture_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8123   PyObject *obj;
8124   if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8125   SWIG_TypeNewClientData(SWIGTYPE_p_CvCapture, SWIG_NewClientData(obj));
8126   return SWIG_Py_Void();
8127 }
8128
8129 SWIGINTERN PyObject *_wrap_delete_CvVideoWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8130   PyObject *resultobj = 0;
8131   CvVideoWriter *arg1 = (CvVideoWriter *) 0 ;
8132   void *argp1 = 0 ;
8133   int res1 = 0 ;
8134   PyObject * obj0 = 0 ;
8135   
8136   if (!PyArg_ParseTuple(args,(char *)"O:delete_CvVideoWriter",&obj0)) SWIG_fail;
8137   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CvVideoWriter, SWIG_POINTER_DISOWN |  0 );
8138   if (!SWIG_IsOK(res1)) {
8139     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CvVideoWriter" "', argument " "1"" of type '" "CvVideoWriter *""'"); 
8140   }
8141   arg1 = reinterpret_cast< CvVideoWriter * >(argp1);
8142   {
8143     try {
8144       delete_CvVideoWriter(arg1); 
8145     } 
8146     catch (...) 
8147     {
8148       SWIG_fail;
8149     } 
8150   }
8151   resultobj = SWIG_Py_Void();
8152   return resultobj;
8153 fail:
8154   return NULL;
8155 }
8156
8157
8158 SWIGINTERN PyObject *CvVideoWriter_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8159   PyObject *obj;
8160   if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
8161   SWIG_TypeNewClientData(SWIGTYPE_p_CvVideoWriter, SWIG_NewClientData(obj));
8162   return SWIG_Py_Void();
8163 }
8164
8165 static PyMethodDef SwigMethods[] = {
8166          { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
8167          { (char *)"new_CvRNG_Wrapper", _wrap_new_CvRNG_Wrapper, METH_VARARGS, NULL},
8168          { (char *)"CvRNG_Wrapper_ptr", _wrap_CvRNG_Wrapper_ptr, METH_VARARGS, NULL},
8169          { (char *)"CvRNG_Wrapper_ref", _wrap_CvRNG_Wrapper_ref, METH_VARARGS, NULL},
8170          { (char *)"CvRNG_Wrapper___eq__", _wrap_CvRNG_Wrapper___eq__, METH_VARARGS, NULL},
8171          { (char *)"CvRNG_Wrapper___ne__", _wrap_CvRNG_Wrapper___ne__, METH_VARARGS, NULL},
8172          { (char *)"delete_CvRNG_Wrapper", _wrap_delete_CvRNG_Wrapper, METH_VARARGS, (char *)"delete_CvRNG_Wrapper(CvRNG_Wrapper self)"},
8173          { (char *)"CvRNG_Wrapper_swigregister", CvRNG_Wrapper_swigregister, METH_VARARGS, NULL},
8174          { (char *)"new_CvSubdiv2DEdge_Wrapper", _wrap_new_CvSubdiv2DEdge_Wrapper, METH_VARARGS, NULL},
8175          { (char *)"CvSubdiv2DEdge_Wrapper_ptr", _wrap_CvSubdiv2DEdge_Wrapper_ptr, METH_VARARGS, NULL},
8176          { (char *)"CvSubdiv2DEdge_Wrapper_ref", _wrap_CvSubdiv2DEdge_Wrapper_ref, METH_VARARGS, NULL},
8177          { (char *)"CvSubdiv2DEdge_Wrapper___eq__", _wrap_CvSubdiv2DEdge_Wrapper___eq__, METH_VARARGS, NULL},
8178          { (char *)"CvSubdiv2DEdge_Wrapper___ne__", _wrap_CvSubdiv2DEdge_Wrapper___ne__, METH_VARARGS, NULL},
8179          { (char *)"delete_CvSubdiv2DEdge_Wrapper", _wrap_delete_CvSubdiv2DEdge_Wrapper, METH_VARARGS, (char *)"delete_CvSubdiv2DEdge_Wrapper(CvSubdiv2DEdge_Wrapper self)"},
8180          { (char *)"CvSubdiv2DEdge_Wrapper_swigregister", CvSubdiv2DEdge_Wrapper_swigregister, METH_VARARGS, NULL},
8181          { (char *)"cvSetMouseCallback", _wrap_cvSetMouseCallback, METH_VARARGS, NULL},
8182          { (char *)"cvWaitKey", _wrap_cvWaitKey, METH_VARARGS, NULL},
8183          { (char *)"cvLoadImage", _wrap_cvLoadImage, METH_VARARGS, (char *)"\n"
8184                 "cvLoadImage(char filename, int iscolor = 1) -> CvMat\n"
8185                 "cvLoadImage(char filename) -> CvMat\n"
8186                 ""},
8187          { (char *)"cvRetrieveFrame", _wrap_cvRetrieveFrame, METH_VARARGS, (char *)"cvRetrieveFrame(CvCapture capture) -> CvMat"},
8188          { (char *)"cvQueryFrame", _wrap_cvQueryFrame, METH_VARARGS, (char *)"cvQueryFrame(CvCapture capture) -> CvMat"},
8189          { (char *)"cvInitSystem", _wrap_cvInitSystem, METH_VARARGS, (char *)"cvInitSystem(int argc, char argv) -> int"},
8190          { (char *)"cvStartWindowThread", _wrap_cvStartWindowThread, METH_VARARGS, (char *)"cvStartWindowThread() -> int"},
8191          { (char *)"cvNamedWindow", _wrap_cvNamedWindow, METH_VARARGS, (char *)"cvNamedWindow(char name, int flags = 1) -> int"},
8192          { (char *)"cvShowImage", _wrap_cvShowImage, METH_VARARGS, (char *)"cvShowImage(char name, CvArr image)"},
8193          { (char *)"cvResizeWindow", _wrap_cvResizeWindow, METH_VARARGS, (char *)"cvResizeWindow(char name, int width, int height)"},
8194          { (char *)"cvMoveWindow", _wrap_cvMoveWindow, METH_VARARGS, (char *)"cvMoveWindow(char name, int x, int y)"},
8195          { (char *)"cvDestroyWindow", _wrap_cvDestroyWindow, METH_VARARGS, (char *)"cvDestroyWindow(char name)"},
8196          { (char *)"cvDestroyAllWindows", _wrap_cvDestroyAllWindows, METH_VARARGS, (char *)"cvDestroyAllWindows()"},
8197          { (char *)"cvGetWindowHandle", _wrap_cvGetWindowHandle, METH_VARARGS, (char *)"cvGetWindowHandle(char name) -> void"},
8198          { (char *)"cvGetWindowName", _wrap_cvGetWindowName, METH_VARARGS, (char *)"cvGetWindowName(void window_handle) -> char"},
8199          { (char *)"cvCreateTrackbar", _wrap_cvCreateTrackbar, METH_VARARGS, (char *)"\n"
8200                 "cvCreateTrackbar(char trackbar_name, char window_name, int value, int count, \n"
8201                 "    CvTrackbarCallback on_change) -> int\n"
8202                 ""},
8203          { (char *)"cvCreateTrackbar2", _wrap_cvCreateTrackbar2, METH_VARARGS, (char *)"\n"
8204                 "cvCreateTrackbar2(char trackbar_name, char window_name, int value, int count, \n"
8205                 "    CvTrackbarCallback2 on_change, void userdata = None) -> int\n"
8206                 ""},
8207          { (char *)"cvGetTrackbarPos", _wrap_cvGetTrackbarPos, METH_VARARGS, (char *)"cvGetTrackbarPos(char trackbar_name, char window_name) -> int"},
8208          { (char *)"cvSetTrackbarPos", _wrap_cvSetTrackbarPos, METH_VARARGS, (char *)"cvSetTrackbarPos(char trackbar_name, char window_name, int pos)"},
8209          { (char *)"cvSetMouseCallbackOld", _wrap_cvSetMouseCallbackOld, METH_VARARGS, (char *)"cvSetMouseCallbackOld(char window_name, CvMouseCallback on_mouse, void param = None)"},
8210          { (char *)"cvLoadImageM", _wrap_cvLoadImageM, METH_VARARGS, (char *)"cvLoadImageM(char filename, int iscolor = 1) -> CvMat"},
8211          { (char *)"cvSaveImage", _wrap_cvSaveImage, METH_VARARGS, (char *)"cvSaveImage(char filename, CvArr image, int params = None) -> int"},
8212          { (char *)"cvDecodeImage", _wrap_cvDecodeImage, METH_VARARGS, (char *)"cvDecodeImage(CvMat buf, int iscolor = 1)"},
8213          { (char *)"cvDecodeImageM", _wrap_cvDecodeImageM, METH_VARARGS, (char *)"cvDecodeImageM(CvMat buf, int iscolor = 1) -> CvMat"},
8214          { (char *)"cvEncodeImage", _wrap_cvEncodeImage, METH_VARARGS, (char *)"cvEncodeImage(char ext, CvArr image, int params = None) -> CvMat"},
8215          { (char *)"cvConvertImage", _wrap_cvConvertImage, METH_VARARGS, (char *)"cvConvertImage(CvArr src, CvArr dst, int flags = 0)"},
8216          { (char *)"cvWaitKeyC", _wrap_cvWaitKeyC, METH_VARARGS, (char *)"cvWaitKeyC(int delay = 0) -> int"},
8217          { (char *)"cvCreateFileCapture", _wrap_cvCreateFileCapture, METH_VARARGS, (char *)"cvCreateFileCapture(char filename) -> CvCapture"},
8218          { (char *)"cvCreateCameraCapture", _wrap_cvCreateCameraCapture, METH_VARARGS, (char *)"cvCreateCameraCapture(int index) -> CvCapture"},
8219          { (char *)"cvGrabFrame", _wrap_cvGrabFrame, METH_VARARGS, (char *)"cvGrabFrame(CvCapture capture) -> int"},
8220          { (char *)"cvRetrieveFrame__Deprecated", _wrap_cvRetrieveFrame__Deprecated, METH_VARARGS, (char *)"cvRetrieveFrame__Deprecated(CvCapture capture, int streamIdx = 0)"},
8221          { (char *)"cvQueryFrame__Deprecated", _wrap_cvQueryFrame__Deprecated, METH_VARARGS, (char *)"cvQueryFrame__Deprecated(CvCapture capture)"},
8222          { (char *)"cvGetCaptureProperty", _wrap_cvGetCaptureProperty, METH_VARARGS, (char *)"cvGetCaptureProperty(CvCapture capture, int property_id) -> double"},
8223          { (char *)"cvSetCaptureProperty", _wrap_cvSetCaptureProperty, METH_VARARGS, (char *)"cvSetCaptureProperty(CvCapture capture, int property_id, double value) -> int"},
8224          { (char *)"cvGetCaptureDomain", _wrap_cvGetCaptureDomain, METH_VARARGS, (char *)"cvGetCaptureDomain(CvCapture capture) -> int"},
8225          { (char *)"CV_FOURCC", _wrap_CV_FOURCC, METH_VARARGS, (char *)"CV_FOURCC(char c1, char c2, char c3, char c4) -> int"},
8226          { (char *)"cvCreateVideoWriter", _wrap_cvCreateVideoWriter, METH_VARARGS, (char *)"\n"
8227                 "cvCreateVideoWriter(char filename, int fourcc, double fps, CvSize frame_size, \n"
8228                 "    int is_color = 1) -> CvVideoWriter\n"
8229                 ""},
8230          { (char *)"cvWriteFrame", _wrap_cvWriteFrame, METH_VARARGS, (char *)"cvWriteFrame(CvVideoWriter writer,  image) -> int"},
8231          { (char *)"new_CvvImage", _wrap_new_CvvImage, METH_VARARGS, (char *)"new_CvvImage() -> CvvImage"},
8232          { (char *)"delete_CvvImage", _wrap_delete_CvvImage, METH_VARARGS, (char *)"delete_CvvImage(CvvImage self)"},
8233          { (char *)"CvvImage_Create", _wrap_CvvImage_Create, METH_VARARGS, (char *)"\n"
8234                 "Create(int width, int height, int bits_per_pixel, int image_origin = 0) -> bool\n"
8235                 "CvvImage_Create(CvvImage self, int width, int height, int bits_per_pixel) -> bool\n"
8236                 ""},
8237          { (char *)"CvvImage_Load", _wrap_CvvImage_Load, METH_VARARGS, (char *)"\n"
8238                 "Load(char filename, int desired_color = 1) -> bool\n"
8239                 "CvvImage_Load(CvvImage self, char filename) -> bool\n"
8240                 ""},
8241          { (char *)"CvvImage_LoadRect", _wrap_CvvImage_LoadRect, METH_VARARGS, (char *)"CvvImage_LoadRect(CvvImage self, char filename, int desired_color, CvRect r) -> bool"},
8242          { (char *)"CvvImage_Save", _wrap_CvvImage_Save, METH_VARARGS, (char *)"CvvImage_Save(CvvImage self, char filename) -> bool"},
8243          { (char *)"CvvImage_CopyOf", _wrap_CvvImage_CopyOf, METH_VARARGS, (char *)"\n"
8244                 "CopyOf(CvvImage image, int desired_color = -1)\n"
8245                 "CopyOf(CvvImage image)\n"
8246                 "CopyOf( img, int desired_color = -1)\n"
8247                 "CvvImage_CopyOf(CvvImage self,  img)\n"
8248                 ""},
8249          { (char *)"CvvImage_GetImage", _wrap_CvvImage_GetImage, METH_VARARGS, (char *)"CvvImage_GetImage(CvvImage self)"},
8250          { (char *)"CvvImage_Destroy", _wrap_CvvImage_Destroy, METH_VARARGS, (char *)"CvvImage_Destroy(CvvImage self)"},
8251          { (char *)"CvvImage_Width", _wrap_CvvImage_Width, METH_VARARGS, (char *)"CvvImage_Width(CvvImage self) -> int"},
8252          { (char *)"CvvImage_Height", _wrap_CvvImage_Height, METH_VARARGS, (char *)"CvvImage_Height(CvvImage self) -> int"},
8253          { (char *)"CvvImage_Bpp", _wrap_CvvImage_Bpp, METH_VARARGS, (char *)"CvvImage_Bpp(CvvImage self) -> int"},
8254          { (char *)"CvvImage_Fill", _wrap_CvvImage_Fill, METH_VARARGS, (char *)"CvvImage_Fill(CvvImage self, int color)"},
8255          { (char *)"CvvImage_Show", _wrap_CvvImage_Show, METH_VARARGS, (char *)"CvvImage_Show(CvvImage self, char window)"},
8256          { (char *)"CvvImage_swigregister", CvvImage_swigregister, METH_VARARGS, NULL},
8257          { (char *)"delete_CvCapture", _wrap_delete_CvCapture, METH_VARARGS, (char *)"delete_CvCapture(CvCapture self)"},
8258          { (char *)"CvCapture_swigregister", CvCapture_swigregister, METH_VARARGS, NULL},
8259          { (char *)"delete_CvVideoWriter", _wrap_delete_CvVideoWriter, METH_VARARGS, (char *)"delete_CvVideoWriter(CvVideoWriter self)"},
8260          { (char *)"CvVideoWriter_swigregister", CvVideoWriter_swigregister, METH_VARARGS, NULL},
8261          { NULL, NULL, 0, NULL }
8262 };
8263
8264
8265 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
8266
8267 static void *_p_CvTypedSeqT_CvTupleT_CvPoint_2_t_tTo_p_CvSeq(void *x, int *SWIGUNUSEDPARM(newmemory)) {
8268     return (void *)((CvSeq *)  ((CvTypedSeq< CvTuple< CvPoint,2 > > *) x));
8269 }
8270 static void *_p_CvTypedSeqT_CvTupleT_float_2_t_tTo_p_CvSeq(void *x, int *SWIGUNUSEDPARM(newmemory)) {
8271     return (void *)((CvSeq *)  ((CvTypedSeq< CvTuple< float,2 > > *) x));
8272 }
8273 static void *_p_CvTypedSeqT_CvConnectedComp_tTo_p_CvSeq(void *x, int *SWIGUNUSEDPARM(newmemory)) {
8274     return (void *)((CvSeq *)  ((CvTypedSeq< CvConnectedComp > *) x));
8275 }
8276 static void *_p_CvTypedSeqT_CvRect_tTo_p_CvSeq(void *x, int *SWIGUNUSEDPARM(newmemory)) {
8277     return (void *)((CvSeq *)  ((CvTypedSeq< CvRect > *) x));
8278 }
8279 static void *_p_CvTypedSeqT_CvPoint_tTo_p_CvSeq(void *x, int *SWIGUNUSEDPARM(newmemory)) {
8280     return (void *)((CvSeq *)  ((CvTypedSeq< CvPoint > *) x));
8281 }
8282 static void *_p_CvTypedSeqT_CvTupleT_float_3_t_tTo_p_CvSeq(void *x, int *SWIGUNUSEDPARM(newmemory)) {
8283     return (void *)((CvSeq *)  ((CvTypedSeq< CvTuple< float,3 > > *) x));
8284 }
8285 static void *_p_CvTypedSeqT_CvSeq_p_tTo_p_CvSeq(void *x, int *SWIGUNUSEDPARM(newmemory)) {
8286     return (void *)((CvSeq *)  ((CvTypedSeq< CvSeq * > *) x));
8287 }
8288 static void *_p_CvTypedSeqT_CvQuadEdge2D_tTo_p_CvSeq(void *x, int *SWIGUNUSEDPARM(newmemory)) {
8289     return (void *)((CvSeq *)  ((CvTypedSeq< CvQuadEdge2D > *) x));
8290 }
8291 static void *_p_CvTypedSeqT_CvPoint2D32f_tTo_p_CvSeq(void *x, int *SWIGUNUSEDPARM(newmemory)) {
8292     return (void *)((CvSeq *)  ((CvTypedSeq< CvPoint2D32f > *) x));
8293 }
8294 static swig_type_info _swigt__p_Cv32suf = {"_p_Cv32suf", "Cv32suf *", 0, 0, (void*)0, 0};
8295 static swig_type_info _swigt__p_Cv64suf = {"_p_Cv64suf", "Cv64suf *", 0, 0, (void*)0, 0};
8296 static swig_type_info _swigt__p_CvAttrList = {"_p_CvAttrList", "CvAttrList *", 0, 0, (void*)0, 0};
8297 static swig_type_info _swigt__p_CvAvgComp = {"_p_CvAvgComp", "CvAvgComp *", 0, 0, (void*)0, 0};
8298 static swig_type_info _swigt__p_CvBox2D = {"_p_CvBox2D", "CvBox2D *", 0, 0, (void*)0, 0};
8299 static swig_type_info _swigt__p_CvCapture = {"_p_CvCapture", "CvCapture *", 0, 0, (void*)0, 0};
8300 static swig_type_info _swigt__p_CvChain = {"_p_CvChain", "CvChain *", 0, 0, (void*)0, 0};
8301 static swig_type_info _swigt__p_CvChainPtReader = {"_p_CvChainPtReader", "CvChainPtReader *", 0, 0, (void*)0, 0};
8302 static swig_type_info _swigt__p_CvConDensation = {"_p_CvConDensation", "CvConDensation *", 0, 0, (void*)0, 0};
8303 static swig_type_info _swigt__p_CvConnectedComp = {"_p_CvConnectedComp", "CvConnectedComp *", 0, 0, (void*)0, 0};
8304 static swig_type_info _swigt__p_CvContour = {"_p_CvContour", "CvPoint2DSeq *|CvContour *", 0, 0, (void*)0, 0};
8305 static swig_type_info _swigt__p_CvContourTree = {"_p_CvContourTree", "CvContourTree *", 0, 0, (void*)0, 0};
8306 static swig_type_info _swigt__p_CvConvexityDefect = {"_p_CvConvexityDefect", "CvConvexityDefect *", 0, 0, (void*)0, 0};
8307 static swig_type_info _swigt__p_CvFileNode = {"_p_CvFileNode", "CvFileNode *", 0, 0, (void*)0, 0};
8308 static swig_type_info _swigt__p_CvFileStorage = {"_p_CvFileStorage", "CvFileStorage *", 0, 0, (void*)0, 0};
8309 static swig_type_info _swigt__p_CvFilter = {"_p_CvFilter", "enum CvFilter *|CvFilter *", 0, 0, (void*)0, 0};
8310 static swig_type_info _swigt__p_CvFont = {"_p_CvFont", "CvFont *", 0, 0, (void*)0, 0};
8311 static swig_type_info _swigt__p_CvGenericHash = {"_p_CvGenericHash", "CvGenericHash *|CvFileNodeHash *", 0, 0, (void*)0, 0};
8312 static swig_type_info _swigt__p_CvGraph = {"_p_CvGraph", "CvGraph *", 0, 0, (void*)0, 0};
8313 static swig_type_info _swigt__p_CvGraphEdge = {"_p_CvGraphEdge", "CvGraphEdge *", 0, 0, (void*)0, 0};
8314 static swig_type_info _swigt__p_CvGraphScanner = {"_p_CvGraphScanner", "CvGraphScanner *", 0, 0, (void*)0, 0};
8315 static swig_type_info _swigt__p_CvGraphVtx = {"_p_CvGraphVtx", "CvGraphVtx *", 0, 0, (void*)0, 0};
8316 static swig_type_info _swigt__p_CvGraphVtx2D = {"_p_CvGraphVtx2D", "CvGraphVtx2D *", 0, 0, (void*)0, 0};
8317 static swig_type_info _swigt__p_CvHaarClassifier = {"_p_CvHaarClassifier", "CvHaarClassifier *", 0, 0, (void*)0, 0};
8318 static swig_type_info _swigt__p_CvHaarClassifierCascade = {"_p_CvHaarClassifierCascade", "CvHaarClassifierCascade *", 0, 0, (void*)0, 0};
8319 static swig_type_info _swigt__p_CvHaarFeature = {"_p_CvHaarFeature", "CvHaarFeature *", 0, 0, (void*)0, 0};
8320 static swig_type_info _swigt__p_CvHaarStageClassifier = {"_p_CvHaarStageClassifier", "CvHaarStageClassifier *", 0, 0, (void*)0, 0};
8321 static swig_type_info _swigt__p_CvHidHaarClassifierCascade = {"_p_CvHidHaarClassifierCascade", "CvHidHaarClassifierCascade *", 0, 0, (void*)0, 0};
8322 static swig_type_info _swigt__p_CvHistogram = {"_p_CvHistogram", "CvHistogram *", 0, 0, (void*)0, 0};
8323 static swig_type_info _swigt__p_CvHuMoments = {"_p_CvHuMoments", "CvHuMoments *", 0, 0, (void*)0, 0};
8324 static swig_type_info _swigt__p_CvKalman = {"_p_CvKalman", "CvKalman *", 0, 0, (void*)0, 0};
8325 static swig_type_info _swigt__p_CvLineIterator = {"_p_CvLineIterator", "CvLineIterator *", 0, 0, (void*)0, 0};
8326 static swig_type_info _swigt__p_CvMSERParams = {"_p_CvMSERParams", "CvMSERParams *", 0, 0, (void*)0, 0};
8327 static swig_type_info _swigt__p_CvMat = {"_p_CvMat", "CvMat *", 0, 0, (void*)0, 0};
8328 static swig_type_info _swigt__p_CvMatND = {"_p_CvMatND", "CvMatND *", 0, 0, (void*)0, 0};
8329 static swig_type_info _swigt__p_CvMatrix3 = {"_p_CvMatrix3", "CvMatrix3 *", 0, 0, (void*)0, 0};
8330 static swig_type_info _swigt__p_CvMemBlock = {"_p_CvMemBlock", "CvMemBlock *", 0, 0, (void*)0, 0};
8331 static swig_type_info _swigt__p_CvMemStorage = {"_p_CvMemStorage", "CvMemStorage *", 0, 0, (void*)0, 0};
8332 static swig_type_info _swigt__p_CvMemStoragePos = {"_p_CvMemStoragePos", "CvMemStoragePos *", 0, 0, (void*)0, 0};
8333 static swig_type_info _swigt__p_CvModuleInfo = {"_p_CvModuleInfo", "CvModuleInfo *", 0, 0, (void*)0, 0};
8334 static swig_type_info _swigt__p_CvMoments = {"_p_CvMoments", "CvMoments *", 0, 0, (void*)0, 0};
8335 static swig_type_info _swigt__p_CvNArrayIterator = {"_p_CvNArrayIterator", "CvNArrayIterator *", 0, 0, (void*)0, 0};
8336 static swig_type_info _swigt__p_CvNextEdgeType = {"_p_CvNextEdgeType", "enum CvNextEdgeType *|CvNextEdgeType *", 0, 0, (void*)0, 0};
8337 static swig_type_info _swigt__p_CvPOSITObject = {"_p_CvPOSITObject", "CvPOSITObject *", 0, 0, (void*)0, 0};
8338 static swig_type_info _swigt__p_CvPluginFuncInfo = {"_p_CvPluginFuncInfo", "CvPluginFuncInfo *", 0, 0, (void*)0, 0};
8339 static swig_type_info _swigt__p_CvPoint = {"_p_CvPoint", "CvPoint *", 0, 0, (void*)0, 0};
8340 static swig_type_info _swigt__p_CvPoint2D32f = {"_p_CvPoint2D32f", "CvPoint2D32f *", 0, 0, (void*)0, 0};
8341 static swig_type_info _swigt__p_CvPoint2D64f = {"_p_CvPoint2D64f", "CvPoint2D64f *", 0, 0, (void*)0, 0};
8342 static swig_type_info _swigt__p_CvPoint3D32f = {"_p_CvPoint3D32f", "CvPoint3D32f *", 0, 0, (void*)0, 0};
8343 static swig_type_info _swigt__p_CvPoint3D64f = {"_p_CvPoint3D64f", "CvPoint3D64f *", 0, 0, (void*)0, 0};
8344 static swig_type_info _swigt__p_CvQuadEdge2D = {"_p_CvQuadEdge2D", "CvQuadEdge2D *", 0, 0, (void*)0, 0};
8345 static swig_type_info _swigt__p_CvRNG_Wrapper = {"_p_CvRNG_Wrapper", "CvRNG_Wrapper *", 0, 0, (void*)0, 0};
8346 static swig_type_info _swigt__p_CvRect = {"_p_CvRect", "CvRect *", 0, 0, (void*)0, 0};
8347 static swig_type_info _swigt__p_CvSURFParams = {"_p_CvSURFParams", "CvSURFParams *", 0, 0, (void*)0, 0};
8348 static swig_type_info _swigt__p_CvSURFPoint = {"_p_CvSURFPoint", "CvSURFPoint *", 0, 0, (void*)0, 0};
8349 static swig_type_info _swigt__p_CvScalar = {"_p_CvScalar", "CvScalar *", 0, 0, (void*)0, 0};
8350 static swig_type_info _swigt__p_CvSeq = {"_p_CvSeq", "CvSeq *", 0, 0, (void*)0, 0};
8351 static swig_type_info _swigt__p_CvTypedSeqT_CvTupleT_CvPoint_2_t_t = {"_p_CvTypedSeqT_CvTupleT_CvPoint_2_t_t", 0, 0, 0, 0, 0};
8352 static swig_type_info _swigt__p_CvTypedSeqT_CvTupleT_float_2_t_t = {"_p_CvTypedSeqT_CvTupleT_float_2_t_t", 0, 0, 0, 0, 0};
8353 static swig_type_info _swigt__p_CvTypedSeqT_CvRect_t = {"_p_CvTypedSeqT_CvRect_t", 0, 0, 0, 0, 0};
8354 static swig_type_info _swigt__p_CvTypedSeqT_CvPoint_t = {"_p_CvTypedSeqT_CvPoint_t", 0, 0, 0, 0, 0};
8355 static swig_type_info _swigt__p_CvTypedSeqT_CvQuadEdge2D_t = {"_p_CvTypedSeqT_CvQuadEdge2D_t", 0, 0, 0, 0, 0};
8356 static swig_type_info _swigt__p_CvTypedSeqT_CvSeq_p_t = {"_p_CvTypedSeqT_CvSeq_p_t", 0, 0, 0, 0, 0};
8357 static swig_type_info _swigt__p_CvTypedSeqT_CvPoint2D32f_t = {"_p_CvTypedSeqT_CvPoint2D32f_t", 0, 0, 0, 0, 0};
8358 static swig_type_info _swigt__p_CvTypedSeqT_CvTupleT_float_3_t_t = {"_p_CvTypedSeqT_CvTupleT_float_3_t_t", 0, 0, 0, 0, 0};
8359 static swig_type_info _swigt__p_CvTypedSeqT_CvConnectedComp_t = {"_p_CvTypedSeqT_CvConnectedComp_t", 0, 0, 0, 0, 0};
8360 static swig_type_info _swigt__p_CvSeqBlock = {"_p_CvSeqBlock", "CvSeqBlock *", 0, 0, (void*)0, 0};
8361 static swig_type_info _swigt__p_CvSeqReader = {"_p_CvSeqReader", "CvSeqReader *", 0, 0, (void*)0, 0};
8362 static swig_type_info _swigt__p_CvSeqWriter = {"_p_CvSeqWriter", "CvSeqWriter *", 0, 0, (void*)0, 0};
8363 static swig_type_info _swigt__p_CvSet = {"_p_CvSet", "CvSet *", 0, 0, (void*)0, 0};
8364 static swig_type_info _swigt__p_CvSetElem = {"_p_CvSetElem", "CvSetElem *", 0, 0, (void*)0, 0};
8365 static swig_type_info _swigt__p_CvSize = {"_p_CvSize", "CvSize *", 0, 0, (void*)0, 0};
8366 static swig_type_info _swigt__p_CvSize2D32f = {"_p_CvSize2D32f", "CvSize2D32f *", 0, 0, (void*)0, 0};
8367 static swig_type_info _swigt__p_CvSlice = {"_p_CvSlice", "CvSlice *", 0, 0, (void*)0, 0};
8368 static swig_type_info _swigt__p_CvSparseMat = {"_p_CvSparseMat", "CvSparseMat *", 0, 0, (void*)0, 0};
8369 static swig_type_info _swigt__p_CvSparseMatIterator = {"_p_CvSparseMatIterator", "CvSparseMatIterator *", 0, 0, (void*)0, 0};
8370 static swig_type_info _swigt__p_CvSparseNode = {"_p_CvSparseNode", "CvSparseNode *", 0, 0, (void*)0, 0};
8371 static swig_type_info _swigt__p_CvStarDetectorParams = {"_p_CvStarDetectorParams", "CvStarDetectorParams *", 0, 0, (void*)0, 0};
8372 static swig_type_info _swigt__p_CvStarKeypoint = {"_p_CvStarKeypoint", "CvStarKeypoint *", 0, 0, (void*)0, 0};
8373 static swig_type_info _swigt__p_CvStereoBMState = {"_p_CvStereoBMState", "CvStereoBMState *", 0, 0, (void*)0, 0};
8374 static swig_type_info _swigt__p_CvStereoGCState = {"_p_CvStereoGCState", "CvStereoGCState *", 0, 0, (void*)0, 0};
8375 static swig_type_info _swigt__p_CvString = {"_p_CvString", "CvString *", 0, 0, (void*)0, 0};
8376 static swig_type_info _swigt__p_CvStringHashNode = {"_p_CvStringHashNode", "CvStringHashNode *", 0, 0, (void*)0, 0};
8377 static swig_type_info _swigt__p_CvSubdiv2D = {"_p_CvSubdiv2D", "CvSubdiv2D *", 0, 0, (void*)0, 0};
8378 static swig_type_info _swigt__p_CvSubdiv2DEdge_Wrapper = {"_p_CvSubdiv2DEdge_Wrapper", "CvSubdiv2DEdge_Wrapper *", 0, 0, (void*)0, 0};
8379 static swig_type_info _swigt__p_CvSubdiv2DPoint = {"_p_CvSubdiv2DPoint", "CvSubdiv2DPoint *", 0, 0, (void*)0, 0};
8380 static swig_type_info _swigt__p_CvSubdiv2DPointLocation = {"_p_CvSubdiv2DPointLocation", "enum CvSubdiv2DPointLocation *|CvSubdiv2DPointLocation *", 0, 0, (void*)0, 0};
8381 static swig_type_info _swigt__p_CvTermCriteria = {"_p_CvTermCriteria", "CvTermCriteria *", 0, 0, (void*)0, 0};
8382 static swig_type_info _swigt__p_CvTreeNodeIterator = {"_p_CvTreeNodeIterator", "CvTreeNodeIterator *", 0, 0, (void*)0, 0};
8383 static swig_type_info _swigt__p_CvTypeInfo = {"_p_CvTypeInfo", "CvTypeInfo *", 0, 0, (void*)0, 0};
8384 static swig_type_info _swigt__p_CvVideoWriter = {"_p_CvVideoWriter", "CvVideoWriter *", 0, 0, (void*)0, 0};
8385 static swig_type_info _swigt__p_CvvImage = {"_p_CvvImage", "CvvImage *|CImage *", 0, 0, (void*)0, 0};
8386 static swig_type_info _swigt__p__IplConvKernel = {"_p__IplConvKernel", "_IplConvKernel *|IplConvKernel *", 0, 0, (void*)0, 0};
8387 static swig_type_info _swigt__p__IplConvKernelFP = {"_p__IplConvKernelFP", "_IplConvKernelFP *|IplConvKernelFP *", 0, 0, (void*)0, 0};
8388 static swig_type_info _swigt__p__IplImage = {"_p__IplImage", "_IplImage *|IplImage *", 0, 0, (void*)0, 0};
8389 static swig_type_info _swigt__p__IplROI = {"_p__IplROI", "_IplROI *|IplROI *", 0, 0, (void*)0, 0};
8390 static swig_type_info _swigt__p__IplTileInfo = {"_p__IplTileInfo", "_IplTileInfo *|IplTileInfo *", 0, 0, (void*)0, 0};
8391 static swig_type_info _swigt__p_allocator_type = {"_p_allocator_type", "allocator_type *", 0, 0, (void*)0, 0};
8392 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
8393 static swig_type_info _swigt__p_difference_type = {"_p_difference_type", "difference_type *", 0, 0, (void*)0, 0};
8394 static swig_type_info _swigt__p_f_int__void = {"_p_f_int__void", "void (*)(int)|CvTrackbarCallback", 0, 0, (void*)0, 0};
8395 static swig_type_info _swigt__p_f_int_int_int_int_p_void__void = {"_p_f_int_int_int_int_p_void__void", "void (*)(int,int,int,int,void *)|CvMouseCallback", 0, 0, (void*)0, 0};
8396 static swig_type_info _swigt__p_f_int_p_void__void = {"_p_f_int_p_void__void", "CvTrackbarCallback2|void (*)(int,void *)", 0, 0, (void*)0, 0};
8397 static swig_type_info _swigt__p_float = {"_p_float", "float *", 0, 0, (void*)0, 0};
8398 static swig_type_info _swigt__p_int = {"_p_int", "CvHistType *|int *|CVStatus *", 0, 0, (void*)0, 0};
8399 static swig_type_info _swigt__p_int64_t = {"_p_int64_t", "int64_t *|int64 *", 0, 0, (void*)0, 0};
8400 static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
8401 static swig_type_info _swigt__p_signed_char = {"_p_signed_char", "schar *|signed char *", 0, 0, (void*)0, 0};
8402 static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *|CvSubdiv2DEdge *", 0, 0, (void*)0, 0};
8403 static swig_type_info _swigt__p_size_type = {"_p_size_type", "size_type *", 0, 0, (void*)0, 0};
8404 static swig_type_info _swigt__p_uint64_t = {"_p_uint64_t", "uint64_t *|uint64 *|CvRNG *", 0, 0, (void*)0, 0};
8405 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "uchar *|unsigned char *", 0, 0, (void*)0, 0};
8406 static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|ushort *", 0, 0, (void*)0, 0};
8407 static swig_type_info _swigt__p_value_type = {"_p_value_type", "value_type *", 0, 0, (void*)0, 0};
8408 static swig_type_info _swigt__p_void = {"_p_void", "CvArr *|void *", 0, 0, (void*)0, 0};
8409
8410 static swig_type_info *swig_type_initial[] = {
8411   &_swigt__p_Cv32suf,
8412   &_swigt__p_Cv64suf,
8413   &_swigt__p_CvAttrList,
8414   &_swigt__p_CvAvgComp,
8415   &_swigt__p_CvBox2D,
8416   &_swigt__p_CvCapture,
8417   &_swigt__p_CvChain,
8418   &_swigt__p_CvChainPtReader,
8419   &_swigt__p_CvConDensation,
8420   &_swigt__p_CvConnectedComp,
8421   &_swigt__p_CvContour,
8422   &_swigt__p_CvContourTree,
8423   &_swigt__p_CvConvexityDefect,
8424   &_swigt__p_CvFileNode,
8425   &_swigt__p_CvFileStorage,
8426   &_swigt__p_CvFilter,
8427   &_swigt__p_CvFont,
8428   &_swigt__p_CvGenericHash,
8429   &_swigt__p_CvGraph,
8430   &_swigt__p_CvGraphEdge,
8431   &_swigt__p_CvGraphScanner,
8432   &_swigt__p_CvGraphVtx,
8433   &_swigt__p_CvGraphVtx2D,
8434   &_swigt__p_CvHaarClassifier,
8435   &_swigt__p_CvHaarClassifierCascade,
8436   &_swigt__p_CvHaarFeature,
8437   &_swigt__p_CvHaarStageClassifier,
8438   &_swigt__p_CvHidHaarClassifierCascade,
8439   &_swigt__p_CvHistogram,
8440   &_swigt__p_CvHuMoments,
8441   &_swigt__p_CvKalman,
8442   &_swigt__p_CvLineIterator,
8443   &_swigt__p_CvMSERParams,
8444   &_swigt__p_CvMat,
8445   &_swigt__p_CvMatND,
8446   &_swigt__p_CvMatrix3,
8447   &_swigt__p_CvMemBlock,
8448   &_swigt__p_CvMemStorage,
8449   &_swigt__p_CvMemStoragePos,
8450   &_swigt__p_CvModuleInfo,
8451   &_swigt__p_CvMoments,
8452   &_swigt__p_CvNArrayIterator,
8453   &_swigt__p_CvNextEdgeType,
8454   &_swigt__p_CvPOSITObject,
8455   &_swigt__p_CvPluginFuncInfo,
8456   &_swigt__p_CvPoint,
8457   &_swigt__p_CvPoint2D32f,
8458   &_swigt__p_CvPoint2D64f,
8459   &_swigt__p_CvPoint3D32f,
8460   &_swigt__p_CvPoint3D64f,
8461   &_swigt__p_CvQuadEdge2D,
8462   &_swigt__p_CvRNG_Wrapper,
8463   &_swigt__p_CvRect,
8464   &_swigt__p_CvSURFParams,
8465   &_swigt__p_CvSURFPoint,
8466   &_swigt__p_CvScalar,
8467   &_swigt__p_CvSeq,
8468   &_swigt__p_CvSeqBlock,
8469   &_swigt__p_CvSeqReader,
8470   &_swigt__p_CvSeqWriter,
8471   &_swigt__p_CvSet,
8472   &_swigt__p_CvSetElem,
8473   &_swigt__p_CvSize,
8474   &_swigt__p_CvSize2D32f,
8475   &_swigt__p_CvSlice,
8476   &_swigt__p_CvSparseMat,
8477   &_swigt__p_CvSparseMatIterator,
8478   &_swigt__p_CvSparseNode,
8479   &_swigt__p_CvStarDetectorParams,
8480   &_swigt__p_CvStarKeypoint,
8481   &_swigt__p_CvStereoBMState,
8482   &_swigt__p_CvStereoGCState,
8483   &_swigt__p_CvString,
8484   &_swigt__p_CvStringHashNode,
8485   &_swigt__p_CvSubdiv2D,
8486   &_swigt__p_CvSubdiv2DEdge_Wrapper,
8487   &_swigt__p_CvSubdiv2DPoint,
8488   &_swigt__p_CvSubdiv2DPointLocation,
8489   &_swigt__p_CvTermCriteria,
8490   &_swigt__p_CvTreeNodeIterator,
8491   &_swigt__p_CvTypeInfo,
8492   &_swigt__p_CvTypedSeqT_CvConnectedComp_t,
8493   &_swigt__p_CvTypedSeqT_CvPoint2D32f_t,
8494   &_swigt__p_CvTypedSeqT_CvPoint_t,
8495   &_swigt__p_CvTypedSeqT_CvQuadEdge2D_t,
8496   &_swigt__p_CvTypedSeqT_CvRect_t,
8497   &_swigt__p_CvTypedSeqT_CvSeq_p_t,
8498   &_swigt__p_CvTypedSeqT_CvTupleT_CvPoint_2_t_t,
8499   &_swigt__p_CvTypedSeqT_CvTupleT_float_2_t_t,
8500   &_swigt__p_CvTypedSeqT_CvTupleT_float_3_t_t,
8501   &_swigt__p_CvVideoWriter,
8502   &_swigt__p_CvvImage,
8503   &_swigt__p__IplConvKernel,
8504   &_swigt__p__IplConvKernelFP,
8505   &_swigt__p__IplImage,
8506   &_swigt__p__IplROI,
8507   &_swigt__p__IplTileInfo,
8508   &_swigt__p_allocator_type,
8509   &_swigt__p_char,
8510   &_swigt__p_difference_type,
8511   &_swigt__p_f_int__void,
8512   &_swigt__p_f_int_int_int_int_p_void__void,
8513   &_swigt__p_f_int_p_void__void,
8514   &_swigt__p_float,
8515   &_swigt__p_int,
8516   &_swigt__p_int64_t,
8517   &_swigt__p_p_char,
8518   &_swigt__p_signed_char,
8519   &_swigt__p_size_t,
8520   &_swigt__p_size_type,
8521   &_swigt__p_uint64_t,
8522   &_swigt__p_unsigned_char,
8523   &_swigt__p_unsigned_short,
8524   &_swigt__p_value_type,
8525   &_swigt__p_void,
8526 };
8527
8528 static swig_cast_info _swigc__p_Cv32suf[] = {  {&_swigt__p_Cv32suf, 0, 0, 0},{0, 0, 0, 0}};
8529 static swig_cast_info _swigc__p_Cv64suf[] = {  {&_swigt__p_Cv64suf, 0, 0, 0},{0, 0, 0, 0}};
8530 static swig_cast_info _swigc__p_CvAttrList[] = {  {&_swigt__p_CvAttrList, 0, 0, 0},{0, 0, 0, 0}};
8531 static swig_cast_info _swigc__p_CvAvgComp[] = {  {&_swigt__p_CvAvgComp, 0, 0, 0},{0, 0, 0, 0}};
8532 static swig_cast_info _swigc__p_CvBox2D[] = {  {&_swigt__p_CvBox2D, 0, 0, 0},{0, 0, 0, 0}};
8533 static swig_cast_info _swigc__p_CvCapture[] = {  {&_swigt__p_CvCapture, 0, 0, 0},{0, 0, 0, 0}};
8534 static swig_cast_info _swigc__p_CvChain[] = {  {&_swigt__p_CvChain, 0, 0, 0},{0, 0, 0, 0}};
8535 static swig_cast_info _swigc__p_CvChainPtReader[] = {  {&_swigt__p_CvChainPtReader, 0, 0, 0},{0, 0, 0, 0}};
8536 static swig_cast_info _swigc__p_CvConDensation[] = {  {&_swigt__p_CvConDensation, 0, 0, 0},{0, 0, 0, 0}};
8537 static swig_cast_info _swigc__p_CvConnectedComp[] = {  {&_swigt__p_CvConnectedComp, 0, 0, 0},{0, 0, 0, 0}};
8538 static swig_cast_info _swigc__p_CvContour[] = {  {&_swigt__p_CvContour, 0, 0, 0},{0, 0, 0, 0}};
8539 static swig_cast_info _swigc__p_CvContourTree[] = {  {&_swigt__p_CvContourTree, 0, 0, 0},{0, 0, 0, 0}};
8540 static swig_cast_info _swigc__p_CvConvexityDefect[] = {  {&_swigt__p_CvConvexityDefect, 0, 0, 0},{0, 0, 0, 0}};
8541 static swig_cast_info _swigc__p_CvFileNode[] = {  {&_swigt__p_CvFileNode, 0, 0, 0},{0, 0, 0, 0}};
8542 static swig_cast_info _swigc__p_CvFileStorage[] = {  {&_swigt__p_CvFileStorage, 0, 0, 0},{0, 0, 0, 0}};
8543 static swig_cast_info _swigc__p_CvFilter[] = {  {&_swigt__p_CvFilter, 0, 0, 0},{0, 0, 0, 0}};
8544 static swig_cast_info _swigc__p_CvFont[] = {  {&_swigt__p_CvFont, 0, 0, 0},{0, 0, 0, 0}};
8545 static swig_cast_info _swigc__p_CvGenericHash[] = {  {&_swigt__p_CvGenericHash, 0, 0, 0},{0, 0, 0, 0}};
8546 static swig_cast_info _swigc__p_CvGraph[] = {  {&_swigt__p_CvGraph, 0, 0, 0},{0, 0, 0, 0}};
8547 static swig_cast_info _swigc__p_CvGraphEdge[] = {  {&_swigt__p_CvGraphEdge, 0, 0, 0},{0, 0, 0, 0}};
8548 static swig_cast_info _swigc__p_CvGraphScanner[] = {  {&_swigt__p_CvGraphScanner, 0, 0, 0},{0, 0, 0, 0}};
8549 static swig_cast_info _swigc__p_CvGraphVtx[] = {  {&_swigt__p_CvGraphVtx, 0, 0, 0},{0, 0, 0, 0}};
8550 static swig_cast_info _swigc__p_CvGraphVtx2D[] = {  {&_swigt__p_CvGraphVtx2D, 0, 0, 0},{0, 0, 0, 0}};
8551 static swig_cast_info _swigc__p_CvHaarClassifier[] = {  {&_swigt__p_CvHaarClassifier, 0, 0, 0},{0, 0, 0, 0}};
8552 static swig_cast_info _swigc__p_CvHaarClassifierCascade[] = {  {&_swigt__p_CvHaarClassifierCascade, 0, 0, 0},{0, 0, 0, 0}};
8553 static swig_cast_info _swigc__p_CvHaarFeature[] = {  {&_swigt__p_CvHaarFeature, 0, 0, 0},{0, 0, 0, 0}};
8554 static swig_cast_info _swigc__p_CvHaarStageClassifier[] = {  {&_swigt__p_CvHaarStageClassifier, 0, 0, 0},{0, 0, 0, 0}};
8555 static swig_cast_info _swigc__p_CvHidHaarClassifierCascade[] = {  {&_swigt__p_CvHidHaarClassifierCascade, 0, 0, 0},{0, 0, 0, 0}};
8556 static swig_cast_info _swigc__p_CvHistogram[] = {  {&_swigt__p_CvHistogram, 0, 0, 0},{0, 0, 0, 0}};
8557 static swig_cast_info _swigc__p_CvHuMoments[] = {  {&_swigt__p_CvHuMoments, 0, 0, 0},{0, 0, 0, 0}};
8558 static swig_cast_info _swigc__p_CvKalman[] = {  {&_swigt__p_CvKalman, 0, 0, 0},{0, 0, 0, 0}};
8559 static swig_cast_info _swigc__p_CvLineIterator[] = {  {&_swigt__p_CvLineIterator, 0, 0, 0},{0, 0, 0, 0}};
8560 static swig_cast_info _swigc__p_CvMSERParams[] = {  {&_swigt__p_CvMSERParams, 0, 0, 0},{0, 0, 0, 0}};
8561 static swig_cast_info _swigc__p_CvMat[] = {  {&_swigt__p_CvMat, 0, 0, 0},{0, 0, 0, 0}};
8562 static swig_cast_info _swigc__p_CvMatND[] = {  {&_swigt__p_CvMatND, 0, 0, 0},{0, 0, 0, 0}};
8563 static swig_cast_info _swigc__p_CvMatrix3[] = {  {&_swigt__p_CvMatrix3, 0, 0, 0},{0, 0, 0, 0}};
8564 static swig_cast_info _swigc__p_CvMemBlock[] = {  {&_swigt__p_CvMemBlock, 0, 0, 0},{0, 0, 0, 0}};
8565 static swig_cast_info _swigc__p_CvMemStorage[] = {  {&_swigt__p_CvMemStorage, 0, 0, 0},{0, 0, 0, 0}};
8566 static swig_cast_info _swigc__p_CvMemStoragePos[] = {  {&_swigt__p_CvMemStoragePos, 0, 0, 0},{0, 0, 0, 0}};
8567 static swig_cast_info _swigc__p_CvModuleInfo[] = {  {&_swigt__p_CvModuleInfo, 0, 0, 0},{0, 0, 0, 0}};
8568 static swig_cast_info _swigc__p_CvMoments[] = {  {&_swigt__p_CvMoments, 0, 0, 0},{0, 0, 0, 0}};
8569 static swig_cast_info _swigc__p_CvNArrayIterator[] = {  {&_swigt__p_CvNArrayIterator, 0, 0, 0},{0, 0, 0, 0}};
8570 static swig_cast_info _swigc__p_CvNextEdgeType[] = {  {&_swigt__p_CvNextEdgeType, 0, 0, 0},{0, 0, 0, 0}};
8571 static swig_cast_info _swigc__p_CvPOSITObject[] = {  {&_swigt__p_CvPOSITObject, 0, 0, 0},{0, 0, 0, 0}};
8572 static swig_cast_info _swigc__p_CvPluginFuncInfo[] = {  {&_swigt__p_CvPluginFuncInfo, 0, 0, 0},{0, 0, 0, 0}};
8573 static swig_cast_info _swigc__p_CvPoint[] = {  {&_swigt__p_CvPoint, 0, 0, 0},{0, 0, 0, 0}};
8574 static swig_cast_info _swigc__p_CvPoint2D32f[] = {  {&_swigt__p_CvPoint2D32f, 0, 0, 0},{0, 0, 0, 0}};
8575 static swig_cast_info _swigc__p_CvPoint2D64f[] = {  {&_swigt__p_CvPoint2D64f, 0, 0, 0},{0, 0, 0, 0}};
8576 static swig_cast_info _swigc__p_CvPoint3D32f[] = {  {&_swigt__p_CvPoint3D32f, 0, 0, 0},{0, 0, 0, 0}};
8577 static swig_cast_info _swigc__p_CvPoint3D64f[] = {  {&_swigt__p_CvPoint3D64f, 0, 0, 0},{0, 0, 0, 0}};
8578 static swig_cast_info _swigc__p_CvQuadEdge2D[] = {  {&_swigt__p_CvQuadEdge2D, 0, 0, 0},{0, 0, 0, 0}};
8579 static swig_cast_info _swigc__p_CvRNG_Wrapper[] = {  {&_swigt__p_CvRNG_Wrapper, 0, 0, 0},{0, 0, 0, 0}};
8580 static swig_cast_info _swigc__p_CvRect[] = {  {&_swigt__p_CvRect, 0, 0, 0},{0, 0, 0, 0}};
8581 static swig_cast_info _swigc__p_CvSURFParams[] = {  {&_swigt__p_CvSURFParams, 0, 0, 0},{0, 0, 0, 0}};
8582 static swig_cast_info _swigc__p_CvSURFPoint[] = {  {&_swigt__p_CvSURFPoint, 0, 0, 0},{0, 0, 0, 0}};
8583 static swig_cast_info _swigc__p_CvScalar[] = {  {&_swigt__p_CvScalar, 0, 0, 0},{0, 0, 0, 0}};
8584 static swig_cast_info _swigc__p_CvTypedSeqT_CvTupleT_CvPoint_2_t_t[] = {{&_swigt__p_CvTypedSeqT_CvTupleT_CvPoint_2_t_t, 0, 0, 0},{0, 0, 0, 0}};
8585 static swig_cast_info _swigc__p_CvTypedSeqT_CvTupleT_float_2_t_t[] = {{&_swigt__p_CvTypedSeqT_CvTupleT_float_2_t_t, 0, 0, 0},{0, 0, 0, 0}};
8586 static swig_cast_info _swigc__p_CvTypedSeqT_CvRect_t[] = {{&_swigt__p_CvTypedSeqT_CvRect_t, 0, 0, 0},{0, 0, 0, 0}};
8587 static swig_cast_info _swigc__p_CvTypedSeqT_CvPoint_t[] = {{&_swigt__p_CvTypedSeqT_CvPoint_t, 0, 0, 0},{0, 0, 0, 0}};
8588 static swig_cast_info _swigc__p_CvTypedSeqT_CvQuadEdge2D_t[] = {{&_swigt__p_CvTypedSeqT_CvQuadEdge2D_t, 0, 0, 0},{0, 0, 0, 0}};
8589 static swig_cast_info _swigc__p_CvTypedSeqT_CvSeq_p_t[] = {{&_swigt__p_CvTypedSeqT_CvSeq_p_t, 0, 0, 0},{0, 0, 0, 0}};
8590 static swig_cast_info _swigc__p_CvTypedSeqT_CvPoint2D32f_t[] = {{&_swigt__p_CvTypedSeqT_CvPoint2D32f_t, 0, 0, 0},{0, 0, 0, 0}};
8591 static swig_cast_info _swigc__p_CvTypedSeqT_CvTupleT_float_3_t_t[] = {{&_swigt__p_CvTypedSeqT_CvTupleT_float_3_t_t, 0, 0, 0},{0, 0, 0, 0}};
8592 static swig_cast_info _swigc__p_CvTypedSeqT_CvConnectedComp_t[] = {{&_swigt__p_CvTypedSeqT_CvConnectedComp_t, 0, 0, 0},{0, 0, 0, 0}};
8593 static swig_cast_info _swigc__p_CvSeq[] = {  {&_swigt__p_CvTypedSeqT_CvTupleT_CvPoint_2_t_t, _p_CvTypedSeqT_CvTupleT_CvPoint_2_t_tTo_p_CvSeq, 0, 0},  {&_swigt__p_CvTypedSeqT_CvTupleT_float_2_t_t, _p_CvTypedSeqT_CvTupleT_float_2_t_tTo_p_CvSeq, 0, 0},  {&_swigt__p_CvTypedSeqT_CvRect_t, _p_CvTypedSeqT_CvRect_tTo_p_CvSeq, 0, 0},  {&_swigt__p_CvTypedSeqT_CvPoint_t, _p_CvTypedSeqT_CvPoint_tTo_p_CvSeq, 0, 0},  {&_swigt__p_CvTypedSeqT_CvQuadEdge2D_t, _p_CvTypedSeqT_CvQuadEdge2D_tTo_p_CvSeq, 0, 0},  {&_swigt__p_CvTypedSeqT_CvSeq_p_t, _p_CvTypedSeqT_CvSeq_p_tTo_p_CvSeq, 0, 0},  {&_swigt__p_CvTypedSeqT_CvPoint2D32f_t, _p_CvTypedSeqT_CvPoint2D32f_tTo_p_CvSeq, 0, 0},  {&_swigt__p_CvSeq, 0, 0, 0},  {&_swigt__p_CvTypedSeqT_CvTupleT_float_3_t_t, _p_CvTypedSeqT_CvTupleT_float_3_t_tTo_p_CvSeq, 0, 0},  {&_swigt__p_CvTypedSeqT_CvConnectedComp_t, _p_CvTypedSeqT_CvConnectedComp_tTo_p_CvSeq, 0, 0},{0, 0, 0, 0}};
8594 static swig_cast_info _swigc__p_CvSeqBlock[] = {  {&_swigt__p_CvSeqBlock, 0, 0, 0},{0, 0, 0, 0}};
8595 static swig_cast_info _swigc__p_CvSeqReader[] = {  {&_swigt__p_CvSeqReader, 0, 0, 0},{0, 0, 0, 0}};
8596 static swig_cast_info _swigc__p_CvSeqWriter[] = {  {&_swigt__p_CvSeqWriter, 0, 0, 0},{0, 0, 0, 0}};
8597 static swig_cast_info _swigc__p_CvSet[] = {  {&_swigt__p_CvSet, 0, 0, 0},{0, 0, 0, 0}};
8598 static swig_cast_info _swigc__p_CvSetElem[] = {  {&_swigt__p_CvSetElem, 0, 0, 0},{0, 0, 0, 0}};
8599 static swig_cast_info _swigc__p_CvSize[] = {  {&_swigt__p_CvSize, 0, 0, 0},{0, 0, 0, 0}};
8600 static swig_cast_info _swigc__p_CvSize2D32f[] = {  {&_swigt__p_CvSize2D32f, 0, 0, 0},{0, 0, 0, 0}};
8601 static swig_cast_info _swigc__p_CvSlice[] = {  {&_swigt__p_CvSlice, 0, 0, 0},{0, 0, 0, 0}};
8602 static swig_cast_info _swigc__p_CvSparseMat[] = {  {&_swigt__p_CvSparseMat, 0, 0, 0},{0, 0, 0, 0}};
8603 static swig_cast_info _swigc__p_CvSparseMatIterator[] = {  {&_swigt__p_CvSparseMatIterator, 0, 0, 0},{0, 0, 0, 0}};
8604 static swig_cast_info _swigc__p_CvSparseNode[] = {  {&_swigt__p_CvSparseNode, 0, 0, 0},{0, 0, 0, 0}};
8605 static swig_cast_info _swigc__p_CvStarDetectorParams[] = {  {&_swigt__p_CvStarDetectorParams, 0, 0, 0},{0, 0, 0, 0}};
8606 static swig_cast_info _swigc__p_CvStarKeypoint[] = {  {&_swigt__p_CvStarKeypoint, 0, 0, 0},{0, 0, 0, 0}};
8607 static swig_cast_info _swigc__p_CvStereoBMState[] = {  {&_swigt__p_CvStereoBMState, 0, 0, 0},{0, 0, 0, 0}};
8608 static swig_cast_info _swigc__p_CvStereoGCState[] = {  {&_swigt__p_CvStereoGCState, 0, 0, 0},{0, 0, 0, 0}};
8609 static swig_cast_info _swigc__p_CvString[] = {  {&_swigt__p_CvString, 0, 0, 0},{0, 0, 0, 0}};
8610 static swig_cast_info _swigc__p_CvStringHashNode[] = {  {&_swigt__p_CvStringHashNode, 0, 0, 0},{0, 0, 0, 0}};
8611 static swig_cast_info _swigc__p_CvSubdiv2D[] = {  {&_swigt__p_CvSubdiv2D, 0, 0, 0},{0, 0, 0, 0}};
8612 static swig_cast_info _swigc__p_CvSubdiv2DEdge_Wrapper[] = {  {&_swigt__p_CvSubdiv2DEdge_Wrapper, 0, 0, 0},{0, 0, 0, 0}};
8613 static swig_cast_info _swigc__p_CvSubdiv2DPoint[] = {  {&_swigt__p_CvSubdiv2DPoint, 0, 0, 0},{0, 0, 0, 0}};
8614 static swig_cast_info _swigc__p_CvSubdiv2DPointLocation[] = {  {&_swigt__p_CvSubdiv2DPointLocation, 0, 0, 0},{0, 0, 0, 0}};
8615 static swig_cast_info _swigc__p_CvTermCriteria[] = {  {&_swigt__p_CvTermCriteria, 0, 0, 0},{0, 0, 0, 0}};
8616 static swig_cast_info _swigc__p_CvTreeNodeIterator[] = {  {&_swigt__p_CvTreeNodeIterator, 0, 0, 0},{0, 0, 0, 0}};
8617 static swig_cast_info _swigc__p_CvTypeInfo[] = {  {&_swigt__p_CvTypeInfo, 0, 0, 0},{0, 0, 0, 0}};
8618 static swig_cast_info _swigc__p_CvVideoWriter[] = {  {&_swigt__p_CvVideoWriter, 0, 0, 0},{0, 0, 0, 0}};
8619 static swig_cast_info _swigc__p_CvvImage[] = {  {&_swigt__p_CvvImage, 0, 0, 0},{0, 0, 0, 0}};
8620 static swig_cast_info _swigc__p__IplConvKernel[] = {  {&_swigt__p__IplConvKernel, 0, 0, 0},{0, 0, 0, 0}};
8621 static swig_cast_info _swigc__p__IplConvKernelFP[] = {  {&_swigt__p__IplConvKernelFP, 0, 0, 0},{0, 0, 0, 0}};
8622 static swig_cast_info _swigc__p__IplImage[] = {  {&_swigt__p__IplImage, 0, 0, 0},{0, 0, 0, 0}};
8623 static swig_cast_info _swigc__p__IplROI[] = {  {&_swigt__p__IplROI, 0, 0, 0},{0, 0, 0, 0}};
8624 static swig_cast_info _swigc__p__IplTileInfo[] = {  {&_swigt__p__IplTileInfo, 0, 0, 0},{0, 0, 0, 0}};
8625 static swig_cast_info _swigc__p_allocator_type[] = {  {&_swigt__p_allocator_type, 0, 0, 0},{0, 0, 0, 0}};
8626 static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
8627 static swig_cast_info _swigc__p_difference_type[] = {  {&_swigt__p_difference_type, 0, 0, 0},{0, 0, 0, 0}};
8628 static swig_cast_info _swigc__p_f_int__void[] = {  {&_swigt__p_f_int__void, 0, 0, 0},{0, 0, 0, 0}};
8629 static swig_cast_info _swigc__p_f_int_int_int_int_p_void__void[] = {  {&_swigt__p_f_int_int_int_int_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
8630 static swig_cast_info _swigc__p_f_int_p_void__void[] = {  {&_swigt__p_f_int_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
8631 static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
8632 static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
8633 static swig_cast_info _swigc__p_int64_t[] = {  {&_swigt__p_int64_t, 0, 0, 0},{0, 0, 0, 0}};
8634 static swig_cast_info _swigc__p_p_char[] = {  {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
8635 static swig_cast_info _swigc__p_signed_char[] = {  {&_swigt__p_signed_char, 0, 0, 0},{0, 0, 0, 0}};
8636 static swig_cast_info _swigc__p_size_t[] = {  {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}};
8637 static swig_cast_info _swigc__p_size_type[] = {  {&_swigt__p_size_type, 0, 0, 0},{0, 0, 0, 0}};
8638 static swig_cast_info _swigc__p_uint64_t[] = {  {&_swigt__p_uint64_t, 0, 0, 0},{0, 0, 0, 0}};
8639 static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
8640 static swig_cast_info _swigc__p_unsigned_short[] = {  {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}};
8641 static swig_cast_info _swigc__p_value_type[] = {  {&_swigt__p_value_type, 0, 0, 0},{0, 0, 0, 0}};
8642 static swig_cast_info _swigc__p_void[] = {  {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
8643
8644 static swig_cast_info *swig_cast_initial[] = {
8645   _swigc__p_Cv32suf,
8646   _swigc__p_Cv64suf,
8647   _swigc__p_CvAttrList,
8648   _swigc__p_CvAvgComp,
8649   _swigc__p_CvBox2D,
8650   _swigc__p_CvCapture,
8651   _swigc__p_CvChain,
8652   _swigc__p_CvChainPtReader,
8653   _swigc__p_CvConDensation,
8654   _swigc__p_CvConnectedComp,
8655   _swigc__p_CvContour,
8656   _swigc__p_CvContourTree,
8657   _swigc__p_CvConvexityDefect,
8658   _swigc__p_CvFileNode,
8659   _swigc__p_CvFileStorage,
8660   _swigc__p_CvFilter,
8661   _swigc__p_CvFont,
8662   _swigc__p_CvGenericHash,
8663   _swigc__p_CvGraph,
8664   _swigc__p_CvGraphEdge,
8665   _swigc__p_CvGraphScanner,
8666   _swigc__p_CvGraphVtx,
8667   _swigc__p_CvGraphVtx2D,
8668   _swigc__p_CvHaarClassifier,
8669   _swigc__p_CvHaarClassifierCascade,
8670   _swigc__p_CvHaarFeature,
8671   _swigc__p_CvHaarStageClassifier,
8672   _swigc__p_CvHidHaarClassifierCascade,
8673   _swigc__p_CvHistogram,
8674   _swigc__p_CvHuMoments,
8675   _swigc__p_CvKalman,
8676   _swigc__p_CvLineIterator,
8677   _swigc__p_CvMSERParams,
8678   _swigc__p_CvMat,
8679   _swigc__p_CvMatND,
8680   _swigc__p_CvMatrix3,
8681   _swigc__p_CvMemBlock,
8682   _swigc__p_CvMemStorage,
8683   _swigc__p_CvMemStoragePos,
8684   _swigc__p_CvModuleInfo,
8685   _swigc__p_CvMoments,
8686   _swigc__p_CvNArrayIterator,
8687   _swigc__p_CvNextEdgeType,
8688   _swigc__p_CvPOSITObject,
8689   _swigc__p_CvPluginFuncInfo,
8690   _swigc__p_CvPoint,
8691   _swigc__p_CvPoint2D32f,
8692   _swigc__p_CvPoint2D64f,
8693   _swigc__p_CvPoint3D32f,
8694   _swigc__p_CvPoint3D64f,
8695   _swigc__p_CvQuadEdge2D,
8696   _swigc__p_CvRNG_Wrapper,
8697   _swigc__p_CvRect,
8698   _swigc__p_CvSURFParams,
8699   _swigc__p_CvSURFPoint,
8700   _swigc__p_CvScalar,
8701   _swigc__p_CvSeq,
8702   _swigc__p_CvSeqBlock,
8703   _swigc__p_CvSeqReader,
8704   _swigc__p_CvSeqWriter,
8705   _swigc__p_CvSet,
8706   _swigc__p_CvSetElem,
8707   _swigc__p_CvSize,
8708   _swigc__p_CvSize2D32f,
8709   _swigc__p_CvSlice,
8710   _swigc__p_CvSparseMat,
8711   _swigc__p_CvSparseMatIterator,
8712   _swigc__p_CvSparseNode,
8713   _swigc__p_CvStarDetectorParams,
8714   _swigc__p_CvStarKeypoint,
8715   _swigc__p_CvStereoBMState,
8716   _swigc__p_CvStereoGCState,
8717   _swigc__p_CvString,
8718   _swigc__p_CvStringHashNode,
8719   _swigc__p_CvSubdiv2D,
8720   _swigc__p_CvSubdiv2DEdge_Wrapper,
8721   _swigc__p_CvSubdiv2DPoint,
8722   _swigc__p_CvSubdiv2DPointLocation,
8723   _swigc__p_CvTermCriteria,
8724   _swigc__p_CvTreeNodeIterator,
8725   _swigc__p_CvTypeInfo,
8726   _swigc__p_CvTypedSeqT_CvConnectedComp_t,
8727   _swigc__p_CvTypedSeqT_CvPoint2D32f_t,
8728   _swigc__p_CvTypedSeqT_CvPoint_t,
8729   _swigc__p_CvTypedSeqT_CvQuadEdge2D_t,
8730   _swigc__p_CvTypedSeqT_CvRect_t,
8731   _swigc__p_CvTypedSeqT_CvSeq_p_t,
8732   _swigc__p_CvTypedSeqT_CvTupleT_CvPoint_2_t_t,
8733   _swigc__p_CvTypedSeqT_CvTupleT_float_2_t_t,
8734   _swigc__p_CvTypedSeqT_CvTupleT_float_3_t_t,
8735   _swigc__p_CvVideoWriter,
8736   _swigc__p_CvvImage,
8737   _swigc__p__IplConvKernel,
8738   _swigc__p__IplConvKernelFP,
8739   _swigc__p__IplImage,
8740   _swigc__p__IplROI,
8741   _swigc__p__IplTileInfo,
8742   _swigc__p_allocator_type,
8743   _swigc__p_char,
8744   _swigc__p_difference_type,
8745   _swigc__p_f_int__void,
8746   _swigc__p_f_int_int_int_int_p_void__void,
8747   _swigc__p_f_int_p_void__void,
8748   _swigc__p_float,
8749   _swigc__p_int,
8750   _swigc__p_int64_t,
8751   _swigc__p_p_char,
8752   _swigc__p_signed_char,
8753   _swigc__p_size_t,
8754   _swigc__p_size_type,
8755   _swigc__p_uint64_t,
8756   _swigc__p_unsigned_char,
8757   _swigc__p_unsigned_short,
8758   _swigc__p_value_type,
8759   _swigc__p_void,
8760 };
8761
8762
8763 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
8764
8765 static swig_const_info swig_const_table[] = {
8766 {0, 0, 0, 0.0, 0, 0}};
8767
8768 #ifdef __cplusplus
8769 }
8770 #endif
8771 /* -----------------------------------------------------------------------------
8772  * Type initialization:
8773  * This problem is tough by the requirement that no dynamic 
8774  * memory is used. Also, since swig_type_info structures store pointers to 
8775  * swig_cast_info structures and swig_cast_info structures store pointers back
8776  * to swig_type_info structures, we need some lookup code at initialization. 
8777  * The idea is that swig generates all the structures that are needed. 
8778  * The runtime then collects these partially filled structures. 
8779  * The SWIG_InitializeModule function takes these initial arrays out of 
8780  * swig_module, and does all the lookup, filling in the swig_module.types
8781  * array with the correct data and linking the correct swig_cast_info
8782  * structures together.
8783  *
8784  * The generated swig_type_info structures are assigned staticly to an initial 
8785  * array. We just loop through that array, and handle each type individually.
8786  * First we lookup if this type has been already loaded, and if so, use the
8787  * loaded structure instead of the generated one. Then we have to fill in the
8788  * cast linked list. The cast data is initially stored in something like a
8789  * two-dimensional array. Each row corresponds to a type (there are the same
8790  * number of rows as there are in the swig_type_initial array). Each entry in
8791  * a column is one of the swig_cast_info structures for that type.
8792  * The cast_initial array is actually an array of arrays, because each row has
8793  * a variable number of columns. So to actually build the cast linked list,
8794  * we find the array of casts associated with the type, and loop through it 
8795  * adding the casts to the list. The one last trick we need to do is making
8796  * sure the type pointer in the swig_cast_info struct is correct.
8797  *
8798  * First off, we lookup the cast->type name to see if it is already loaded. 
8799  * There are three cases to handle:
8800  *  1) If the cast->type has already been loaded AND the type we are adding
8801  *     casting info to has not been loaded (it is in this module), THEN we
8802  *     replace the cast->type pointer with the type pointer that has already
8803  *     been loaded.
8804  *  2) If BOTH types (the one we are adding casting info to, and the 
8805  *     cast->type) are loaded, THEN the cast info has already been loaded by
8806  *     the previous module so we just ignore it.
8807  *  3) Finally, if cast->type has not already been loaded, then we add that
8808  *     swig_cast_info to the linked list (because the cast->type) pointer will
8809  *     be correct.
8810  * ----------------------------------------------------------------------------- */
8811
8812 #ifdef __cplusplus
8813 extern "C" {
8814 #if 0
8815 } /* c-mode */
8816 #endif
8817 #endif
8818
8819 #if 0
8820 #define SWIGRUNTIME_DEBUG
8821 #endif
8822
8823
8824 SWIGRUNTIME void
8825 SWIG_InitializeModule(void *clientdata) {
8826   size_t i;
8827   swig_module_info *module_head, *iter;
8828   int found, init;
8829   
8830   clientdata = clientdata;
8831   
8832   /* check to see if the circular list has been setup, if not, set it up */
8833   if (swig_module.next==0) {
8834     /* Initialize the swig_module */
8835     swig_module.type_initial = swig_type_initial;
8836     swig_module.cast_initial = swig_cast_initial;
8837     swig_module.next = &swig_module;
8838     init = 1;
8839   } else {
8840     init = 0;
8841   }
8842   
8843   /* Try and load any already created modules */
8844   module_head = SWIG_GetModule(clientdata);
8845   if (!module_head) {
8846     /* This is the first module loaded for this interpreter */
8847     /* so set the swig module into the interpreter */
8848     SWIG_SetModule(clientdata, &swig_module);
8849     module_head = &swig_module;
8850   } else {
8851     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
8852     found=0;
8853     iter=module_head;
8854     do {
8855       if (iter==&swig_module) {
8856         found=1;
8857         break;
8858       }
8859       iter=iter->next;
8860     } while (iter!= module_head);
8861     
8862     /* if the is found in the list, then all is done and we may leave */
8863     if (found) return;
8864     /* otherwise we must add out module into the list */
8865     swig_module.next = module_head->next;
8866     module_head->next = &swig_module;
8867   }
8868   
8869   /* When multiple interpeters are used, a module could have already been initialized in
8870        a different interpreter, but not yet have a pointer in this interpreter.
8871        In this case, we do not want to continue adding types... everything should be
8872        set up already */
8873   if (init == 0) return;
8874   
8875   /* Now work on filling in swig_module.types */
8876 #ifdef SWIGRUNTIME_DEBUG
8877   printf("SWIG_InitializeModule: size %d\n", swig_module.size);
8878 #endif
8879   for (i = 0; i < swig_module.size; ++i) {
8880     swig_type_info *type = 0;
8881     swig_type_info *ret;
8882     swig_cast_info *cast;
8883     
8884 #ifdef SWIGRUNTIME_DEBUG
8885     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
8886 #endif
8887     
8888     /* if there is another module already loaded */
8889     if (swig_module.next != &swig_module) {
8890       type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
8891     }
8892     if (type) {
8893       /* Overwrite clientdata field */
8894 #ifdef SWIGRUNTIME_DEBUG
8895       printf("SWIG_InitializeModule: found type %s\n", type->name);
8896 #endif
8897       if (swig_module.type_initial[i]->clientdata) {
8898         type->clientdata = swig_module.type_initial[i]->clientdata;
8899 #ifdef SWIGRUNTIME_DEBUG
8900         printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
8901 #endif
8902       }
8903     } else {
8904       type = swig_module.type_initial[i];
8905     }
8906     
8907     /* Insert casting types */
8908     cast = swig_module.cast_initial[i];
8909     while (cast->type) {
8910       /* Don't need to add information already in the list */
8911       ret = 0;
8912 #ifdef SWIGRUNTIME_DEBUG
8913       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
8914 #endif
8915       if (swig_module.next != &swig_module) {
8916         ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
8917 #ifdef SWIGRUNTIME_DEBUG
8918         if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
8919 #endif
8920       }
8921       if (ret) {
8922         if (type == swig_module.type_initial[i]) {
8923 #ifdef SWIGRUNTIME_DEBUG
8924           printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
8925 #endif
8926           cast->type = ret;
8927           ret = 0;
8928         } else {
8929           /* Check for casting already in the list */
8930           swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
8931 #ifdef SWIGRUNTIME_DEBUG
8932           if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
8933 #endif
8934           if (!ocast) ret = 0;
8935         }
8936       }
8937       
8938       if (!ret) {
8939 #ifdef SWIGRUNTIME_DEBUG
8940         printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
8941 #endif
8942         if (type->cast) {
8943           type->cast->prev = cast;
8944           cast->next = type->cast;
8945         }
8946         type->cast = cast;
8947       }
8948       cast++;
8949     }
8950     /* Set entry in modules->types array equal to the type */
8951     swig_module.types[i] = type;
8952   }
8953   swig_module.types[i] = 0;
8954   
8955 #ifdef SWIGRUNTIME_DEBUG
8956   printf("**** SWIG_InitializeModule: Cast List ******\n");
8957   for (i = 0; i < swig_module.size; ++i) {
8958     int j = 0;
8959     swig_cast_info *cast = swig_module.cast_initial[i];
8960     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
8961     while (cast->type) {
8962       printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
8963       cast++;
8964       ++j;
8965     }
8966     printf("---- Total casts: %d\n",j);
8967   }
8968   printf("**** SWIG_InitializeModule: Cast List ******\n");
8969 #endif
8970 }
8971
8972 /* This function will propagate the clientdata field of type to
8973 * any new swig_type_info structures that have been added into the list
8974 * of equivalent types.  It is like calling
8975 * SWIG_TypeClientData(type, clientdata) a second time.
8976 */
8977 SWIGRUNTIME void
8978 SWIG_PropagateClientData(void) {
8979   size_t i;
8980   swig_cast_info *equiv;
8981   static int init_run = 0;
8982   
8983   if (init_run) return;
8984   init_run = 1;
8985   
8986   for (i = 0; i < swig_module.size; i++) {
8987     if (swig_module.types[i]->clientdata) {
8988       equiv = swig_module.types[i]->cast;
8989       while (equiv) {
8990         if (!equiv->converter) {
8991           if (equiv->type && !equiv->type->clientdata)
8992           SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
8993         }
8994         equiv = equiv->next;
8995       }
8996     }
8997   }
8998 }
8999
9000 #ifdef __cplusplus
9001 #if 0
9002 {
9003   /* c-mode */
9004 #endif
9005 }
9006 #endif
9007
9008
9009
9010 #ifdef __cplusplus
9011 extern "C" {
9012 #endif
9013   
9014   /* Python-specific SWIG API */
9015 #define SWIG_newvarlink()                             SWIG_Python_newvarlink()
9016 #define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
9017 #define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
9018   
9019   /* -----------------------------------------------------------------------------
9020    * global variable support code.
9021    * ----------------------------------------------------------------------------- */
9022   
9023   typedef struct swig_globalvar {
9024     char       *name;                  /* Name of global variable */
9025     PyObject *(*get_attr)(void);       /* Return the current value */
9026     int       (*set_attr)(PyObject *); /* Set the value */
9027     struct swig_globalvar *next;
9028   } swig_globalvar;
9029   
9030   typedef struct swig_varlinkobject {
9031     PyObject_HEAD
9032     swig_globalvar *vars;
9033   } swig_varlinkobject;
9034   
9035   SWIGINTERN PyObject *
9036   swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
9037 #if PY_VERSION_HEX >= 0x03000000
9038     return PyUnicode_InternFromString("<Swig global variables>");
9039 #else
9040     return PyString_FromString("<Swig global variables>");
9041 #endif
9042   }
9043   
9044   SWIGINTERN PyObject *
9045   swig_varlink_str(swig_varlinkobject *v) {
9046 #if PY_VERSION_HEX >= 0x03000000
9047     PyObject *str = PyUnicode_InternFromString("(");
9048     PyObject *tail;
9049     PyObject *joined;
9050     swig_globalvar *var;
9051     for (var = v->vars; var; var=var->next) {
9052       tail = PyUnicode_FromString(var->name);
9053       joined = PyUnicode_Concat(str, tail);
9054       Py_DecRef(str);
9055       Py_DecRef(tail);
9056       str = joined;
9057       if (var->next) {
9058         tail = PyUnicode_InternFromString(", ");
9059         joined = PyUnicode_Concat(str, tail);
9060         Py_DecRef(str);
9061         Py_DecRef(tail);
9062         str = joined;
9063       }
9064     }
9065     tail = PyUnicode_InternFromString(")");
9066     joined = PyUnicode_Concat(str, tail);
9067     Py_DecRef(str);
9068     Py_DecRef(tail);
9069     str = joined;
9070 #else
9071     PyObject *str = PyString_FromString("(");
9072     swig_globalvar *var;
9073     for (var = v->vars; var; var=var->next) {
9074       PyString_ConcatAndDel(&str,PyString_FromString(var->name));
9075       if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
9076     }
9077     PyString_ConcatAndDel(&str,PyString_FromString(")"));
9078 #endif
9079     return str;
9080   }
9081   
9082   SWIGINTERN int
9083   swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
9084     char *tmp;
9085     PyObject *str = swig_varlink_str(v);
9086     fprintf(fp,"Swig global variables ");
9087     fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
9088     SWIG_Python_str_DelForPy3(tmp);
9089     Py_DECREF(str);
9090     return 0;
9091   }
9092   
9093   SWIGINTERN void
9094   swig_varlink_dealloc(swig_varlinkobject *v) {
9095     swig_globalvar *var = v->vars;
9096     while (var) {
9097       swig_globalvar *n = var->next;
9098       free(var->name);
9099       free(var);
9100       var = n;
9101     }
9102   }
9103   
9104   SWIGINTERN PyObject *
9105   swig_varlink_getattr(swig_varlinkobject *v, char *n) {
9106     PyObject *res = NULL;
9107     swig_globalvar *var = v->vars;
9108     while (var) {
9109       if (strcmp(var->name,n) == 0) {
9110         res = (*var->get_attr)();
9111         break;
9112       }
9113       var = var->next;
9114     }
9115     if (res == NULL && !PyErr_Occurred()) {
9116       PyErr_SetString(PyExc_NameError,"Unknown C global variable");
9117     }
9118     return res;
9119   }
9120   
9121   SWIGINTERN int
9122   swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
9123     int res = 1;
9124     swig_globalvar *var = v->vars;
9125     while (var) {
9126       if (strcmp(var->name,n) == 0) {
9127         res = (*var->set_attr)(p);
9128         break;
9129       }
9130       var = var->next;
9131     }
9132     if (res == 1 && !PyErr_Occurred()) {
9133       PyErr_SetString(PyExc_NameError,"Unknown C global variable");
9134     }
9135     return res;
9136   }
9137   
9138   SWIGINTERN PyTypeObject*
9139   swig_varlink_type(void) {
9140     static char varlink__doc__[] = "Swig var link object";
9141     static PyTypeObject varlink_type;
9142     static int type_init = 0;  
9143     if (!type_init) {
9144       const PyTypeObject tmp
9145       = {
9146         /* PyObject header changed in Python 3 */
9147 #if PY_VERSION_HEX >= 0x03000000
9148         PyVarObject_HEAD_INIT(&PyType_Type, 0)
9149 #else
9150         PyObject_HEAD_INIT(NULL)
9151         0,                                  /* Number of items in variable part (ob_size) */
9152 #endif
9153         (char *)"swigvarlink",              /* Type name (tp_name) */
9154         sizeof(swig_varlinkobject),         /* Basic size (tp_basicsize) */
9155         0,                                  /* Itemsize (tp_itemsize) */
9156         (destructor) swig_varlink_dealloc,  /* Deallocator (tp_dealloc) */ 
9157         (printfunc) swig_varlink_print,     /* Print (tp_print) */
9158         (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
9159         (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
9160         0,                                  /* tp_compare */
9161         (reprfunc) swig_varlink_repr,       /* tp_repr */
9162         0,                                  /* tp_as_number */
9163         0,                                  /* tp_as_sequence */
9164         0,                                  /* tp_as_mapping */
9165         0,                                  /* tp_hash */
9166         0,                                  /* tp_call */
9167         (reprfunc) swig_varlink_str,        /* tp_str */
9168         0,                                  /* tp_getattro */
9169         0,                                  /* tp_setattro */
9170         0,                                  /* tp_as_buffer */
9171         0,                                  /* tp_flags */
9172         varlink__doc__,                     /* tp_doc */
9173         0,                                  /* tp_traverse */
9174         0,                                  /* tp_clear */
9175         0,                                  /* tp_richcompare */
9176         0,                                  /* tp_weaklistoffset */
9177 #if PY_VERSION_HEX >= 0x02020000
9178         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
9179 #endif
9180 #if PY_VERSION_HEX >= 0x02030000
9181         0,                                  /* tp_del */
9182 #endif
9183 #ifdef COUNT_ALLOCS
9184         0,0,0,0                             /* tp_alloc -> tp_next */
9185 #endif
9186       };
9187       varlink_type = tmp;
9188       /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
9189 #if PY_VERSION_HEX < 0x03000000
9190       varlink_type.ob_type = &PyType_Type;
9191 #endif
9192       type_init = 1;
9193     }
9194     return &varlink_type;
9195   }
9196   
9197   /* Create a variable linking object for use later */
9198   SWIGINTERN PyObject *
9199   SWIG_Python_newvarlink(void) {
9200     swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
9201     if (result) {
9202       result->vars = 0;
9203     }
9204     return ((PyObject*) result);
9205   }
9206   
9207   SWIGINTERN void 
9208   SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
9209     swig_varlinkobject *v = (swig_varlinkobject *) p;
9210     swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
9211     if (gv) {
9212       size_t size = strlen(name)+1;
9213       gv->name = (char *)malloc(size);
9214       if (gv->name) {
9215         strncpy(gv->name,name,size);
9216         gv->get_attr = get_attr;
9217         gv->set_attr = set_attr;
9218         gv->next = v->vars;
9219       }
9220     }
9221     v->vars = gv;
9222   }
9223   
9224   SWIGINTERN PyObject *
9225   SWIG_globals(void) {
9226     static PyObject *_SWIG_globals = 0; 
9227     if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();  
9228     return _SWIG_globals;
9229   }
9230   
9231   /* -----------------------------------------------------------------------------
9232    * constants/methods manipulation
9233    * ----------------------------------------------------------------------------- */
9234   
9235   /* Install Constants */
9236   SWIGINTERN void
9237   SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
9238     PyObject *obj = 0;
9239     size_t i;
9240     for (i = 0; constants[i].type; ++i) {
9241       switch(constants[i].type) {
9242       case SWIG_PY_POINTER:
9243         obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
9244         break;
9245       case SWIG_PY_BINARY:
9246         obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
9247         break;
9248       default:
9249         obj = 0;
9250         break;
9251       }
9252       if (obj) {
9253         PyDict_SetItemString(d, constants[i].name, obj);
9254         Py_DECREF(obj);
9255       }
9256     }
9257   }
9258   
9259   /* -----------------------------------------------------------------------------*/
9260   /* Fix SwigMethods to carry the callback ptrs when needed */
9261   /* -----------------------------------------------------------------------------*/
9262   
9263   SWIGINTERN void
9264   SWIG_Python_FixMethods(PyMethodDef *methods,
9265     swig_const_info *const_table,
9266     swig_type_info **types,
9267     swig_type_info **types_initial) {
9268     size_t i;
9269     for (i = 0; methods[i].ml_name; ++i) {
9270       const char *c = methods[i].ml_doc;
9271       if (c && (c = strstr(c, "swig_ptr: "))) {
9272         int j;
9273         swig_const_info *ci = 0;
9274         const char *name = c + 10;
9275         for (j = 0; const_table[j].type; ++j) {
9276           if (strncmp(const_table[j].name, name, 
9277               strlen(const_table[j].name)) == 0) {
9278             ci = &(const_table[j]);
9279             break;
9280           }
9281         }
9282         if (ci) {
9283           size_t shift = (ci->ptype) - types;
9284           swig_type_info *ty = types_initial[shift];
9285           size_t ldoc = (c - methods[i].ml_doc);
9286           size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
9287           char *ndoc = (char*)malloc(ldoc + lptr + 10);
9288           if (ndoc) {
9289             char *buff = ndoc;
9290             void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
9291             if (ptr) {
9292               strncpy(buff, methods[i].ml_doc, ldoc);
9293               buff += ldoc;
9294               strncpy(buff, "swig_ptr: ", 10);
9295               buff += 10;
9296               SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
9297               methods[i].ml_doc = ndoc;
9298             }
9299           }
9300         }
9301       }
9302     }
9303   } 
9304   
9305 #ifdef __cplusplus
9306 }
9307 #endif
9308
9309 /* -----------------------------------------------------------------------------*
9310  *  Partial Init method
9311  * -----------------------------------------------------------------------------*/
9312
9313 #ifdef __cplusplus
9314 extern "C"
9315 #endif
9316
9317 SWIGEXPORT 
9318 #if PY_VERSION_HEX >= 0x03000000
9319 PyObject*
9320 #else
9321 void
9322 #endif
9323 SWIG_init(void) {
9324   PyObject *m, *d;  
9325 #if PY_VERSION_HEX >= 0x03000000
9326   static struct PyModuleDef SWIG_module = {
9327     PyModuleDef_HEAD_INIT,
9328     (char *) SWIG_name,
9329     NULL,
9330     -1,
9331     SwigMethods,
9332     NULL,
9333     NULL,
9334     NULL,
9335     NULL
9336   };
9337 #endif
9338   
9339   /* Fix SwigMethods to carry the callback ptrs when needed */
9340   SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
9341   
9342 #if PY_VERSION_HEX >= 0x03000000
9343   m = PyModule_Create(&SWIG_module);
9344 #else
9345   m = Py_InitModule((char *) SWIG_name, SwigMethods);
9346 #endif
9347   d = PyModule_GetDict(m);
9348   
9349   SWIG_InitializeModule(0);
9350   SWIG_InstallConstants(d,swig_const_table);
9351   
9352   
9353   
9354   PyEval_InitThreads();
9355   
9356   SWIG_Python_SetConstant(d, "CV_WINDOW_AUTOSIZE",SWIG_From_int(static_cast< int >(1)));
9357   SWIG_Python_SetConstant(d, "CV_EVENT_MOUSEMOVE",SWIG_From_int(static_cast< int >(0)));
9358   SWIG_Python_SetConstant(d, "CV_EVENT_LBUTTONDOWN",SWIG_From_int(static_cast< int >(1)));
9359   SWIG_Python_SetConstant(d, "CV_EVENT_RBUTTONDOWN",SWIG_From_int(static_cast< int >(2)));
9360   SWIG_Python_SetConstant(d, "CV_EVENT_MBUTTONDOWN",SWIG_From_int(static_cast< int >(3)));
9361   SWIG_Python_SetConstant(d, "CV_EVENT_LBUTTONUP",SWIG_From_int(static_cast< int >(4)));
9362   SWIG_Python_SetConstant(d, "CV_EVENT_RBUTTONUP",SWIG_From_int(static_cast< int >(5)));
9363   SWIG_Python_SetConstant(d, "CV_EVENT_MBUTTONUP",SWIG_From_int(static_cast< int >(6)));
9364   SWIG_Python_SetConstant(d, "CV_EVENT_LBUTTONDBLCLK",SWIG_From_int(static_cast< int >(7)));
9365   SWIG_Python_SetConstant(d, "CV_EVENT_RBUTTONDBLCLK",SWIG_From_int(static_cast< int >(8)));
9366   SWIG_Python_SetConstant(d, "CV_EVENT_MBUTTONDBLCLK",SWIG_From_int(static_cast< int >(9)));
9367   SWIG_Python_SetConstant(d, "CV_EVENT_FLAG_LBUTTON",SWIG_From_int(static_cast< int >(1)));
9368   SWIG_Python_SetConstant(d, "CV_EVENT_FLAG_RBUTTON",SWIG_From_int(static_cast< int >(2)));
9369   SWIG_Python_SetConstant(d, "CV_EVENT_FLAG_MBUTTON",SWIG_From_int(static_cast< int >(4)));
9370   SWIG_Python_SetConstant(d, "CV_EVENT_FLAG_CTRLKEY",SWIG_From_int(static_cast< int >(8)));
9371   SWIG_Python_SetConstant(d, "CV_EVENT_FLAG_SHIFTKEY",SWIG_From_int(static_cast< int >(16)));
9372   SWIG_Python_SetConstant(d, "CV_EVENT_FLAG_ALTKEY",SWIG_From_int(static_cast< int >(32)));
9373   SWIG_Python_SetConstant(d, "CV_LOAD_IMAGE_UNCHANGED",SWIG_From_int(static_cast< int >(-1)));
9374   SWIG_Python_SetConstant(d, "CV_LOAD_IMAGE_GRAYSCALE",SWIG_From_int(static_cast< int >(0)));
9375   SWIG_Python_SetConstant(d, "CV_LOAD_IMAGE_COLOR",SWIG_From_int(static_cast< int >(1)));
9376   SWIG_Python_SetConstant(d, "CV_LOAD_IMAGE_ANYDEPTH",SWIG_From_int(static_cast< int >(2)));
9377   SWIG_Python_SetConstant(d, "CV_LOAD_IMAGE_ANYCOLOR",SWIG_From_int(static_cast< int >(4)));
9378   SWIG_Python_SetConstant(d, "CV_IMWRITE_JPEG_QUALITY",SWIG_From_int(static_cast< int >(1)));
9379   SWIG_Python_SetConstant(d, "CV_IMWRITE_PNG_COMPRESSION",SWIG_From_int(static_cast< int >(16)));
9380   SWIG_Python_SetConstant(d, "CV_IMWRITE_PXM_BINARY",SWIG_From_int(static_cast< int >(32)));
9381   SWIG_Python_SetConstant(d, "CV_CVTIMG_FLIP",SWIG_From_int(static_cast< int >(1)));
9382   SWIG_Python_SetConstant(d, "CV_CVTIMG_SWAP_RB",SWIG_From_int(static_cast< int >(2)));
9383   SWIG_Python_SetConstant(d, "CV_CAP_ANY",SWIG_From_int(static_cast< int >(0)));
9384   SWIG_Python_SetConstant(d, "CV_CAP_MIL",SWIG_From_int(static_cast< int >(100)));
9385   SWIG_Python_SetConstant(d, "CV_CAP_VFW",SWIG_From_int(static_cast< int >(200)));
9386   SWIG_Python_SetConstant(d, "CV_CAP_V4L",SWIG_From_int(static_cast< int >(200)));
9387   SWIG_Python_SetConstant(d, "CV_CAP_V4L2",SWIG_From_int(static_cast< int >(200)));
9388   SWIG_Python_SetConstant(d, "CV_CAP_FIREWARE",SWIG_From_int(static_cast< int >(300)));
9389   SWIG_Python_SetConstant(d, "CV_CAP_FIREWIRE",SWIG_From_int(static_cast< int >(300)));
9390   SWIG_Python_SetConstant(d, "CV_CAP_IEEE1394",SWIG_From_int(static_cast< int >(300)));
9391   SWIG_Python_SetConstant(d, "CV_CAP_DC1394",SWIG_From_int(static_cast< int >(300)));
9392   SWIG_Python_SetConstant(d, "CV_CAP_CMU1394",SWIG_From_int(static_cast< int >(300)));
9393   SWIG_Python_SetConstant(d, "CV_CAP_STEREO",SWIG_From_int(static_cast< int >(400)));
9394   SWIG_Python_SetConstant(d, "CV_CAP_TYZX",SWIG_From_int(static_cast< int >(400)));
9395   SWIG_Python_SetConstant(d, "CV_TYZX_LEFT",SWIG_From_int(static_cast< int >(400)));
9396   SWIG_Python_SetConstant(d, "CV_TYZX_RIGHT",SWIG_From_int(static_cast< int >(401)));
9397   SWIG_Python_SetConstant(d, "CV_TYZX_COLOR",SWIG_From_int(static_cast< int >(402)));
9398   SWIG_Python_SetConstant(d, "CV_TYZX_Z",SWIG_From_int(static_cast< int >(403)));
9399   SWIG_Python_SetConstant(d, "CV_CAP_QT",SWIG_From_int(static_cast< int >(500)));
9400   SWIG_Python_SetConstant(d, "CV_CAP_UNICAP",SWIG_From_int(static_cast< int >(600)));
9401   SWIG_Python_SetConstant(d, "CV_CAP_DSHOW",SWIG_From_int(static_cast< int >(700)));
9402   SWIG_Python_SetConstant(d, "CV_CAP_PROP_POS_MSEC",SWIG_From_int(static_cast< int >(0)));
9403   SWIG_Python_SetConstant(d, "CV_CAP_PROP_POS_FRAMES",SWIG_From_int(static_cast< int >(1)));
9404   SWIG_Python_SetConstant(d, "CV_CAP_PROP_POS_AVI_RATIO",SWIG_From_int(static_cast< int >(2)));
9405   SWIG_Python_SetConstant(d, "CV_CAP_PROP_FRAME_WIDTH",SWIG_From_int(static_cast< int >(3)));
9406   SWIG_Python_SetConstant(d, "CV_CAP_PROP_FRAME_HEIGHT",SWIG_From_int(static_cast< int >(4)));
9407   SWIG_Python_SetConstant(d, "CV_CAP_PROP_FPS",SWIG_From_int(static_cast< int >(5)));
9408   SWIG_Python_SetConstant(d, "CV_CAP_PROP_FOURCC",SWIG_From_int(static_cast< int >(6)));
9409   SWIG_Python_SetConstant(d, "CV_CAP_PROP_FRAME_COUNT",SWIG_From_int(static_cast< int >(7)));
9410   SWIG_Python_SetConstant(d, "CV_CAP_PROP_FORMAT",SWIG_From_int(static_cast< int >(8)));
9411   SWIG_Python_SetConstant(d, "CV_CAP_PROP_MODE",SWIG_From_int(static_cast< int >(9)));
9412   SWIG_Python_SetConstant(d, "CV_CAP_PROP_BRIGHTNESS",SWIG_From_int(static_cast< int >(10)));
9413   SWIG_Python_SetConstant(d, "CV_CAP_PROP_CONTRAST",SWIG_From_int(static_cast< int >(11)));
9414   SWIG_Python_SetConstant(d, "CV_CAP_PROP_SATURATION",SWIG_From_int(static_cast< int >(12)));
9415   SWIG_Python_SetConstant(d, "CV_CAP_PROP_HUE",SWIG_From_int(static_cast< int >(13)));
9416   SWIG_Python_SetConstant(d, "CV_CAP_PROP_GAIN",SWIG_From_int(static_cast< int >(14)));
9417   SWIG_Python_SetConstant(d, "CV_CAP_PROP_EXPOSURE",SWIG_From_int(static_cast< int >(15)));
9418   SWIG_Python_SetConstant(d, "CV_CAP_PROP_CONVERT_RGB",SWIG_From_int(static_cast< int >(16)));
9419   SWIG_Python_SetConstant(d, "CV_CAP_PROP_WHITE_BALANCE",SWIG_From_int(static_cast< int >(17)));
9420   SWIG_Python_SetConstant(d, "CV_CAP_PROP_RECTIFICATION",SWIG_From_int(static_cast< int >(18)));
9421   SWIG_Python_SetConstant(d, "CV_FOURCC_PROMPT",SWIG_From_int(static_cast< int >(-1)));
9422   SWIG_Python_SetConstant(d, "HG_AUTOSIZE",SWIG_From_int(static_cast< int >(1)));
9423 #if PY_VERSION_HEX >= 0x03000000
9424   return m;
9425 #else
9426   return;
9427 #endif
9428 }
9429