[Gridflow-cvs] [svn] commit: r6523 - in /trunk: doc/flow_classes/#redim-help.pd src/classes1.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Thu Feb 3 20:44:53 EST 2011


Author: matju
Date: Thu Feb  3 20:44:53 2011
New Revision: 6523

Log:
[#redim]: argument defaults to ()

Modified:
    trunk/doc/flow_classes/#redim-help.pd
    trunk/src/classes1.cxx

Modified: trunk/doc/flow_classes/#redim-help.pd
==============================================================================
--- trunk/doc/flow_classes/#redim-help.pd (original)
+++ trunk/doc/flow_classes/#redim-help.pd Thu Feb  3 20:44:53 2011
@@ -1,46 +1,49 @@
-#N canvas 680 0 632 624 10;
+#N canvas 680 0 632 642 10;
 #X text 86 37 rearrange a grid's values according to new dimensions
 ;
 #X obj 21 36 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1 -1
 ;
 #X obj 21 103 #in;
 #X obj 111 154 #out window;
-#X obj 103 575 #ravel;
-#X obj 151 575 #perspective;
+#X obj 103 597 #ravel;
+#X obj 151 597 #perspective;
 #X obj 21 154 #out window;
 #X obj 21 127 t a a;
 #X obj 111 124 #redim (120 160 3);
-#X text 232 443 Outputs the redimensioned data as a grid.;
+#X text 232 465 Outputs the redimensioned data as a grid.;
 #X msg 232 131 240 320 3;
 #X msg 226 95 400 400 3;
 #X obj 0 0 doc_h;
-#X obj 3 277 doc_i 2;
+#X obj 3 299 doc_i 2;
 #X obj 3 193 doc_c 1;
-#X obj 3 575 doc_also;
-#X obj 3 413 doc_o 1;
-#X obj 14 307 doc_ii 0;
-#X obj 14 381 doc_ii 1;
-#X obj 14 443 doc_oo 0;
+#X obj 3 597 doc_also;
+#X obj 3 435 doc_o 1;
+#X obj 14 329 doc_ii 0;
+#X obj 14 403 doc_ii 1;
+#X obj 14 465 doc_oo 0;
 #X obj 14 223 doc_cc 0;
 #X obj 97 223 doc_m c0 grid;
 #X text 232 223 dimension list \, (120 160 3) in this example.;
-#X obj 97 307 doc_m i0 grid;
+#X obj 97 329 doc_m i0 grid;
 #X text 232 245 same as the dimension list of #import;
-#X text 232 307 the elements of this grid are serialized. if the resulting
+#X text 232 329 the elements of this grid are serialized. if the resulting
 grid must be larger \, the sequence is repeated as much as necessary.
 if the resulting grid must be smaller \, the sequence is truncated.
 then the elements are deserialized to form the resulting grid.;
-#X obj 97 381 doc_m i1 grid;
-#X obj 232 381 doc_same 0;
-#X obj 97 443 doc_m o0 grid;
-#X text 232 465 example: with a 240 320 RGB image \, [#redim 120 640
+#X obj 97 403 doc_m i1 grid;
+#X obj 232 403 doc_same 0;
+#X obj 97 465 doc_m o0 grid;
+#X text 232 487 example: with a 240 320 RGB image \, [#redim 120 640
 3] will visually separate the even lines (left) from the odd lines
 (right). contrary to this \, [#redim 640 120 3] will split every line
 and put its left half on a even line and the right half on the following
 odd line. [#redim] 480 320 3 will repeat the input image twice in the
 output image. [#redim] 240 50 3 will only keep the 50 top lines.;
-#X obj 0 595 doc_f;
+#X obj 0 617 doc_f;
 #X msg 21 81 load working.jpg;
+#X text 232 267 default: ();
+#X obj 235 597 #dim;
+#X obj 271 597 #import;
 #X connect 1 0 31 0;
 #X connect 2 0 7 0;
 #X connect 7 0 6 0;
@@ -50,8 +53,11 @@
 #X connect 11 0 8 1;
 #X connect 15 1 4 0;
 #X connect 15 1 5 0;
+#X connect 15 1 33 0;
+#X connect 15 1 34 0;
 #X connect 21 1 22 0;
 #X connect 21 1 24 0;
+#X connect 21 1 32 0;
 #X connect 23 1 25 0;
 #X connect 26 1 27 0;
 #X connect 28 1 9 0;

Modified: trunk/src/classes1.cxx
==============================================================================
--- trunk/src/classes1.cxx (original)
+++ trunk/src/classes1.cxx Thu Feb  3 20:44:53 2011
@@ -959,9 +959,9 @@
 	P<Grid> dim_grid;
 	P<Grid> temp; // temp->dim is not of the same shape as dim
 	~GridRedim() {}
-	\constructor (Grid *d) {
+	\constructor (Grid *d=0) {
 		dim_grid.but(expect_dim_dim_list);
-		dim_grid=d;
+		dim_grid=d?d:new Grid(Dim(0));
 		dim = dim_grid->to_dim();
 	//	if (!dim.prod()) RAISE("target grid size must not be zero");
 	}



More information about the Gridflow-cvs mailing list