| 
     
      
      
      From: Dominic L. <ma...@us...> - 2004-06-14 12:53:15
      
     
   | 
Update of /cvsroot/robotflow/RobotFlow/Vision/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16407 Modified Files: JPEGSave.cc Log Message: trying to compress 15 and 8 bpp jpeg images Index: JPEGSave.cc =================================================================== RCS file: /cvsroot/robotflow/RobotFlow/Vision/src/JPEGSave.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JPEGSave.cc 13 Jun 2004 19:44:11 -0000 1.5 --- JPEGSave.cc 14 Jun 2004 12:53:03 -0000 1.6 *************** *** 228,237 **** else { //write JPEG data into memory ! if (ImageValue->get_pixelsize() == 3) { ! write_pixbuf(*ImageValue,string(""), true, false, *image_data); ! } ! else { ! throw new GeneralException("Save to memory only support on 24bpp images",__FILE__,__LINE__); ! } } } --- 228,232 ---- else { //write JPEG data into memory ! write_pixbuf(*ImageValue,string(""), true, false, *image_data); } } *************** *** 289,295 **** cinfo.image_width = image.get_width(); /* image width and height, in pixels */ cinfo.image_height = image.get_height(); ! cinfo.input_components = 3; /* # of color components per pixel */ ! cinfo.in_color_space = JCS_RGB; /* colorspace of input image */ ! //cinfo.data_precision = 15; //15bPP jpeg_set_quality(&cinfo,atoi(m_quality.c_str()),FALSE); /* set compression quality */ --- 284,307 ---- cinfo.image_width = image.get_width(); /* image width and height, in pixels */ cinfo.image_height = image.get_height(); ! ! switch(image.get_pixelsize()) { ! case 1: ! cinfo.input_components = 1; /* # of color components per pixel */ ! cinfo.in_color_space = JCS_GRAYSCALE; ! cinfo.data_precision = 8; //8 bpp ! break; ! ! case 2: ! cinfo.input_components = 3; /* # of color components per pixel */ ! cinfo.in_color_space = JCS_RGB; /* colorspace of input image */ ! cinfo.data_precision = 15; //15 bPP ! break; ! ! case 3: ! cinfo.input_components = 3; /* # of color components per pixel */ ! cinfo.in_color_space = JCS_RGB; /* colorspace of input image */ ! cinfo.data_precision = 24; //24 bPP ! break; ! } jpeg_set_quality(&cinfo,atoi(m_quality.c_str()),FALSE); /* set compression quality */  |