- dropped Motif Drag-And-Drop (DND) support
- dropped LPR support
- dropped static plugins support
- - dropped XBM, MNG, BMP, ICO, TGA, JPEG, TIFF and GIF image format support
+ - dropped XBM, PGM, MNG, BMP, ICO, TGA, JPEG, TIFF and GIF image format support
- dropped obscure (24-bit) image formats support
- dropped Valgrind support
- dropped recursive mutex and lock support
handler = new QXpmHandler;
#endif
#ifndef QT_NO_IMAGEFORMAT_PPM
- } else if (form == "pbm" || form == "pbmraw" || form == "pgm"
- || form == "pgmraw" || form == "ppm" || form == "ppmraw") {
+ } else if (form == "pbm" || form == "pbmraw" || form == "ppm" || form == "ppmraw") {
handler = new QPpmHandler;
handler->setOption(QImageIOHandler::SubType, form);
#endif
\header \o Format \o Description
\row \o PNG \o Portable Network Graphics
\row \o PBM \o Portable Bitmap
- \row \o PGM \o Portable Graymap
\row \o PPM \o Portable Pixmap
\row \o XPM \o X11 Pixmap
\row \o SVG \o Scalable Vector Graphics
QList<QByteArray> formats = QList<QByteArray>()
<< "png"
#ifndef QT_NO_IMAGEFORMAT_PPM
- << "ppm" << "pgm" << "pbm"
+ << "ppm" << "pbm"
#endif
#ifndef QT_NO_IMAGEFORMAT_XPM
<< "xpm"
handler = new QXpmHandler;
#endif
#ifndef QT_NO_IMAGEFORMAT_PPM
- } else if (form == "pbm" || form == "pbmraw" || form == "pgm"
- || form == "pgmraw" || form == "ppm" || form == "ppmraw") {
+ } else if (form == "pbm" || form == "pbmraw" || form == "ppm" || form == "ppmraw") {
handler = new QPpmHandler;
handler->setOption(QImageIOHandler::SubType, form);
#endif
QT_BEGIN_NAMESPACE
/*****************************************************************************
- PBM/PGM/PPM (ASCII and RAW) image read/write functions
+ PBM/PPM (ASCII and RAW) image read/write functions
*****************************************************************************/
static int read_pbm_int(QIODevice *d)
nbits = 1;
format = QImage::Format_Mono;
break;
- case '2': // ascii PGM
- case '5': // raw PGM
- nbits = 8;
- format = QImage::Format_Indexed8;
- break;
case '3': // ascii PPM
case '6': // raw PPM
nbits = 32;
QByteArray format = sourceFormat;
format = format.left(3); // ignore RAW part
- bool gray = format == "pgm";
if (format == "pbm") {
image = image.convertToFormat(QImage::Format_Mono);
}
case 8: {
- str.insert(1, gray ? '5' : '6');
+ str.insert(1, '6');
str.append("255\n");
if (out->write(str, str.length()) != str.length())
return false;
QVector<QRgb> color = image.colorTable();
- uint bpl = w*(gray ? 1 : 3);
+ uint bpl = w*3;
QSTACKARRAY(uchar, buf, bpl);
for (uint y=0; y<h; y++) {
uchar *b = image.scanLine(y);
uchar *p = buf;
uchar *end = buf+bpl;
- if (gray) {
- while (p < end) {
- uchar g = (uchar)qGray(color[*b++]);
- *p++ = g;
- }
- } else {
- while (p < end) {
- QRgb rgb = color[*b++];
- *p++ = qRed(rgb);
- *p++ = qGreen(rgb);
- *p++ = qBlue(rgb);
- }
+ while (p < end) {
+ QRgb rgb = color[*b++];
+ *p++ = qRed(rgb);
+ *p++ = qGreen(rgb);
+ *p++ = qBlue(rgb);
}
if (bpl != (uint)out->write((char*)buf, bpl))
return false;
}
case 32: {
- str.insert(1, gray ? '5' : '6');
+ str.insert(1, '6');
str.append("255\n");
if (out->write(str, str.length()) != str.length())
return false;
- uint bpl = w*(gray ? 1 : 3);
+ uint bpl = w*3;
QSTACKARRAY(uchar, buf, bpl);
for (uint y=0; y<h; y++) {
QRgb *b = (QRgb*)image.scanLine(y);
uchar *p = buf;
uchar *end = buf+bpl;
- if (gray) {
- while (p < end) {
- uchar g = (uchar)qGray(*b++);
- *p++ = g;
- }
- } else {
- while (p < end) {
- QRgb rgb = *b++;
- *p++ = qRed(rgb);
- *p++ = qGreen(rgb);
- *p++ = qBlue(rgb);
- }
+ while (p < end) {
+ QRgb rgb = *b++;
+ *p++ = qRed(rgb);
+ *p++ = qGreen(rgb);
+ *p++ = qBlue(rgb);
}
if (bpl != (uint)out->write((char*)buf, bpl))
return false;
if (head[1] == '1' || head[1] == '4') {
if (subType)
*subType = "pbm";
- } else if (head[1] == '2' || head[1] == '5') {
- if (subType)
- *subType = "pgm";
} else if (head[1] == '3' || head[1] == '6') {
if (subType)
*subType = "ppm";
switch (type) {
case '1': // ascii PBM
case '4': // raw PBM
- format = QImage::Format_Mono;
- break;
- case '2': // ascii PGM
- case '5': // raw PGM
- format = QImage::Format_Indexed8;
+ format = QImage::Format_Mono;
break;
case '3': // ascii PPM
case '6': // raw PPM
+++ /dev/null
-P2
-24 7
-15
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-0 3 3 3 3 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 15 15 15 0
-0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 15 0
-0 3 3 3 0 0 0 7 7 7 0 0 0 11 11 11 0 0 0 15 15 15 15 0
-0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 0 0
-0 3 0 0 0 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 0 0 0 0
-0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0