[Gridflow-cvs] [svn] commit: r3345 - /trunk/base/flow_objects.c

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


Author: matju
Date: Fri Mar 28 18:32:32 2008
New Revision: 3345

Log:
merge \classinfo into \end

Modified:
    trunk/base/flow_objects.c

Modified: trunk/base/flow_objects.c
==============================================================================
--- trunk/base/flow_objects.c (original)
+++ trunk/base/flow_objects.c Fri Mar 28 18:32:32 2008
@@ -96,20 +96,16 @@
 	\decl void initialize (NumberTypeE nt);
 	\grin 0
 };
-
 GRID_INLET(GridCast,0) {
 	out = new GridOutlet(this,0,in->dim,nt);
 } GRID_FLOW {
 	out->send(n,data);
 } GRID_END
-
 \def void initialize (NumberTypeE nt) {
 	rb_call_super(argc,argv);
 	this->nt = nt;
 }
-
-\classinfo { install("#cast",1,1); }
-\end class GridCast
+\end class GridCast {install("#cast",1,1);}
 
 //****************************************************************
 //{ ?,Dim[B] -> Dim[*Cs] }
@@ -170,8 +166,7 @@
 }
 
 \def void _0_reset() {int32 foo[1]={0}; while (out->dim) out->send(1,foo);}
-\classinfo { install("#import",2,1); }
-\end class GridImport
+\end class GridImport {install("#import",2,1);}
 
 //****************************************************************
 /*{ Dim[*As] -> ? }*/
@@ -184,8 +179,7 @@
 } GRID_FLOW {
 	for (int i=0; i<n; i++) outlet_float(bself->out[0],data[i]);
 } GRID_END
-\classinfo { install("#to_float",1,1); }
-\end class GridToFloat
+\end class GridToFloat {install("#to_float",1,1);}
 
 \class GridToSymbol : GridObject {
 	\grin 0
@@ -199,8 +193,7 @@
 	c[n]=0;
 	outlet_symbol(bself->out[0],gensym(c));
 } GRID_END
-\classinfo { install("#to_symbol",1,1); }
-\end class GridToSymbol
+\end class GridToSymbol {install("#to_symbol",1,1);}
 
 /* **************************************************************** */
 /*{ Dim[*As] -> ? }*/
@@ -222,8 +215,7 @@
 	if (in->dim->prod()==0) send_out(0,0,data);
 } GRID_END
 
-\classinfo { install("#to_list",1,1); /*add_creator("#export_list");*/ }
-\end class GridExportList
+\end class GridExportList {install("#to_list",1,1); /*add_creator("#export_list");*/}
 
 /* **************************************************************** */
 \class GridPrint : GridObject {
@@ -380,8 +372,7 @@
 	dump_dims(head,in);
 	if (in->dim->prod()==0) puts(head);
 } GRID_END
-\classinfo { install("#print",1,1); }
-\end class
+\end class {install("#print",1,1);}
 
 /* **************************************************************** */
 // [#store] is the class for storing a grid and restituting it on demand.
@@ -570,8 +561,7 @@
 	fromb = new int32[Dim::MAX_DIM];
 	to2   = new int32[Dim::MAX_DIM];
 }
-\classinfo { install("#store",2,1); }
-\end class GridStore
+\end class GridStore {install("#store",2,1);}
 
 //****************************************************************
 //{ Dim[*As]<T> -> Dim[*As]<T> } or
@@ -632,8 +622,7 @@
   rb_call_super(argc,argv); this->op=op;
   this->r=r?r:new Grid(new Dim(),int32_e,true);
 }
-\classinfo { install("#",2,1); }
-\end class GridOp
+\end class GridOp {install("#",2,1);}
 
 //****************************************************************
 \class GridFold : GridObject {
@@ -679,8 +668,7 @@
 } GRID_END
 
 \def void initialize (Numop *op) { rb_call_super(argc,argv); this->op=op; }
