Port QImage::Format_CMYK32 to CMYK8888
Follow the established convention that byte-oriented image formats have the "8888" suffix, not "32". The old enum name is temporarily left to help port other submodules. This work has been kindly sponsored by the QGIS project (https://qgis.org/). Change-Id: I4b6f10cb22312b614cb9cf4b0ac439907276c538 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>bb10
parent
adb49d65e0
commit
7f72a93e87
|
|
@ -304,7 +304,7 @@ bool QImageData::checkForAlphaPixels() const
|
|||
case QImage::Format_RGBX64:
|
||||
case QImage::Format_RGBX16FPx4:
|
||||
case QImage::Format_RGBX32FPx4:
|
||||
case QImage::Format_CMYK32:
|
||||
case QImage::Format_CMYK8888:
|
||||
break;
|
||||
case QImage::Format_Invalid:
|
||||
case QImage::NImageFormats:
|
||||
|
|
@ -361,7 +361,7 @@ bool QImageData::checkForAlphaPixels() const
|
|||
refer to the \l{How to Create Qt Plugins}{Plugin HowTo}.
|
||||
|
||||
\warning Painting on a QImage with the format
|
||||
QImage::Format_Indexed8 or QImage::Format_CMYK32 is not supported.
|
||||
QImage::Format_Indexed8 or QImage::Format_CMYK8888 is not supported.
|
||||
|
||||
\tableofcontents
|
||||
|
||||
|
|
@ -743,9 +743,10 @@ bool QImageData::checkForAlphaPixels() const
|
|||
\value Format_RGBA32FPx4 The image is stored using a 4 32-bit floating point RGBA format (32FP-32FP-32FP-32FP). (added in Qt 6.2)
|
||||
\value Format_RGBA32FPx4_Premultiplied The image is stored using a premultiplied 4 32-bit floating point
|
||||
RGBA format (32FP-32FP-32FP-32FP). (added in Qt 6.2)
|
||||
\value Format_CMYK32 The image is stored using a 32 bit CMYK format (0xCCMMYYKK). (added in Qt 6.8)
|
||||
\value Format_CMYK8888 The image is stored using a 32-bit byte-ordered CMYK format. (added in Qt 6.8)
|
||||
\omitvalue Format_CMYK32
|
||||
|
||||
\note Drawing into a QImage with format QImage::Format_Indexed8 or QImage::Format_CMYK32 is not
|
||||
\note Drawing into a QImage with format QImage::Format_Indexed8 or QImage::Format_CMYK8888 is not
|
||||
supported.
|
||||
|
||||
\note Avoid most rendering directly to most of these formats using QPainter. Rendering
|
||||
|
|
@ -5729,7 +5730,7 @@ static constexpr QPixelFormat pixelformats[] = {
|
|||
/*PREMULTIPLIED*/ QPixelFormat::Premultiplied,
|
||||
/*INTERPRETATION*/ QPixelFormat::FloatingPoint,
|
||||
/*BYTE ORDER*/ QPixelFormat::CurrentSystemEndian),
|
||||
//QImage::Format_CMYK32:
|
||||
//QImage::Format_CMYK8888:
|
||||
QPixelFormat(QPixelFormat::CMYK,
|
||||
/*RED*/ 8,
|
||||
/*GREEN*/ 8,
|
||||
|
|
|
|||
|
|
@ -75,7 +75,8 @@ public:
|
|||
Format_RGBX32FPx4,
|
||||
Format_RGBA32FPx4,
|
||||
Format_RGBA32FPx4_Premultiplied,
|
||||
Format_CMYK32,
|
||||
Format_CMYK8888,
|
||||
Format_CMYK32 = Format_CMYK8888,
|
||||
#ifndef Q_QDOC
|
||||
NImageFormats
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -2456,12 +2456,12 @@ static bool convert_Grayscale8_to_Indexed8_inplace(QImageData *data, Qt::ImageCo
|
|||
}
|
||||
|
||||
template <bool SourceIsPremultiplied>
|
||||
static void convert_ARGB32_to_CMYK32(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
|
||||
static void convert_ARGB32_to_CMYK8888(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
|
||||
{
|
||||
Q_ASSERT(src->format == QImage::Format_RGB32 ||
|
||||
src->format == QImage::Format_ARGB32 ||
|
||||
src->format == QImage::Format_ARGB32_Premultiplied);
|
||||
Q_ASSERT(dest->format == QImage::Format_CMYK32);
|
||||
Q_ASSERT(dest->format == QImage::Format_CMYK8888);
|
||||
Q_ASSERT(src->width == dest->width);
|
||||
Q_ASSERT(src->height == dest->height);
|
||||
|
||||
|
|
@ -2619,10 +2619,10 @@ static void qInitImageConversions()
|
|||
qimage_converter_map[QImage::Format_RGBX32FPx4][QImage::Format_RGBA32FPx4] = convert_passthrough;
|
||||
qimage_converter_map[QImage::Format_RGBX32FPx4][QImage::Format_RGBA32FPx4_Premultiplied] = convert_passthrough;
|
||||
|
||||
qimage_converter_map[QImage::Format_CMYK32][QImage::Format_CMYK32] = convert_passthrough;
|
||||
qimage_converter_map[QImage::Format_RGB32][QImage::Format_CMYK32] = convert_ARGB32_to_CMYK32<false>;
|
||||
qimage_converter_map[QImage::Format_ARGB32][QImage::Format_CMYK32] = convert_ARGB32_to_CMYK32<false>;
|
||||
qimage_converter_map[QImage::Format_ARGB32_Premultiplied][QImage::Format_CMYK32] = convert_ARGB32_to_CMYK32<true>;
|
||||
qimage_converter_map[QImage::Format_CMYK8888][QImage::Format_CMYK8888] = convert_passthrough;
|
||||
qimage_converter_map[QImage::Format_RGB32][QImage::Format_CMYK8888] = convert_ARGB32_to_CMYK8888<false>;
|
||||
qimage_converter_map[QImage::Format_ARGB32][QImage::Format_CMYK8888] = convert_ARGB32_to_CMYK8888<false>;
|
||||
qimage_converter_map[QImage::Format_ARGB32_Premultiplied][QImage::Format_CMYK8888] = convert_ARGB32_to_CMYK8888<true>;
|
||||
|
||||
// Inline converters:
|
||||
qimage_inplace_converter_map[QImage::Format_Indexed8][QImage::Format_Grayscale8] =
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ inline int qt_depthForFormat(QImage::Format format)
|
|||
case QImage::Format_RGBA32FPx4_Premultiplied:
|
||||
depth = 128;
|
||||
break;
|
||||
case QImage::Format_CMYK32:
|
||||
case QImage::Format_CMYK8888:
|
||||
depth = 32;
|
||||
break;
|
||||
}
|
||||
|
|
@ -251,7 +251,7 @@ inline QImage::Format qt_opaqueVersion(QImage::Format format)
|
|||
case QImage::Format_RGBX32FPx4:
|
||||
case QImage::Format_Grayscale8:
|
||||
case QImage::Format_Grayscale16:
|
||||
case QImage::Format_CMYK32:
|
||||
case QImage::Format_CMYK8888:
|
||||
return format;
|
||||
case QImage::Format_Mono:
|
||||
case QImage::Format_MonoLSB:
|
||||
|
|
@ -315,7 +315,7 @@ inline QImage::Format qt_alphaVersion(QImage::Format format)
|
|||
case QImage::Format_Alpha8:
|
||||
case QImage::Format_Grayscale8:
|
||||
case QImage::Format_Invalid:
|
||||
case QImage::Format_CMYK32:
|
||||
case QImage::Format_CMYK8888:
|
||||
case QImage::NImageFormats:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -397,7 +397,7 @@ static DestFetchProc destFetchProc[] =
|
|||
destFetch, // Format_RGBX32FPx4
|
||||
destFetch, // Format_RGBA32FPx4
|
||||
destFetch, // Format_RGBA32FPx4_Premultiplied
|
||||
destFetch, // Format_CMYK32
|
||||
destFetch, // Format_CMYK8888
|
||||
};
|
||||
|
||||
static_assert(std::size(destFetchProc) == QImage::NImageFormats);
|
||||
|
|
@ -457,7 +457,7 @@ static DestFetchProc64 destFetchProc64[] =
|
|||
destFetch64, // Format_RGBX32FPx4
|
||||
destFetch64, // Format_RGBA32FPx4
|
||||
destFetch64, // Format_RGBA32FPx4_Premultiplied
|
||||
destFetch64, // Format_CMYK32
|
||||
destFetch64, // Format_CMYK8888
|
||||
};
|
||||
|
||||
static_assert(std::size(destFetchProc64) == QImage::NImageFormats);
|
||||
|
|
@ -516,7 +516,7 @@ static DestFetchProcFP destFetchProcFP[] =
|
|||
destFetchRGBFP, // Format_RGBX32FPx4
|
||||
destFetchFP, // Format_RGBA32FPx4
|
||||
destFetchRGBFP, // Format_RGBA32FPx4_Premultiplied
|
||||
destFetchFP, // Format_CMYK32
|
||||
destFetchFP, // Format_CMYK8888
|
||||
};
|
||||
|
||||
static_assert(std::size(destFetchProcFP) == QImage::NImageFormats);
|
||||
|
|
@ -710,7 +710,7 @@ static DestStoreProc destStoreProc[] =
|
|||
destStore, // Format_RGBX32FPx4
|
||||
destStore, // Format_RGBA32FPx4
|
||||
destStore, // Format_RGBA32FPx4_Premultiplied
|
||||
destStore, // Format_CMYK32
|
||||
destStore, // Format_CMYK8888
|
||||
};
|
||||
|
||||
static_assert(std::size(destStoreProc) == QImage::NImageFormats);
|
||||
|
|
@ -813,7 +813,7 @@ static DestStoreProc64 destStoreProc64[] =
|
|||
destStore64, // Format_RGBX32FPx4
|
||||
destStore64, // Format_RGBA32FPx4
|
||||
destStore64, // Format_RGBA32FPx4_Premultiplied
|
||||
destStore64, // Format_CMYK32
|
||||
destStore64, // Format_CMYK8888
|
||||
};
|
||||
|
||||
static_assert(std::size(destStoreProc64) == QImage::NImageFormats);
|
||||
|
|
@ -3128,7 +3128,7 @@ static SourceFetchProc sourceFetchUntransformed[] = {
|
|||
fetchUntransformed, // RGBX32Px4
|
||||
fetchUntransformed, // RGBA32FPx4
|
||||
fetchUntransformed, // RGBA32FPx4_Premultiplied
|
||||
fetchUntransformed, // CMYK32
|
||||
fetchUntransformed, // CMYK8888
|
||||
};
|
||||
|
||||
static_assert(std::size(sourceFetchUntransformed) == QImage::NImageFormats);
|
||||
|
|
|
|||
|
|
@ -1766,7 +1766,7 @@ bool QPainter::begin(QPaintDevice *pd)
|
|||
qt_cleanup_painter_state(d);
|
||||
return false;
|
||||
} else if (img->format() == QImage::Format_Indexed8 ||
|
||||
img->format() == QImage::Format_CMYK32) {
|
||||
img->format() == QImage::Format_CMYK8888) {
|
||||
// Painting on these formats is not supported.
|
||||
qWarning() << "QPainter::begin: Cannot paint on an image with the"
|
||||
<< img->format()
|
||||
|
|
|
|||
|
|
@ -3056,7 +3056,7 @@ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, bool lossless,
|
|||
format = QImage::Format_Mono;
|
||||
} else {
|
||||
*bitmap = false;
|
||||
if (format != QImage::Format_RGB32 && format != QImage::Format_ARGB32 && format != QImage::Format_CMYK32) {
|
||||
if (format != QImage::Format_RGB32 && format != QImage::Format_ARGB32 && format != QImage::Format_CMYK8888) {
|
||||
image = image.convertToFormat(QImage::Format_ARGB32);
|
||||
format = QImage::Format_ARGB32;
|
||||
}
|
||||
|
|
@ -3086,14 +3086,14 @@ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, bool lossless,
|
|||
QBuffer buffer(&imageData);
|
||||
QImageWriter writer(&buffer, "jpeg");
|
||||
writer.setQuality(94);
|
||||
if (format == QImage::Format_CMYK32) {
|
||||
if (format == QImage::Format_CMYK8888) {
|
||||
// PDFs require CMYK colors not to be inverted in the JPEG encoding
|
||||
writer.setSubType("CMYK");
|
||||
}
|
||||
writer.write(image);
|
||||
dct = true;
|
||||
|
||||
if (format != QImage::Format_RGB32 && format != QImage::Format_CMYK32) {
|
||||
if (format != QImage::Format_RGB32 && format != QImage::Format_CMYK8888) {
|
||||
softMaskData.resize(w * h);
|
||||
uchar *sdata = (uchar *)softMaskData.data();
|
||||
for (int y = 0; y < h; ++y) {
|
||||
|
|
@ -3108,7 +3108,7 @@ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, bool lossless,
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if (format == QImage::Format_CMYK32) {
|
||||
if (format == QImage::Format_CMYK8888) {
|
||||
imageData.resize(grayscale ? w * h : w * h * 4);
|
||||
uchar *data = (uchar *)imageData.data();
|
||||
const qsizetype bytesPerLine = image.bytesPerLine();
|
||||
|
|
@ -3154,7 +3154,7 @@ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, bool lossless,
|
|||
}
|
||||
}
|
||||
}
|
||||
if (format == QImage::Format_RGB32 || format == QImage::Format_CMYK32)
|
||||
if (format == QImage::Format_RGB32 || format == QImage::Format_CMYK8888)
|
||||
hasAlpha = hasMask = false;
|
||||
}
|
||||
int maskObject = 0;
|
||||
|
|
@ -3182,7 +3182,7 @@ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, bool lossless,
|
|||
const WriteImageOption option = [&]() {
|
||||
if (grayscale)
|
||||
return WriteImageOption::Grayscale;
|
||||
if (format == QImage::Format_CMYK32)
|
||||
if (format == QImage::Format_CMYK8888)
|
||||
return WriteImageOption::CMYK;
|
||||
return WriteImageOption::RGB;
|
||||
}();
|
||||
|
|
|
|||
|
|
@ -1658,7 +1658,7 @@ static const QRgba64 *QT_FASTCALL fetchRGBA32FPMToRGBA64PM(QRgba64 *buffer, cons
|
|||
return buffer;
|
||||
}
|
||||
|
||||
inline const uint *qt_convertCMYK32ToARGB32PM(uint *buffer, const uint *src, int count)
|
||||
inline const uint *qt_convertCMYK8888ToARGB32PM(uint *buffer, const uint *src, int count)
|
||||
{
|
||||
UNALIASED_CONVERSION_LOOP(buffer, src, count, [](uint s) {
|
||||
const QColor color = QCmyk32::fromCmyk32(s).toColor();
|
||||
|
|
@ -1667,12 +1667,12 @@ inline const uint *qt_convertCMYK32ToARGB32PM(uint *buffer, const uint *src, int
|
|||
return buffer;
|
||||
}
|
||||
|
||||
static void QT_FASTCALL convertCMYK32ToARGB32PM(uint *buffer, int count, const QList<QRgb> *)
|
||||
static void QT_FASTCALL convertCMYK8888ToARGB32PM(uint *buffer, int count, const QList<QRgb> *)
|
||||
{
|
||||
qt_convertCMYK32ToARGB32PM(buffer, buffer, count);
|
||||
qt_convertCMYK8888ToARGB32PM(buffer, buffer, count);
|
||||
}
|
||||
|
||||
static const QRgba64 *QT_FASTCALL convertCMYK32ToToRGBA64PM(QRgba64 *buffer, const uint *src, int count,
|
||||
static const QRgba64 *QT_FASTCALL convertCMYK8888ToToRGBA64PM(QRgba64 *buffer, const uint *src, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
for (int i = 0; i < count; ++i)
|
||||
|
|
@ -1680,7 +1680,7 @@ static const QRgba64 *QT_FASTCALL convertCMYK32ToToRGBA64PM(QRgba64 *buffer, con
|
|||
return buffer;
|
||||
}
|
||||
|
||||
static const uint *QT_FASTCALL fetchCMYK32ToARGB32PM(uint *buffer, const uchar *src, int index, int count,
|
||||
static const uint *QT_FASTCALL fetchCMYK8888ToARGB32PM(uint *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const uint *s = reinterpret_cast<const uint *>(src) + index;
|
||||
|
|
@ -1689,7 +1689,7 @@ static const uint *QT_FASTCALL fetchCMYK32ToARGB32PM(uint *buffer, const uchar *
|
|||
return buffer;
|
||||
}
|
||||
|
||||
static const QRgba64 *QT_FASTCALL fetchCMYK32ToRGBA64PM(QRgba64 *buffer, const uchar *src, int index, int count,
|
||||
static const QRgba64 *QT_FASTCALL fetchCMYK8888ToRGBA64PM(QRgba64 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const uint *s = reinterpret_cast<const uint *>(src) + index;
|
||||
|
|
@ -1698,7 +1698,7 @@ static const QRgba64 *QT_FASTCALL fetchCMYK32ToRGBA64PM(QRgba64 *buffer, const u
|
|||
return buffer;
|
||||
}
|
||||
|
||||
static void QT_FASTCALL storeCMYKFromARGB32PM(uchar *dest, const uint *src, int index, int count,
|
||||
static void QT_FASTCALL storeCMYK8888FromARGB32PM(uchar *dest, const uint *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
uint *d = reinterpret_cast<uint *>(dest) + index;
|
||||
|
|
@ -1708,7 +1708,7 @@ static void QT_FASTCALL storeCMYKFromARGB32PM(uchar *dest, const uint *src, int
|
|||
}
|
||||
}
|
||||
|
||||
static void QT_FASTCALL storeCMYKFromRGB32(uchar *dest, const uint *src, int index, int count,
|
||||
static void QT_FASTCALL storeCMYK8888FromRGB32(uchar *dest, const uint *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
uint *d = reinterpret_cast<uint *>(dest) + index;
|
||||
|
|
@ -1841,9 +1841,9 @@ QPixelLayout qPixelLayouts[] = {
|
|||
fetchRGB32FToRGB32, fetchRGBA32FPMToRGBA64PM,
|
||||
storeRGB32FFromRGB32, storeRGB32FFromRGB32 }, // Format_RGBA32FPx4_Premultiplied
|
||||
{ false, false, QPixelLayout::BPP32, nullptr,
|
||||
convertCMYK32ToARGB32PM, convertCMYK32ToToRGBA64PM,
|
||||
fetchCMYK32ToARGB32PM, fetchCMYK32ToRGBA64PM,
|
||||
storeCMYKFromARGB32PM, storeCMYKFromRGB32 }, // Format_CMYK32
|
||||
convertCMYK8888ToARGB32PM, convertCMYK8888ToToRGBA64PM,
|
||||
fetchCMYK8888ToARGB32PM, fetchCMYK8888ToRGBA64PM,
|
||||
storeCMYK8888FromARGB32PM, storeCMYK8888FromRGB32 }, // Format_CMYK8888
|
||||
};
|
||||
|
||||
static_assert(std::size(qPixelLayouts) == QImage::NImageFormats);
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ inline static bool read_jpeg_format(QImage::Format &format, j_decompress_ptr cin
|
|||
break;
|
||||
case 4:
|
||||
if (cinfo->out_color_space == JCS_CMYK)
|
||||
format = QImage::Format_CMYK32;
|
||||
format = QImage::Format_CMYK8888;
|
||||
else
|
||||
format = QImage::Format_RGB32;
|
||||
break;
|
||||
|
|
@ -201,7 +201,7 @@ static bool ensureValidImage(QImage *dest, struct jpeg_decompress_struct *info,
|
|||
break;
|
||||
case 4:
|
||||
if (info->out_color_space == JCS_CMYK)
|
||||
format = QImage::Format_CMYK32;
|
||||
format = QImage::Format_CMYK8888;
|
||||
else
|
||||
format = QImage::Format_RGB32;
|
||||
break;
|
||||
|
|
@ -550,7 +550,7 @@ static bool do_write_jpeg_image(struct jpeg_compress_struct &cinfo,
|
|||
cinfo.input_components = 1;
|
||||
cinfo.in_color_space = JCS_GRAYSCALE;
|
||||
break;
|
||||
case QImage::Format_CMYK32:
|
||||
case QImage::Format_CMYK8888:
|
||||
cinfo.input_components = 4;
|
||||
cinfo.in_color_space = JCS_CMYK;
|
||||
break;
|
||||
|
|
@ -670,7 +670,7 @@ static bool do_write_jpeg_image(struct jpeg_compress_struct &cinfo,
|
|||
}
|
||||
}
|
||||
break;
|
||||
case QImage::Format_CMYK32: {
|
||||
case QImage::Format_CMYK8888: {
|
||||
auto *cmykIn = reinterpret_cast<const quint32 *>(image.constScanLine(cinfo.next_scanline));
|
||||
auto *cmykOut = reinterpret_cast<quint32 *>(row);
|
||||
if (invertCMYK) {
|
||||
|
|
|
|||
|
|
@ -321,8 +321,8 @@ static QLatin1String formatToString(QImage::Format format)
|
|||
return QLatin1String("RGBA32FPx4");
|
||||
case QImage::Format_RGBA32FPx4_Premultiplied:
|
||||
return QLatin1String("RGBA32FPx4pm");
|
||||
case QImage::Format_CMYK32:
|
||||
return QLatin1String("CMYK32");
|
||||
case QImage::Format_CMYK8888:
|
||||
return QLatin1String("CMYK8888");
|
||||
case QImage::NImageFormats:
|
||||
break;
|
||||
};
|
||||
|
|
@ -1509,7 +1509,7 @@ void tst_QImage::setPixelWithAlpha_data()
|
|||
continue;
|
||||
if (c == QImage::Format_Alpha8)
|
||||
continue;
|
||||
if (c == QImage::Format_CMYK32)
|
||||
if (c == QImage::Format_CMYK8888)
|
||||
continue;
|
||||
QTest::newRow(qPrintable(formatToString(QImage::Format(c)))) << QImage::Format(c);
|
||||
}
|
||||
|
|
@ -2573,7 +2573,7 @@ void tst_QImage::rgbSwapped_data()
|
|||
if (i == QImage::Format_Alpha8
|
||||
|| i == QImage::Format_Grayscale8
|
||||
|| i == QImage::Format_Grayscale16
|
||||
|| i == QImage::Format_CMYK32) {
|
||||
|| i == QImage::Format_CMYK8888) {
|
||||
continue;
|
||||
}
|
||||
QTest::addRow("%s", formatToString(QImage::Format(i)).data()) << QImage::Format(i);
|
||||
|
|
@ -3056,14 +3056,14 @@ void tst_QImage::inplaceRgbConversion_data()
|
|||
if (i == QImage::Format_Alpha8
|
||||
|| i == QImage::Format_Grayscale8
|
||||
|| i == QImage::Format_Grayscale16
|
||||
|| i == QImage::Format_CMYK32) {
|
||||
|| i == QImage::Format_CMYK8888) {
|
||||
continue;
|
||||
}
|
||||
for (int j = QImage::Format_RGB32; j < QImage::NImageFormats; ++j) {
|
||||
if (j == QImage::Format_Alpha8
|
||||
|| j == QImage::Format_Grayscale8
|
||||
|| j == QImage::Format_Grayscale16
|
||||
|| j == QImage::Format_CMYK32) {
|
||||
|| j == QImage::Format_CMYK8888) {
|
||||
continue;
|
||||
}
|
||||
if (i == j)
|
||||
|
|
@ -3353,7 +3353,7 @@ void tst_QImage::invertPixelsRGB_data()
|
|||
if (i == QImage::Format_Alpha8
|
||||
|| i == QImage::Format_Grayscale8
|
||||
|| i == QImage::Format_Grayscale16
|
||||
|| i == QImage::Format_CMYK32) {
|
||||
|| i == QImage::Format_CMYK8888) {
|
||||
continue;
|
||||
}
|
||||
QTest::addRow("%s", formatToString(QImage::Format(i)).data()) << QImage::Format(i);
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ void tst_QImageReader::jpegRgbCmyk()
|
|||
QCOMPARE(image1.height(), image2.height());
|
||||
QCOMPARE(image1.width(), image2.width());
|
||||
|
||||
QCOMPARE(image1.format(), QImage::Format_CMYK32);
|
||||
QCOMPARE(image1.format(), QImage::Format_CMYK8888);
|
||||
QCOMPARE(image2.format(), QImage::Format_RGB32);
|
||||
|
||||
// compare all the pixels with a slack of 3. This ignores rounding errors
|
||||
|
|
@ -616,7 +616,7 @@ void tst_QImageReader::imageFormat_data()
|
|||
QTest::newRow("ppm-4") << QString("test.ppm") << QByteArray("ppm") << QImage::Format_RGB32;
|
||||
|
||||
QTest::newRow("jpeg-1") << QString("beavis.jpg") << QByteArray("jpeg") << QImage::Format_Grayscale8;
|
||||
QTest::newRow("jpeg-2") << QString("YCbCr_cmyk.jpg") << QByteArray("jpeg") << QImage::Format_CMYK32;
|
||||
QTest::newRow("jpeg-2") << QString("YCbCr_cmyk.jpg") << QByteArray("jpeg") << QImage::Format_CMYK8888;
|
||||
QTest::newRow("jpeg-3") << QString("YCbCr_rgb.jpg") << QByteArray("jpeg") << QImage::Format_RGB32;
|
||||
|
||||
QTest::newRow("gif-1") << QString("earth.gif") << QByteArray("gif") << QImage::Format_Invalid;
|
||||
|
|
|
|||
|
|
@ -2784,7 +2784,7 @@ void tst_QPainter::monoImages()
|
|||
for (int i = 1; i < QImage::NImageFormats; ++i) {
|
||||
for (int j = 0; j < numColorPairs; ++j) {
|
||||
const QImage::Format format = QImage::Format(i);
|
||||
if (format == QImage::Format_Indexed8 || format == QImage::Format_CMYK32)
|
||||
if (format == QImage::Format_Indexed8 || format == QImage::Format_CMYK8888)
|
||||
continue;
|
||||
|
||||
QImage img(2, 2, format);
|
||||
|
|
@ -3554,9 +3554,9 @@ void tst_QPainter::drawImage_data()
|
|||
|
||||
for (int srcFormat = QImage::Format_Mono; srcFormat < QImage::NImageFormats; ++srcFormat) {
|
||||
for (int dstFormat = QImage::Format_Mono; dstFormat < QImage::NImageFormats; ++dstFormat) {
|
||||
// Indexed8 and CMYK32 can't be painted to, and Alpha8 can't hold a color.
|
||||
// Indexed8 and CMYK8888 can't be painted to, and Alpha8 can't hold a color.
|
||||
if (dstFormat == QImage::Format_Indexed8 ||
|
||||
dstFormat == QImage::Format_CMYK32 ||
|
||||
dstFormat == QImage::Format_CMYK8888 ||
|
||||
dstFormat == QImage::Format_Alpha8) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue