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