-\classinfo { install("#fold",1,1); }
-\end class GridFold
+\end class GridFold {install("#fold",1,1);}
 
 \class GridScan : GridObject {
 	\attr Numop *op;
@@ -717,8 +705,7 @@
 } GRID_END
 
 \def void initialize (Numop *op) { rb_call_super(argc,argv); this->op = op; }
-\classinfo { install("#scan",1,1); }
-\end class GridScan
+\end class GridScan {install("#scan",1,1);}
 
 //****************************************************************
 // L      is a Dim[*si,sj,    *ss]<T>
@@ -869,8 +856,7 @@
 	this->r    = r ? r : new Grid(new Dim(),int32_e,true);
 }
 
-\classinfo { install("#inner",2,1); }
-\end class GridInner
+\end class GridInner {install("#inner",2,1);}
 
 /* **************************************************************** */
 /*{ Dim[*As]<T>,Dim[*Bs]<T> -> Dim[*As,*Bs]<T> }*/
@@ -931,8 +917,7 @@
 	this->r = r ? r : new Grid(new Dim(),int32_e,true);
 }
 
-\classinfo { install("#outer",2,1); }
-\end class GridOuter
+\end class GridOuter {install("#outer",2,1);}
 
 //****************************************************************
 //{ Dim[]<T>,Dim[]<T>,Dim[]<T> -> Dim[A]<T> } or
@@ -1018,8 +1003,7 @@
 GRID_INPUT(GridFor,2,step) {} GRID_END
 GRID_INPUT(GridFor,1,to) {} GRID_END
 GRID_INPUT(GridFor,0,from) {_0_bang(0,0);} GRID_END
-\classinfo { install("#for",3,1); }
-\end class GridFor
+\end class GridFor {install("#for",3,1);}
 
 //****************************************************************
 \class GridFinished : GridObject {
@@ -1033,8 +1017,7 @@
 	Ruby a[] = { INT2NUM(0), bsym._bang };
 	send_out(COUNT(a),a);
 } GRID_END
-\classinfo { install("#finished",1,1); }
-\end class GridFinished
+\end class GridFinished {install("#finished",1,1);}
 
 \class GridDim : GridObject {
 	\decl void initialize ();
@@ -1046,8 +1029,7 @@
 	out.send(in->dim->n,in->dim->v);
 	in->set_mode(0);
 } GRID_END
-\classinfo { install("#dim",1,1); }
-\end class GridDim
+\end class GridDim {install("#dim",1,1);}
 
 \class GridType : GridObject {
 	\decl void initialize ();
@@ -1059,8 +1041,7 @@
 	outlet_symbol(bself->out[0],gensym((char *)number_type_table[in->nt].name));
 	in->set_mode(0);
 } GRID_END
-\classinfo { install("#type",1,1); }
-\end class GridType
+\end class GridType {install("#type",1,1);}
 
 //****************************************************************
 //{ Dim[*As]<T>,Dim[B] -> Dim[*Cs]<T> }
@@ -1115,8 +1096,7 @@
 //	if (!dim->prod()) RAISE("target grid size must not be zero");
 }
 
-\classinfo { install("#redim",2,1); }
-\end class GridRedim
+\end class GridRedim {install("#redim",2,1);}
 
 //****************************************************************
 \class GridJoin : GridObject {
@@ -1191,8 +1171,7 @@
 	this->r=r;
 }
 
-\classinfo { install("@join",2,1); }
-\end class GridJoin
+\end class GridJoin {install("@join",2,1);}
 
 //****************************************************************
 \class GridGrade : GridObject {
@@ -1226,8 +1205,7 @@
 	}
 } GRID_END
 
-\classinfo { install("#grade",1,1); }
-\end class GridGrade
+\end class GridGrade {install("#grade",1,1);}
 
 //****************************************************************
 //\class GridMedian : GridObject
@@ -1289,8 +1267,7 @@
 	this->dim2 = dim2;
 }
 
