[Gridflow-cvs] [svn] commit: r4984 - /trunk/src/classes2.cxx

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Sun Feb 7 16:58:06 EST 2010


Author: matju
Date: Sun Feb  7 16:58:06 2010
New Revision: 4984

Log:
add support for 4 channels

Modified:
    trunk/src/classes2.cxx

Modified: trunk/src/classes2.cxx
==============================================================================
--- trunk/src/classes2.cxx (original)
+++ trunk/src/classes2.cxx Sun Feb  7 16:58:06 2010
@@ -559,21 +559,13 @@
 	std::ostringstream os;
 	oprintf(os,"image create photo %s -data \"P6\\n%d %d\\n255\\n",rsym->s_name,sx,sy);
 	int i=0;
+	int chans = in->dim->get(2);
 	for (int y=0; y<sy; y++) {
 	  for (int x=0; x<sx; x++) {
 	    for (int c=0; c<3; c++) {
-		int v = data[i++];
-		/*
-		 * if     (v=='\n') os << "\\n";
-		else if (v=='{') os << "\\x7b";
-		else if (v=='}') os << "\\x7d";
-		else if (v==0) os << "\\x00";
-		//else if (strchr("\\[]\"$",v)) os << "\\" << (char)v;
-		else if (strchr("[]\"$",v)) os << "\\" << (char)v;
-		else os << (char)v;
-		*/
-		oprintf(os,"\\x%02x",v);
+		oprintf(os,"\\x%02x",data[i++]);
 	    }
+	    if (chans==4) i++;
 	  }
 	}
 	os << "\"\n";



More information about the Gridflow-cvs mailing list