Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 78a4512d authored by Dmitry Kazakov's avatar Dmitry Kazakov

Made the use of RenderingIntent and ConversionFlags consistens

Now for all internal conversions one must use:

KoColorConversionTransformation::InternalRenderingIntent
or
KoColorConversionTransformation::InternalConversionFlags

Or their Adjustment counterparts.

BUG:318434
parent ca37a1f4
......@@ -110,8 +110,8 @@ private:
Traits::template sampleData<useOldData>(m_accessor, m_data, m_srcCS);
m_srcCS->convertPixelsTo(m_data, dst, m_dstCS, 1,
KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::BlackpointCompensation);
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
}
private:
......
......@@ -127,7 +127,9 @@ void KisFixedPaintDevice::convertFromQImage(const QImage& _image, const QString
} else {
KoColorSpaceRegistry::instance()
->colorSpace( RGBAColorModelID.id(), Integer8BitsColorDepthID.id(), srcProfileName)
->convertPixelsTo(image.bits(), data(), colorSpace(), image.width() * image.height(), KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
->convertPixelsTo(image.bits(), data(), colorSpace(), image.width() * image.height(),
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
}
}
......
......@@ -113,8 +113,8 @@ public:
* Converts the paint device to a different colorspace
*/
void convertTo(const KoColorSpace * dstColorSpace = 0,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty);
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags);
/**
* Fill this paint device with the data from image
*
......@@ -134,8 +134,8 @@ public:
* like sRGB).
*/
virtual QImage convertToQImage(const KoColorProfile *dstProfile, qint32 x, qint32 y, qint32 w, qint32 h,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty) const;
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags) const;
/**
* Create an RGBA QImage from a rectangle in the paint device. The
......@@ -146,8 +146,8 @@ public:
* like sRGB).
*/
virtual QImage convertToQImage(const KoColorProfile *dstProfile,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty) const;
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags) const;
/**
* Clear the given rectangle to transparent black.
......
......@@ -152,7 +152,9 @@ void KisGroupLayer::resetCache(const KoColorSpace *colorSpace)
dev->setX(m_d->x);
dev->setY(m_d->y);
quint8* defaultPixel = colorSpace->allocPixelBuffer(1);
colorSpace->convertPixelsTo(m_d->paintDevice->defaultPixel(), defaultPixel, colorSpace, 1, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
colorSpace->convertPixelsTo(m_d->paintDevice->defaultPixel(), defaultPixel, colorSpace, 1,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
dev->setDefaultPixel(defaultPixel);
delete[] defaultPixel;
m_d->paintDevice = dev;
......
......@@ -1093,7 +1093,9 @@ QImage KisImage::convertToQImage(qint32 x,
{
KisPaintDeviceSP dev = m_d->rootLayer->projection();
if (!dev) return QImage();
QImage image = dev->convertToQImage(const_cast<KoColorProfile*>(profile), x, y, w, h, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
QImage image = dev->convertToQImage(const_cast<KoColorProfile*>(profile), x, y, w, h,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
if (m_d->backgroundPattern) {
m_d->backgroundPattern->paintBackground(image, QRect(x, y, w, h));
......@@ -1174,7 +1176,9 @@ QImage KisImage::convertToQImage(const QRect& scaledRect, const QSize& scaledIma
}
delete [] imageRow;
QImage image = colorSpace()->convertToQImage(scaledImageData, scaledRect.width(), scaledRect.height(), const_cast<KoColorProfile*>(profile), KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
QImage image = colorSpace()->convertToQImage(scaledImageData, scaledRect.width(), scaledRect.height(), const_cast<KoColorProfile*>(profile),
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
if (m_d->backgroundPattern) {
m_d->backgroundPattern->paintBackground(image, scaledRect, scaledImageSize, QSize(imageWidth, imageHeight));
......
......@@ -519,7 +519,9 @@ QImage KisLayer::createThumbnail(qint32 w, qint32 h)
KisPaintDeviceSP originalDevice = original();
return originalDevice ?
originalDevice->createThumbnail(w, h, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation) : QImage();
originalDevice->createThumbnail(w, h,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags) : QImage();
}
qint32 KisLayer::x() const
......
......@@ -276,7 +276,9 @@ QImage KisMask::createThumbnail(qint32 w, qint32 h)
selection() ? selection()->projection() : 0;
return originalDevice ?
originalDevice->createThumbnail(w, h, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation) : QImage();
originalDevice->createThumbnail(w, h,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags) : QImage();
}
void KisMask::testingInitSelection(const QRect &rect)
......
......@@ -650,7 +650,9 @@ void KisPaintDevice::convertFromQImage(const QImage& _image, const KoColorProfil
quint8 * dstData = new quint8[image.width() * image.height() * pixelSize()];
KoColorSpaceRegistry::instance()
->colorSpace(RGBAColorModelID.id(), Integer8BitsColorDepthID.id(), profile)
->convertPixelsTo(image.bits(), dstData, colorSpace(), image.width() * image.height(), KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
->convertPixelsTo(image.bits(), dstData, colorSpace(), image.width() * image.height(),
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
writeBytes(dstData, offsetX, offsetY, image.width(), image.height());
delete[] dstData;
......
......@@ -409,8 +409,8 @@ public:
* @return a command that can be used to undo the conversion.
*/
KUndo2Command* convertTo(const KoColorSpace * dstColorSpace,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty);
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags);
/**
* Changes the profile of the colorspace of this paint device to the given
......@@ -436,8 +436,8 @@ public:
* like sRGB).
*/
virtual QImage convertToQImage(const KoColorProfile *dstProfile, qint32 x, qint32 y, qint32 w, qint32 h,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty) const;
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags) const;
/**
* Create an RGBA QImage from a rectangle in the paint device. The
......@@ -448,8 +448,8 @@ public:
* like sRGB).
*/
virtual QImage convertToQImage(const KoColorProfile * dstProfile,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty) const;
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags) const;
/**
* Creates a paint device thumbnail of the paint device, retaining
......@@ -474,15 +474,15 @@ public:
* @param rect: only this rect will be used for the thumbnail
*/
virtual QImage createThumbnail(qint32 maxw, qint32 maxh, QRect rect,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty);
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags);
/**
* Cached version of createThumbnail(qint32 maxw, qint32 maxh, const KisSelection *selection, QRect rect)
*/
virtual QImage createThumbnail(qint32 maxw, qint32 maxh,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty);
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags);
/**
* Fill c and opacity with the values found at x and y.
......
......@@ -151,8 +151,8 @@ void KisPainter::init()
d->mirrorVerticaly = false;
d->paramInfo.opacity = 1.0f;
d->paramInfo.flow = 1.0f;
d->renderingIntent = KoColorConversionTransformation::IntentPerceptual;
d->conversionFlags = KoColorConversionTransformation::Empty;
d->renderingIntent = KoColorConversionTransformation::InternalRenderingIntent;
d->conversionFlags = KoColorConversionTransformation::InternalConversionFlags;
}
KisPainter::~KisPainter()
......@@ -1319,8 +1319,8 @@ inline void KisPainter::compositeOnePixel(quint8 *dst, const KoColor &color)
d->paramInfo.cols = 1;
d->colorSpace->bitBlt(color.colorSpace(), d->paramInfo, d->compositeOp,
KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::Empty);
d->renderingIntent,
d->conversionFlags);
}
/**/
......
......@@ -255,7 +255,9 @@ QImage KisSelectionBasedLayer::createThumbnail(qint32 w, qint32 h)
KisPaintDeviceSP originalDevice = original();
return originalDevice && originalSelection ?
originalDevice->createThumbnail(w, h, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation) :
originalDevice->createThumbnail(w, h,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags) :
QImage();
}
......
......@@ -35,7 +35,9 @@ void KisColorSpaceConvertVisitorTest::testCreation()
QVERIFY(lab);
KisImageSP image = new KisImage(0, 100, 100, lab, "test");
KisPaintLayerSP layer = new KisPaintLayer(image, "test", OPACITY_OPAQUE_U8, lab);
KisColorSpaceConvertVisitor test(image, lab, rgb, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::NoOptimization);
KisColorSpaceConvertVisitor test(image, lab, rgb,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
layer->accept(test);
QVERIFY(layer->colorSpace()->colorModelId() == rgb->colorModelId());
}
......
......@@ -74,8 +74,8 @@ void KisImageTest::testConvertImageColorSpace()
const KoColorSpace *cs16 = KoColorSpaceRegistry::instance()->rgb16();
image->lock();
image->convertImageColorSpace(cs16,
KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::Empty);
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
image->unlock();
QVERIFY(*cs16 == *image->colorSpace());
......
......@@ -57,11 +57,15 @@ void KisSelectionTest::testGrayColorspaceConversion()
quint8 color1[1] = {128};
quint8 color2[2] = {64,32};
csA->convertPixelsTo(color2, color1, csNoA, 1, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::Empty);
csA->convertPixelsTo(color2, color1, csNoA, 1,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
QCOMPARE((int)color1[0], 8);
csNoA->convertPixelsTo(color1, color2, csA, 1, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::Empty);
csNoA->convertPixelsTo(color1, color2, csA, 1,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
QCOMPARE((int)color2[0], 8);
QCOMPARE((int)color2[1], 255);
......@@ -100,8 +104,8 @@ void KisSelectionTest::testGrayColorspaceOverComposition()
params.flow = 1.0;
csA->bitBlt(csA, params, csA->compositeOp(COMPOSITE_OVER),
KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::Empty);
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
QCOMPARE((int)color0[0], 56);
QCOMPARE((int)color0[1], 255);
......@@ -109,8 +113,8 @@ void KisSelectionTest::testGrayColorspaceOverComposition()
params.dstRowStart = color3;
csNoA->bitBlt(csA, params, csNoA->compositeOp(COMPOSITE_OVER),
KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::Empty);
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
QCOMPARE((int)color3[0], 56);
}
......
......@@ -138,7 +138,7 @@ void KisCommonColors::recalculate()
KisImageWSP kisImage = m_canvas->image();
QImage image = kisImage->projection()->createThumbnail(1024, 1024, kisImage->bounds(), KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
QImage image = kisImage->projection()->createThumbnail(1024, 1024, kisImage->bounds(), KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
KisCommonColorsRecalculationRunner* runner = new KisCommonColorsRecalculationRunner(image, patchCount(), this);
QThreadPool::globalInstance()->start(runner);
......
......@@ -234,7 +234,9 @@ void KisUndoModel::addImage(int idx) {
if( m_stack->count() == idx && !imageMap.contains(currentCommand)) {
KisImageWSP historyImage = m_canvas->view()->image();
KisPaintDeviceSP paintDevice = historyImage->projection();
QImage image = paintDevice->createThumbnail(32, 32, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
QImage image = paintDevice->createThumbnail(32, 32,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
imageMap[currentCommand] = image;
}
QList<const KUndo2Command*> list;
......
......@@ -101,7 +101,7 @@ void KisFilterFastColorTransfer::process(KisPaintDeviceSP device,
const KoColorSpace* oldCS = device->colorSpace();
KisPaintDeviceSP srcLAB = new KisPaintDevice(*device.data());
dbgPlugins << "srcLab : " << srcLAB->extent();
KUndo2Command* cmd = srcLAB->convertTo(labCS, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
KUndo2Command* cmd = srcLAB->convertTo(labCS, KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
delete cmd;
if (progressUpdater) {
......
......@@ -97,7 +97,7 @@ KisPropertiesConfiguration* KisWdgFastColorTransfer::configuration() const
}
dbgPlugins << "convert ref to lab";
KUndo2Command* cmd = ref->convertTo(labCS, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
KUndo2Command* cmd = ref->convertTo(labCS, KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
delete cmd;
// Compute the means and sigmas of ref
......
......@@ -148,7 +148,7 @@ void KisFilterPhongBumpmap::process(KisPaintDeviceSP device,
KisPaintDeviceSP bumpmapPaintDevice = new KisPaintDevice(KoColorSpaceRegistry::instance()->rgb16());
bumpmapPaintDevice->writeBytes(bumpmap.data(), outputArea.x(), outputArea.y(), outputArea.width(), outputArea.height());
KUndo2Command *leaker = bumpmapPaintDevice->convertTo(device->colorSpace(), KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
KUndo2Command *leaker = bumpmapPaintDevice->convertTo(device->colorSpace(), KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
KisPainter copier(device);
copier.bitBlt(outputArea.x(), outputArea.y(), bumpmapPaintDevice,
outputArea.x(), outputArea.y(), outputArea.width(), outputArea.height());
......
......@@ -66,7 +66,7 @@ KoFilter::ConversionStatus KisBMPExport::convert(const QByteArray& from, const Q
QRect rc = output->image()->bounds();
output->image()->refreshGraph();
output->image()->lock();
QImage image = output->image()->projection()->convertToQImage(0, 0, 0, rc.width(), rc.height(), KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
QImage image = output->image()->projection()->convertToQImage(0, 0, 0, rc.width(), rc.height(), KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
output->image()->unlock();
image.save(url.toLocalFile());
return KoFilter::OK;
......
......@@ -211,7 +211,7 @@ KisImageBuilder_Result KisJPEGConverter::decode(const KUrl& uri)
KoColorTransformation* transform = 0;
if (profile && !profile->isSuitableForOutput()) {
transform = KoColorSpaceRegistry::instance()->colorSpace(modelId, Integer8BitsColorDepthID.id(), profile)->createColorConverter(cs, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
transform = KoColorSpaceRegistry::instance()->colorSpace(modelId, Integer8BitsColorDepthID.id(), profile)->createColorConverter(cs, KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
}
// Apparently an invalid transform was created from the profile. See bug https://bugs.kde.org/show_bug.cgi?id=255451.
// After 2.3: warn the user!
......@@ -469,7 +469,7 @@ KisImageBuilder_Result KisJPEGConverter::buildFile(const KUrl& uri, KisPaintLaye
const KoColorSpace * cs = layer->colorSpace();
J_COLOR_SPACE color_type = getColorTypeforColorSpace(cs);
if (color_type == JCS_UNKNOWN) {
KUndo2Command *tmp = layer->paintDevice()->convertTo(KoColorSpaceRegistry::instance()->rgb8(), KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
KUndo2Command *tmp = layer->paintDevice()->convertTo(KoColorSpaceRegistry::instance()->rgb8(), KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
delete tmp;
color_type = JCS_RGB;
}
......
......@@ -193,10 +193,10 @@ KoFilter::ConversionStatus KisPPMExport::convert(const QByteArray& from, const Q
if (((rgb && (pd->colorSpace()->id() != "RGBA" && pd->colorSpace()->id() != "RGBA16"))
|| (!rgb && (pd->colorSpace()->id() != "GRAYA" && pd->colorSpace()->id() != "GRAYA16")))) {
if (rgb) {
pd->convertTo(KoColorSpaceRegistry::instance()->rgb8(0), KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
pd->convertTo(KoColorSpaceRegistry::instance()->rgb8(0), KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
}
else {
pd->convertTo(KoColorSpaceRegistry::instance()->colorSpace(GrayAColorModelID.id(), Integer8BitsColorDepthID.id(), 0), KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
pd->convertTo(KoColorSpaceRegistry::instance()->colorSpace(GrayAColorModelID.id(), Integer8BitsColorDepthID.id(), 0), KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
}
}
......
......@@ -282,7 +282,7 @@ KisImageBuilder_Result KisTIFFConverter::readTIFFDirectory(TIFF* image)
KoColorTransformation* transform = 0;
if (profile && !profile->isSuitableForOutput()) {
dbgFile << "The profile can't be used in krita, need conversion";
transform = KoColorSpaceRegistry::instance()->colorSpace(colorSpaceId.first, colorSpaceId.second, profile)->createColorConverter(cs, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
transform = KoColorSpaceRegistry::instance()->colorSpace(colorSpaceId.first, colorSpaceId.second, profile)->createColorConverter(cs, KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
}
// Check if there is an alpha channel
......
......@@ -587,7 +587,7 @@ KisFixedPaintDeviceSP KisBrush::paintDevice(const KoColorSpace * colorSpace,
dab2->initialize();
dabPointer = dab->data();
quint8* dabPointer2 = dab2->data();
KoColorSpaceRegistry::instance()->rgb8()->convertPixelsTo(dabPointer, dabPointer2, colorSpace, outputWidth * outputHeight, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
KoColorSpaceRegistry::instance()->rgb8()->convertPixelsTo(dabPointer, dabPointer2, colorSpace, outputWidth * outputHeight, KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
dab = dab2;
}
return dab;
......
......@@ -299,7 +299,7 @@ bool KisGbrBrush::initFromPaintDev(KisPaintDeviceSP image, int x, int y, int w,
{
// Forcefully convert to RGBA8
// XXX profile and exposure?
setImage(image->convertToQImage(0, x, y, w, h, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation));
setImage(image->convertToQImage(0, x, y, w, h, KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags));
setName(image->objectName());
setHasColor(true);
......
......@@ -47,8 +47,8 @@ tile_request_start(MyPaintTiledSurface *tiled_surface, MyPaintTiledSurfaceTileRe
m_dst->readBytes(m_dstData, tx * TILE_SIZE, ty * TILE_SIZE, TILE_SIZE, TILE_SIZE);
m_dst->colorSpace()->convertPixelsTo(m_dstData, m_dstRgb16Data, m_rgb16, TILE_SIZE * TILE_SIZE,
KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::BlackpointCompensation);
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
quint16* rgba_p = reinterpret_cast<quint16*>(m_dstRgb16Data);
......@@ -67,8 +67,8 @@ tile_request_end(MyPaintTiledSurface *tiled_surface, MyPaintTiledSurfaceTileRequ
// SomeThing *something = (SomeThing*)request->context;
m_rgb16->convertPixelsTo(m_dstRgb16Data, m_dstData, m_dst->colorSpace(), TILE_SIZE * TILE_SIZE,
KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::BlackpointCompensation);
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
m_dst->writeBytes(m_dstData, tx * TILE_SIZE, ty * TILE_SIZE, TILE_SIZE, TILE_SIZE);
m_painter->addDirtyRect(QRect(tx * TILE_SIZE, ty * TILE_SIZE, TILE_SIZE, TILE_SIZE));
}
......
......@@ -88,7 +88,7 @@ bool MyPaintSurface::draw_dab (float x, float y,
//uint16_t * rgba_p = get_tile_memory(tx, ty, false);
m_dst->readBytes(m_dstData, tx * TILE_SIZE, ty * TILE_SIZE, TILE_SIZE, TILE_SIZE);
m_dst->colorSpace()->convertPixelsTo(m_dstData, m_dstRgb16Data, m_rgb16, TILE_SIZE * TILE_SIZE, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
m_dst->colorSpace()->convertPixelsTo(m_dstData, m_dstRgb16Data, m_rgb16, TILE_SIZE * TILE_SIZE, KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
quint16* rgba_p = reinterpret_cast<quint16*>(m_dstRgb16Data);
......@@ -156,7 +156,7 @@ bool MyPaintSurface::draw_dab (float x, float y,
}
}
}
m_rgb16->convertPixelsTo(m_dstRgb16Data, m_dstData, m_dst->colorSpace(), TILE_SIZE * TILE_SIZE, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
m_rgb16->convertPixelsTo(m_dstRgb16Data, m_dstData, m_dst->colorSpace(), TILE_SIZE * TILE_SIZE, KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
m_dst->writeBytes(m_dstData, tx * TILE_SIZE, ty * TILE_SIZE, TILE_SIZE, TILE_SIZE);
m_painter->addDirtyRect(QRect(tx * TILE_SIZE, ty * TILE_SIZE, TILE_SIZE, TILE_SIZE));
}
......@@ -210,7 +210,7 @@ void MyPaintSurface::get_color (float x, float y,
//uint16_t * rgba_p = get_tile_memory(tx, ty, true);
//qDebug() << "tx" << tx << "tx * TILE_SIZE" << tx * TILE_SIZE << "ty" << ty << "ty * TILE_SIZE" << ty * TILE_SIZE;
m_src->readBytes(m_srcData, tx * TILE_SIZE, ty * TILE_SIZE, TILE_SIZE, TILE_SIZE);
m_src->colorSpace()->convertPixelsTo(m_srcData, m_dstRgb16Data, m_rgb16, TILE_SIZE * TILE_SIZE, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
m_src->colorSpace()->convertPixelsTo(m_srcData, m_dstRgb16Data, m_rgb16, TILE_SIZE * TILE_SIZE, KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
quint16* rgba_p = reinterpret_cast<quint16*>(m_dstRgb16Data);
float xc = x - tx*TILE_SIZE;
......
......@@ -1969,11 +1969,14 @@ void KisToolTransform::initThumbnailImage(KisPaintDeviceSP previewDevice)
createThumbnail(thumbRect.width(),
thumbRect.height(),
srcRect,
KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
m_thumbToImageTransform = scaleTransform.inverted();
} else {
m_origImg = m_selectedPortionCache->convertToQImage(0, x, y, w, h, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
m_origImg = m_selectedPortionCache->convertToQImage(0, x, y, w, h,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
m_thumbToImageTransform = QTransform();
}
......
......@@ -57,7 +57,7 @@ QImage generatePreview(const KisFilter* filter, KisPaintDeviceSP thumb, KisFilte
{
KisPaintDeviceSP target = new KisPaintDevice(*thumb);
filter->process(target, QRect(0, 0, 100, 100), config);
return target->convertToQImage(0, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
return target->convertToQImage(0, KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
}
QVariant KisBookmarkedFilterConfigurationsModel::data(const QModelIndex &index, int role) const
......
......@@ -147,7 +147,7 @@ void KisClipboard::setClip(KisPaintDeviceSP dev, const QPoint& topLeft)
QImage qimage;
KisConfig cfg;
const KoColorProfile *monitorProfile = cfg.displayProfile();
qimage = dev->convertToQImage(monitorProfile, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
qimage = dev->convertToQImage(monitorProfile, KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
if (!qimage.isNull() && mimeData) {
mimeData->setImageData(qimage);
}
......
......@@ -170,7 +170,9 @@ void KisCustomPattern::createPattern()
}
QString dir = KisResourceServerProvider::instance()->patternServer()->saveLocation();
m_pattern = new KisPattern(dev->createThumbnail(size.width(), size.height(), rc, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation), name, dir);
m_pattern = new KisPattern(dev->createThumbnail(size.width(), size.height(), rc,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags), name, dir);
}
......
......@@ -172,7 +172,9 @@ QImage generatePreview(const KisFilter* filter, KisPaintDeviceSP thumb)
{
KisPaintDeviceSP target = new KisPaintDevice(*thumb);
filter->process(target, QRect(0, 0, 100, 100), filter->defaultConfiguration(thumb));
return target->convertToQImage(0, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
return target->convertToQImage(0,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
}
QVariant KisFiltersModel::data(const QModelIndex &index, int role) const
......
......@@ -69,7 +69,9 @@ QVariant KisMimeData::retrieveData(const QString &mimetype, QVariant::Type prefe
Q_ASSERT(m_node);
if (mimetype == "application/x-qt-image") {
KisConfig cfg;
return m_node->projection()->convertToQImage(cfg.displayProfile(), KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
return m_node->projection()->convertToQImage(cfg.displayProfile(),
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
}
else if (mimetype == "application/x-krita-node"
|| mimetype == "application/zip") {
......
......@@ -546,7 +546,7 @@ KisImageBuilder_Result KisPNGConverter::buildImage(QIODevice* iod)
// Create the cmsTransform if needed
KoColorTransformation* transform = 0;
if (profile && !profile->isSuitableForOutput()) {
transform = KoColorSpaceRegistry::instance()->colorSpace(csName.first, csName.second, profile)->createColorConverter(cs, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
transform = KoColorSpaceRegistry::instance()->colorSpace(csName.first, csName.second, profile)->createColorConverter(cs, KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
}
// Creating the KisImageWSP
......
......@@ -177,7 +177,9 @@ void KisPrescaledProjectionTest::testScalingUndeferredSmoothingPixelForPixel()
converter.setImage(image);
projection.setCoordinatesConverter(&converter);
projection.setMonitorProfile(0, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::Empty);
projection.setMonitorProfile(0,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
projection.setImage(image);
// pixel-for-pixel, at 100% zoom
......@@ -210,7 +212,9 @@ void KisPrescaledProjectionTest::testScalingUndeferredSmoothing()
converter.setImage(image);
projection.setCoordinatesConverter(&converter);
projection.setMonitorProfile(0, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::Empty);
projection.setMonitorProfile(0,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
projection.setImage(image);
testProjectionScenario(projection, &converter, "120dpi");
......@@ -240,7 +244,9 @@ void KisPrescaledProjectionTest::benchmarkUpdate()
KisCoordinatesConverter converter;
converter.setImage(image);
projection.setCoordinatesConverter(&converter);
projection.setMonitorProfile(0, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::Empty);
projection.setMonitorProfile(0,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
projection.setImage(image);
// Emulate "Use same aspect as pixels"
......@@ -295,7 +301,9 @@ public:
converter.setDocumentOffset(QPoint(100,100));
projection.setCoordinatesConverter(&converter);
projection.setMonitorProfile(0, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::Empty);
projection.setMonitorProfile(0,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
projection.setImage(image);
projection.notifyCanvasSizeChanged(QSize(100,100));
projection.notifyZoomChanged();
......
......@@ -295,8 +295,8 @@ void KisScratchPad::paintEvent ( QPaintEvent * event ) {
alignedImageRect.y(),
alignedImageRect.width(),
alignedImageRect.height(),
KoColorConversionTransformation::IntentPerceptual,
KoColorConversionTransformation::BlackpointCompensation);
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags);
QPainter gc(this);
gc.fillRect(event->rect(), m_checkBrush);
......@@ -355,7 +355,7 @@ QImage KisScratchPad::cutoutOverlay() const
KisPaintDeviceSP paintDevice = m_paintLayer->paintDevice();
QRect rc = widgetToDocument().mapRect(m_cutoutOverlay);
QImage rawImage = paintDevice->convertToQImage(0, rc.x(), rc.y(), rc.width(), rc.height(), KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
QImage rawImage = paintDevice->convertToQImage(0, rc.x(), rc.y(), rc.width(), rc.height(), KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
QImage scaledImage = rawImage.scaled(m_cutoutOverlay.size(),
Qt::IgnoreAspectRatio,
......
......@@ -102,7 +102,7 @@ KoColor::KoColor(const KoColor &src, const KoColorSpace * colorSpace)
d->data = new quint8[colorSpace->pixelSize()];
memset(d->data, 0, d->colorSpace->pixelSize());
src.colorSpace()->convertPixelsTo(src.d->data, d->data, colorSpace, 1, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
src.colorSpace()->convertPixelsTo(src.d->data, d->data, colorSpace, 1, KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
}
KoColor::KoColor(const KoColor & rhs)
......@@ -150,7 +150,7 @@ void KoColor::convertTo(const KoColorSpace * cs)
quint8 * data = new quint8[cs->pixelSize()];
memset(data, 0, cs->pixelSize());
d->colorSpace->convertPixelsTo(d->data, data, cs, 1, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
d->colorSpace->convertPixelsTo(d->data, data, cs, 1, KoColorConversionTransformation::InternalRenderingIntent, KoColorConversionTransformation::InternalConversionFlags);
delete [] d->data;
d->data = data;
......@@ -222,7 +222,7 @@ void KoColor::dump() const
void KoColor::fromKoColor(const KoColor& src)
{
src.colorSpace()->convertPixelsTo(src.d->data, d->data, colorSpace(), 1, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation);
src.colorSpace()