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