Changeset 649 for trunk/geant4/visualization
- Timestamp:
- Dec 10, 2007, 7:06:14 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r639 r649 288 288 printf("G4OpenGLQtViewer::~G4OpenGLQtViewer \n"); 289 289 #endif 290 delete fContextMenu;291 290 } 292 291 … … 1308 1307 FILE* fp; 1309 1308 1310 if ((!aImage.isGrayscale ()) &&(aInColor ==1 )) { 1311 #if QT_VERSION < 0x040000 1312 aImage = aImage.convertDepth(1,Qt::MonoOnly); 1313 #else 1314 aImage = aImage.convertToFormat ( aImage.format(), Qt::MonoOnly); 1315 #endif 1316 } 1317 const uchar * pixels = aImage.bits (); 1318 1319 if (pixels == NULL) 1309 if (aImage.bits () == NULL) 1320 1310 return false; 1321 1311 … … 1372 1362 int size = width*height; 1373 1363 1364 1374 1365 if (depth == 1) 1375 1366 size = (width+7)/8*height; … … 1378 1369 1379 1370 int i = 0; 1380 if (depth == 1) { 1381 // To be implemented 1382 // QImage::Endian bitOrder = aImage.bitOrder(); 1383 /* for(int y=0; y < height; y++) { 1384 const uchar * s = aImage.scanLine(y); 1385 for(int x=0; x < width; x++) { 1386 // need to copy bit for bit... 1387 bool b = (bitOrder == QImage::LittleEndian) ? 1388 (*(s + (x >> 3)) >> (x & 7)) & 1 : 1389 (*(s + (x >> 3)) << (x & 7)) & 0x80 ; 1390 if (b) 1391 pixel[i >> 3] ^= (0x80 >> (i & 7)); 1392 i++; 1393 } 1394 // we need to align to 8 bit here 1395 i = (i+7) & 0xffffff8; 1396 } 1397 */ 1398 } else if (depth == 8) { 1371 // if ( aInColor ==1 ) { 1372 // FIXME : L. Garnier. For the moment 10 dec 2007, I could not find a way 1373 // to save correctly grayscale Image. I mean that color or grayscale image 1374 // have the same file save size ! 1375 1376 /* } else*/ if (depth == 8) { 1399 1377 for(int y=height-1; y >=0 ; y--) { 1400 1378 const uchar * s = aImage.scanLine(y); … … 1416 1394 } else { 1417 1395 #if QT_VERSION < 0x040000 1418 G4cerr << "GenerateEPS:: No alpha channel image with Qt3. This is only supported with Qt4\n" << G4endl;1396 bool alpha = aImage.hasAlphaBuffer(); 1419 1397 #else 1420 1398 bool alpha = aImage.hasAlphaChannel(); 1421 #ifdef GEANT4_QT_DEBUG1422 printf("has else %d alpha %d\n",depth,alpha);1423 #endif1424 1399 for(int y=height-1; y >=0 ; y--) { 1425 1400 QRgb * s = (QRgb*)(aImage.scanLine(y));
Note: See TracChangeset
for help on using the changeset viewer.