-\classinfo { install("#transpose",3,1); }
-\end class GridTranspose
+\end class GridTranspose {install("#transpose",3,1);}
 
 //****************************************************************
 \class GridReverse : GridObject {
@@ -1327,8 +1304,7 @@
 	this->dim1 = dim1;
 }
 
-\classinfo { install("#reverse",2,1); }
-\end class GridReverse
+\end class GridReverse {install("#reverse",2,1);}
 
 //****************************************************************
 \class GridCentroid : GridObject {
@@ -1363,8 +1339,7 @@
 	outlet_float(bself->out[2],blah[1]);
 } GRID_END
 
-\classinfo { install("#centroid",1,3); }
-\end class GridCentroid
+\end class GridCentroid {install("#centroid",1,3);}
 
 //****************************************************************
 \class GridMoment : GridObject {
@@ -1446,8 +1421,7 @@
 	rb_call_super(argc,argv);
 }
 
-\classinfo { install("#moment",2,1); }
-\end class GridMoment
+\end class GridMoment {install("#moment",2,1);}
 
 //****************************************************************
 \class GridLabeling : GridObject {
@@ -1542,8 +1516,7 @@
 	bself->ninlets_set(form_val ? 2 : 4);
 }
 
-\classinfo { install("#labeling",1,0); }
-\end class GridLabeling
+\end class GridLabeling {install("#labeling",1,0);}
 
 //****************************************************************
 \class GridPerspective : GridObject {
@@ -1570,8 +1543,7 @@
 
 \def void initialize (int32 z) {rb_call_super(argc,argv); this->z=z;}
 
-\classinfo { install("#perspective",1,1); }
-\end class GridPerspective
+\end class GridPerspective {install("#perspective",1,1);}
 
 //****************************************************************
 \class GridBorder : GridObject {
@@ -1620,8 +1592,7 @@
 	dimr_grid=dr; dimr = dimr_grid->to_dim();
 }
 
-\classinfo { install("#border",3,1); }
-\end class GridBorder
+\end class GridBorder {install("#border",3,1);}
 
 static void expect_picture (P<Dim> d) {
 	if (d->n!=3) RAISE("(height,width,chans) dimensions please");}
@@ -1766,8 +1737,7 @@
 	this->anti = true;
 }
 
-\classinfo { install("#convolve",2,1); }
-\end class GridConvolve
+\end class GridConvolve {install("#convolve",2,1);}
 
 /* ---------------------------------------------------------------- */
 /* "#scale_by" does quick scaling of pictures by integer factors */
@@ -1828,8 +1798,7 @@
 	prepare_scale_factor();
 }
 
-\classinfo { install("#scale_by",2,1); }
-\end class GridScaleBy
+\end class GridScaleBy {install("#scale_by",2,1);}
 
 // ----------------------------------------------------------------
 //{ Dim[A,B,3]<T> -> Dim[C,D,3]<T> }
@@ -1919,8 +1888,7 @@
 	smoothly = option==SYM(smoothly);
 }
 
-\classinfo { install("#downscale_by",2,1); }
-\end class GridDownscaleBy
+\end class GridDownscaleBy {install("#downscale_by",2,1);}
 
 //****************************************************************
 \class GridLayer : GridObject {
@@ -1955,8 +1923,7 @@
 
 GRID_INPUT(GridLayer,1,r) {} GRID_END
 
-\classinfo { install("#layer",2,1); }
-\end class GridLayer
+\end class GridLayer {install("#layer",2,1);}
 
 // ****************************************************************
 // pad1,pad2 only are there for 32-byte alignment
@@ -2082,8 +2049,7 @@
 	if (polygon) { this->polygon=polygon; init_lines(); }
 }
 
-\classinfo { install("#draw_polygon",3,1); }
-\end class DrawPolygon
+\end class DrawPolygon {install("#draw_polygon",3,1);}
 
 //****************************************************************
 static void expect_position(P<Dim> d) {
@@ -2201,8 +2167,7 @@
 	else this->position=new Grid(new Dim(2),int32_e,true);
 }
 
