[Gridflow-cvs] [svn] commit: r3346 - /trunk/optional/opencv.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Fri Mar 28 18:34:48 EDT 2008


Author: matju
Date: Fri Mar 28 18:34:48 2008
New Revision: 3346

Log:
merge \classinfo into \end; merge struct into \class

Modified:
    trunk/optional/opencv.c

Modified: trunk/optional/opencv.c
==============================================================================
--- trunk/optional/opencv.c (original)
+++ trunk/optional/opencv.c Fri Mar 28 18:34:48 2008
@@ -2,7 +2,7 @@
 	$Id$
 
 	GridFlow
-	Copyright (c) 2001-2007 by Mathieu Bouchard
+	Copyright (c) 2001-2008 by Mathieu Bouchard
 
 	This program is free software; you can redistribute it and/or
 	modify it under the terms of the GNU General Public License
@@ -121,21 +121,18 @@
 	return a;
 }
 
-\class CvOp1 < GridObject
-struct CvOp1 : GridObject {
+\class CvOp1 : GridObject {
 	\attr CvMode mode;
 	\decl void initialize ();
 	/* has no default \grin 0 handler so far. */
 };
 \def void initialize () {
-	rb_call_super(0,0);
+	SUPER;
 	mode = cv_mode_auto;
 }
-\classinfo {}
-\end class CvOp1
-
-\class CvOp2 < CvOp1
-struct CvOp2 : CvOp1 {
+\end class CvOp1 {}
+
+\class CvOp2 : CvOp1 {
 	PtrGrid r;
 	\decl void initialize (Grid *r=0);
 	virtual void func(CvArr *l, CvArr *r, CvArr *o) {/* rien */}
@@ -143,7 +140,7 @@
 	\grin 1
 };
 \def void initialize (Grid *r=0) {
-	rb_call_super(0,0);
+	SUPER;
 	this->r = r?r:new Grid(new Dim(),int32_e,true);
 }
 GRID_INLET(CvOp2,0) {
@@ -163,44 +160,32 @@
 	out->send(o->dim->prod(),(T *)o->data);
 } GRID_END
 GRID_INPUT2(CvOp2,1,r) {} GRID_END
-\classinfo {}
-\end class CvOp2
+\end class CvOp2 {}
 
 #define FUNC virtual void func(CvArr *l, CvArr *r, CvArr *o)
 
-\class CvAdd < CvOp2
-struct CvAdd : CvOp2 {FUNC {cvAdd(l,r,o,0);}};
-\classinfo { install("cv.Add",2,1); }
-\end class CvAdd
-\class CvSub < CvOp2
-struct CvSub : CvOp2 {FUNC {cvSub(l,r,o,0);}};
-\classinfo { install("cv.Sub",2,1); }
-\end class CvSub
-\class CvMul < CvOp2
-struct CvMul : CvOp2 {FUNC {cvMul(l,r,o,1);}};
-\classinfo { install("cv.Mul",2,1); }
-\end class CvMul
-\class CvDiv < CvOp2
-struct CvDiv : CvOp2 {FUNC {cvDiv(l,r,o,1);}};
-\classinfo { install("cv.Div",2,1); }
-\end class CvDiv
-
-\class CvSplit < CvOp1
-struct CvSplit : CvOp1 {
+\class CvAdd : CvOp2 {FUNC {cvAdd(l,r,o,0);}};
+\end class CvAdd {install("cv.Add",2,1);}
+\class CvSub : CvOp2 {FUNC {cvSub(l,r,o,0);}};
+\end class CvSub {install("cv.Sub",2,1);}
+\class CvMul : CvOp2 {FUNC {cvMul(l,r,o,1);}};
+\end class CvMul {install("cv.Mul",2,1);}
+\class CvDiv : CvOp2 {FUNC {cvDiv(l,r,o,1);}};
+\end class CvDiv {install("cv.Div",2,1);}
+
+\class CvSplit : CvOp1 {
 	int channels;
 	\decl void initialize (int channels);
 };
 \def void initialize (int channels) {
-	rb_call_super(0,0);
+	SUPER;
 	if (channels<0 || channels>64) RAISE("channels=%d is not in 1..64",channels);
 	this->channels = channels;
 	bself->noutlets_set(channels);
 }
-\classinfo {}
-\end class CvSplit
-
-\class CvHaarDetectObjects < GridObject
-struct CvHaarDetectObjects : GridObject {
+\end class CvSplit {}
+
+\class CvHaarDetectObjects : GridObject {
 	\attr double scale_factor; /*=1.1*/
 	\attr int min_neighbors;   /*=3*/
 	\attr int flags;           /*=0*/
@@ -238,11 +223,9 @@
 		out->send(4,duh);
 	}
 } GRID_END
-\classinfo { install("cv.HaarDetectObjects",2,1); }
-\end class CvHaarDetectObjects
-
-\class CvKalmanWrapper < CvOp1
-struct CvKalmanWrapper : CvOp1 {
+\end class CvHaarDetectObjects {install("cv.HaarDetectObjects",2,1);}
+
+\class CvKalmanWrapper : CvOp1 {
 	CvKalman *kal;
 	\decl void initialize (int dynam_params, int measure_params, int control_params=0);
 	 CvKalmanWrapper () : kal(0) {}
@@ -296,8 +279,7 @@
 	const CvMat* r = cvKalmanCorrect(kal,a);
 	cvMatSend(r,this,0);
 } GRID_END
-\classinfo { install("cv.Kalman",2,1); }
-\end class CvKalmanWrapper
+\end class CvKalmanWrapper {install("cv.Kalman",2,1);}
 
 static int erreur_handleur (int status, const char* func_name, const char* err_msg, const char* file_name, int line, void *userdata) {
 	// we might be looking for trouble because we don't know whether OpenCV is longjmp-proof.



More information about the Gridflow-cvs mailing list