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