[Gridflow-cvs] [svn] commit: r4064 - /trunk/format/jpeg.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Sat Aug 16 12:05:27 EDT 2008


Author: matju
Date: Sat Aug 16 12:05:26 2008
New Revision: 4064

Log:
fixed the quality setting... sorry

Modified:
    trunk/format/jpeg.c

Modified: trunk/format/jpeg.c
==============================================================================
--- trunk/format/jpeg.c (original)
+++ trunk/format/jpeg.c Sat Aug 16 12:05:26 2008
@@ -38,6 +38,7 @@
 	struct jpeg_compress_struct cjpeg;
 	struct jpeg_decompress_struct djpeg;
 	struct jpeg_error_mgr jerr;
+	short quality;
 	\constructor (t_symbol *mode, string filename) {
 		Format::_0_open(0,0,mode,filename);
 		uint32 mask[3] = {0x0000ff,0x00ff00,0xff0000};
@@ -60,6 +61,7 @@
 	cjpeg.input_components = 3;
 	cjpeg.in_color_space = JCS_RGB;
 	jpeg_set_defaults(&cjpeg);
+	jpeg_set_quality(&cjpeg,quality,false);
 	jpeg_start_compress(&cjpeg,TRUE);
 } GRID_FLOW {
 	int rowsize = in->dim->get(1)*in->dim->get(2);
@@ -106,12 +108,7 @@
 	jpeg_destroy_decompress(&djpeg);
 }
 
-\def 0 quality (short quality) {
-	quality = min(max((int)quality,0),100);
-	// should the last arg ("baseline") be set to true ?
-	// and what is it for? is it for accuracy of the DC component?
-	jpeg_set_quality(&cjpeg,quality,false);
-}
+\def 0 quality (short quality) {this->quality = min(max((int)quality,0),100);}
 
 \classinfo {install_format("#io.jpeg",6,"jpeg jpg");}
 \end class FormatJPEG



More information about the Gridflow-cvs mailing list