-\classinfo { install("#draw_image",3,1); }
-\end class DrawImage
+\end class DrawImage {install("#draw_image",3,1);}
 
 //****************************************************************
 // Dim[*A],Dim[*B],Dim[C,size(A)-size(B)] -> Dim[*A]
@@ -2251,8 +2216,7 @@
 	if (points) this->points=points;
 }
 
-\classinfo { install("#draw_points",3,1); }
-\end class GridDrawPoints
+\end class GridDrawPoints {install("#draw_points",3,1);}
 
 //****************************************************************
 \class GridPolygonize : GridObject {
@@ -2266,8 +2230,7 @@
 	/* WRITE ME */
 } GRID_END
 
-\classinfo { install("#polygonize",1,1); }
-\end class GridPolygonize
+\end class GridPolygonize {install("#polygonize",1,1);}
 
 //****************************************************************
 \class GridNoiseGateYuvs : GridObject {
@@ -2296,8 +2259,7 @@
 
 \def void _1_float(int v) {thresh=v;}
 \def void initialize(int v=0) {thresh=v;}
-\classinfo { install("#noise_gate_yuvs",2,1); }
-\end class GridNoiseGateYuvs
+\end class GridNoiseGateYuvs {install("#noise_gate_yuvs",2,1);}
 
 //****************************************************************
 
@@ -2311,7 +2273,6 @@
 	\decl void _0_bang ();
 	//\grin 0
 };
-
 \def void initialize (int n=2, NumberTypeE nt=float32_e) {
 	if (n<1) RAISE("n=%d must be at least 1",n);
 	if (n>32) RAISE("n=%d is too many?",n);
@@ -2319,7 +2280,6 @@
 	a = new Grid(new Dim(n),nt,true);
 	this->n=n;
 }
-
 \def void initialize2 () {
 	rb_call_super(argc,argv);
 	bself->ninlets_set(this->n);
@@ -2330,16 +2290,13 @@
 #undef FOO
 	_0_bang(argc,argv);
 }
-
 \def void _0_bang () {
 	out=new GridOutlet(this,0,a->dim,a->nt);
 #define FOO(T) out->send(n,(T *)*a);
 TYPESWITCH(a->nt,FOO,);
 #undef FOO
 }
-
-\classinfo { install("#pack",1,1); }
-\end class GridPack
+\end class GridPack {install("#pack",1,1);}
 
 \class GridUnpack : GridObject {
 	int n;
@@ -2347,13 +2304,11 @@
 	\decl void initialize2 ();
 	\grin 0
 };
-
 GRID_INLET(GridUnpack,0) {
 	in->set_chunk(0);
 } GRID_FLOW {
 	for (int i=0; i<n; i++) send_out(i,1,data+i);
 } GRID_END
-
 \def void initialize (int n=2) {
 	if (n<1) RAISE("n=%d must be at least 1",n);
 	if (n>32) RAISE("n=%d is too many?",n);
@@ -2364,12 +2319,10 @@
 	rb_call_super(argc,argv);
 	bself->noutlets_set(this->n);
 }
-
-\classinfo { install("#unpack",1,0); }
-\end class GridUnpack
-
-//****************************************************************
-\class ForEach < FObject {
+\end class GridUnpack {install("#unpack",1,0);}
+
+//****************************************************************
+\class ForEach : FObject {
 	\decl void _0_list (...);
 };
 
@@ -2383,8 +2336,15 @@
 	}
 }
 
-\classinfo { install("foreach",1,1); }
-\end class ForEach
+\end class ForEach {install("foreach",1,1);}
+
+\class GFError : FObject {
+	\decl void initialize ();
+	\decl void _0_list (...);
+};
+\def void initialize () {}
+\def void _0_list (...) {}
+\end class GFError {install("gf.error",1,0);}
 
 //****************************************************************
 



More information about the Gridflow-cvs mailing list