Commit 2026c940 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Merge branch 'krita-testing-kazakov'

parents ff87689d 25572c41
......@@ -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;
......
......@@ -96,7 +96,6 @@ class KisImage::KisImagePrivate
public:
KisBackgroundSP backgroundPattern;
quint32 lockCount;
bool sizeChangedWhileLocked;
KisPerspectiveGrid* perspectiveGrid;
qint32 width;
......@@ -291,7 +290,6 @@ void KisImage::init(KisUndoStore *undoStore, qint32 width, qint32 height, const
}
m_d->lockCount = 0;
m_d->sizeChangedWhileLocked = false;
m_d->perspectiveGrid = 0;
m_d->signalRouter = new KisImageSignalRouter(this);
......@@ -345,7 +343,6 @@ void KisImage::barrierLock()
if (m_d->scheduler) {
m_d->scheduler->barrierLock();
}
m_d->sizeChangedWhileLocked = false;
}
m_d->lockCount++;
}
......@@ -358,10 +355,6 @@ bool KisImage::tryBarrierLock()
if (m_d->scheduler) {
result = m_d->scheduler->tryBarrierLock();
}
if (result) {
m_d->sizeChangedWhileLocked = false;
}
}
if (result) {
......@@ -379,7 +372,6 @@ void KisImage::lock()
if (m_d->scheduler) {
m_d->scheduler->lock();
}
m_d->sizeChangedWhileLocked = false;
}
m_d->lockCount++;
}
......@@ -392,10 +384,6 @@ void KisImage::unlock()
m_d->lockCount--;
if (m_d->lockCount == 0) {
if (m_d->sizeChangedWhileLocked) {
m_d->signalRouter->emitNotification(SizeChangedSignal);
}
if (m_d->scheduler) {
m_d->scheduler->unlock();
}
......@@ -429,7 +417,6 @@ void KisImage::setSize(const QSize& size)
{
m_d->width = size.width();
m_d->height = size.height();
emitSizeChanged();
}
void KisImage::resizeImageImpl(const QRect& newRect, bool cropLayers)
......@@ -439,7 +426,8 @@ void KisImage::resizeImageImpl(const QRect& newRect, bool cropLayers)
QString actionName = cropLayers ? i18n("Crop Image") : i18n("Resize Image");
KisImageSignalVector emitSignals;
emitSignals << SizeChangedSignal << ModifiedSignal;
emitSignals << ComplexSizeChangedSignal(newRect, newRect.size());
emitSignals << ModifiedSignal;
KisProcessingApplicator applicator(this, m_d->rootLayer,
KisProcessingApplicator::RECURSIVE |
......@@ -483,15 +471,6 @@ void KisImage::cropNode(KisNodeSP node, const QRect& newRect)
applicator.end();
}
void KisImage::emitSizeChanged()
{
if (!locked()) {
m_d->signalRouter->emitNotification(SizeChangedSignal);
} else {
m_d->sizeChangedWhileLocked = true;
}
}
void KisImage::scaleImage(const QSize &size, qreal xres, qreal yres, KisFilterStrategy *filterStrategy)
{
bool resolutionChanged = xres != xRes() && yres != yRes();
......@@ -501,11 +480,10 @@ void KisImage::scaleImage(const QSize &size, qreal xres, qreal yres, KisFilterSt
KisImageSignalVector emitSignals;
if (resolutionChanged) emitSignals << ResolutionChangedSignal;
if (sizeChanged) emitSignals << SizeChangedSignal;
if (sizeChanged) emitSignals << ComplexSizeChangedSignal(bounds(), size);
emitSignals << ModifiedSignal;
// XXX: Translate after 2.4 is released
QString actionName = sizeChanged ? "Scale Image" : "Change Image Resolution";
QString actionName = sizeChanged ? i18n("Scale Image") : i18n("Change Image Resolution");
KisProcessingApplicator::ProcessingFlags signalFlags =
(resolutionChanged || sizeChanged) ?
......@@ -584,7 +562,7 @@ void KisImage::rotateImpl(const QString &actionName,
// These signals will be emitted after processing is done
KisImageSignalVector emitSignals;
if (sizeChanged) emitSignals << SizeChangedSignal;
if (sizeChanged) emitSignals << ComplexSizeChangedSignal(bounds(), newSize);
emitSignals << ModifiedSignal;
// These flags determine whether updates are transferred to the UI during processing
......@@ -658,7 +636,7 @@ void KisImage::shearImpl(const QString &actionName,
if (newSize == size()) return;
KisImageSignalVector emitSignals;
if (resizeImage) emitSignals << SizeChangedSignal;
if (resizeImage) emitSignals << ComplexSizeChangedSignal(bounds(), newSize);
emitSignals << ModifiedSignal;
KisProcessingApplicator::ProcessingFlags signalFlags =
......@@ -1093,7 +1071,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 +1154,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));
......
......@@ -529,7 +529,24 @@ signals:
*/
void sigImageModified();
void sigSizeChanged(qint32 w, qint32 h);
/**
* The signal is emitted when the size of the image is changed.
* \p oldStillPoint and \p newStillPoint give the reciever the
* hint about how the new and old rect of the image correspond to
* each other. They specify the point of the image around which
* the conversion was done. This point will stay still on the
* user's screen. That is the \p newStillPoint of the new image
* will be painted at the same screen position, where \p
* oldStillPoint of the old image was painted.
*
* \param oldStillPoint is a still point represented in *old*
* image coordinates
*
* \param newStillPoint is a still point represented in *new*
* image coordinates
*/
void sigSizeChanged(const QPointF &oldStillPoint, const QPointF &newStillPoint);
void sigProfileChanged(const KoColorProfile * profile);
void sigColorSpaceChanged(const KoColorSpace* cs);
void sigResolutionChanged(double xRes, double yRes);
......
......@@ -41,7 +41,7 @@ KisImageSignalRouter::KisImageSignalRouter(KisImageWSP image)
SLOT(slotNotification(KisImageSignalType)));
CONNECT_TO_IMAGE(sigImageModified());
CONNECT_TO_IMAGE(sigSizeChanged(qint32, qint32));
CONNECT_TO_IMAGE(sigSizeChanged(const QPointF&, const QPointF&));
CONNECT_TO_IMAGE(sigProfileChanged(const KoColorProfile*));
CONNECT_TO_IMAGE(sigColorSpaceChanged(const KoColorSpace*));
CONNECT_TO_IMAGE(sigResolutionChanged(double, double));
......@@ -86,7 +86,7 @@ void KisImageSignalRouter::emitAboutToRemoveANode(KisNode *parent, int index)
void KisImageSignalRouter::slotNotification(KisImageSignalType type)
{
switch(type) {
switch(type.id) {
case LayersChangedSignal:
emit sigLayersChangedAsync();
break;
......@@ -94,7 +94,8 @@ void KisImageSignalRouter::slotNotification(KisImageSignalType type)
emit sigImageModified();
break;
case SizeChangedSignal:
emit sigSizeChanged(m_image->width(), m_image->height());
emit sigSizeChanged(type.sizeChangedSignal.oldStillPoint,
type.sizeChangedSignal.newStillPoint);
break;
case ProfileChangedSignal:
emit sigProfileChanged(m_image->profile());
......
......@@ -29,7 +29,7 @@
class KoColorSpace;
class KoColorProfile;
enum KisImageSignalType {
enum KisImageSignalTypeEnum {
LayersChangedSignal,
ModifiedSignal,
SizeChangedSignal,
......@@ -38,6 +38,65 @@ enum KisImageSignalType {
ResolutionChangedSignal
};
/**
* A special signal which handles stillPoint capabilities of the image
*
* \see KisImage::sigSizeChanged()
*/
struct ComplexSizeChangedSignal {
ComplexSizeChangedSignal() {}
ComplexSizeChangedSignal(QPointF _oldStillPoint, QPointF _newStillPoint)
: oldStillPoint(_oldStillPoint),
newStillPoint(_newStillPoint)
{
}
/**
* A helper method calculating the still points from image areas
* we process. It works as if the source image was "cropped" by \p
* portionOfOldImage, and this portion formed the new image of size
* \p transformedIntoImageOfSize.
*
* Note, that \p portionOfTheImage may be equal to the image bounds().
*/
ComplexSizeChangedSignal(const QRect &portionOfOldImage, const QSize &transformedIntoImageOfSize)
{
oldStillPoint = QRectF(portionOfOldImage).center();
newStillPoint = QRectF(QPointF(), QSizeF(transformedIntoImageOfSize)).center();
}
ComplexSizeChangedSignal inverted() const {
return ComplexSizeChangedSignal(newStillPoint, oldStillPoint);
}
QPointF oldStillPoint;
QPointF newStillPoint;
};
struct KisImageSignalType {
KisImageSignalType() {}
KisImageSignalType(KisImageSignalTypeEnum _id)
: id(_id)
{
}
KisImageSignalType(ComplexSizeChangedSignal signal)
: id(SizeChangedSignal),
sizeChangedSignal(signal)
{
}
KisImageSignalType inverted() const {
KisImageSignalType t;
t.id = id;
t.sizeChangedSignal = sizeChangedSignal.inverted();
return t;
}
KisImageSignalTypeEnum id;
ComplexSizeChangedSignal sizeChangedSignal;
};
typedef QVector<KisImageSignalType> KisImageSignalVector;
class KRITAIMAGE_EXPORT KisImageSignalRouter : public QObject
......@@ -65,7 +124,7 @@ signals:
// Notifications
void sigImageModified();
void sigSizeChanged(qint32 w, qint32 h);
void sigSizeChanged(const QPointF &oldStillPoint, const QPointF &newStillPoint);
void sigProfileChanged(const KoColorProfile * profile);
void sigColorSpaceChanged(const KoColorSpace* cs);
void sigResolutionChanged(double xRes, double yRes);
......
......@@ -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);
}
/**/
......
......@@ -155,7 +155,7 @@ public:
KisImageSignalVector::iterator i = m_emitSignals.end();
while (i != m_emitSignals.begin()) {
--i;
reverseSignals.append(*i);
reverseSignals.append(i->inverted());
}
doUpdate(reverseSignals);
......
......@@ -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());
}
......
......@@ -55,7 +55,8 @@ void KisImageSignalRouterTest::testSignalForwarding()
{
checkNotification(LayersChangedSignal, SIGNAL(sigLayersChangedAsync()));
checkNotification(ModifiedSignal, SIGNAL(sigImageModified()));
checkNotification(SizeChangedSignal, SIGNAL(sigSizeChanged(qint32, qint32)));
checkNotification(SizeChangedSignal, SIGNAL(sigSizeChanged(const QPointF&, const QPointF&)));
checkNotification(ComplexSizeChangedSignal(), SIGNAL(sigSizeChanged(const QPointF&, const QPointF&)));
checkNotification(ProfileChangedSignal, SIGNAL(sigProfileChanged(const KoColorProfile*)));
checkNotification(ColorSpaceChangedSignal, SIGNAL(sigColorSpaceChanged(const KoColorSpace*)));
checkNotification(ResolutionChangedSignal, SIGNAL(sigResolutionChanged(double, double)));
......
......@@ -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());
......