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

Merge branch 'krita-testing-kazakov'

parents ff87689d 25572c41
...@@ -110,8 +110,8 @@ private: ...@@ -110,8 +110,8 @@ private:
Traits::template sampleData<useOldData>(m_accessor, m_data, m_srcCS); Traits::template sampleData<useOldData>(m_accessor, m_data, m_srcCS);
m_srcCS->convertPixelsTo(m_data, dst, m_dstCS, 1, m_srcCS->convertPixelsTo(m_data, dst, m_dstCS, 1,
KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::BlackpointCompensation); KoColorConversionTransformation::InternalConversionFlags);
} }
private: private:
......
...@@ -127,7 +127,9 @@ void KisFixedPaintDevice::convertFromQImage(const QImage& _image, const QString ...@@ -127,7 +127,9 @@ void KisFixedPaintDevice::convertFromQImage(const QImage& _image, const QString
} else { } else {
KoColorSpaceRegistry::instance() KoColorSpaceRegistry::instance()
->colorSpace( RGBAColorModelID.id(), Integer8BitsColorDepthID.id(), srcProfileName) ->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: ...@@ -113,8 +113,8 @@ public:
* Converts the paint device to a different colorspace * Converts the paint device to a different colorspace
*/ */
void convertTo(const KoColorSpace * dstColorSpace = 0, void convertTo(const KoColorSpace * dstColorSpace = 0,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty); KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags);
/** /**
* Fill this paint device with the data from image * Fill this paint device with the data from image
* *
...@@ -134,8 +134,8 @@ public: ...@@ -134,8 +134,8 @@ public:
* like sRGB). * like sRGB).
*/ */
virtual QImage convertToQImage(const KoColorProfile *dstProfile, qint32 x, qint32 y, qint32 w, qint32 h, virtual QImage convertToQImage(const KoColorProfile *dstProfile, qint32 x, qint32 y, qint32 w, qint32 h,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty) const; KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags) const;
/** /**
* Create an RGBA QImage from a rectangle in the paint device. The * Create an RGBA QImage from a rectangle in the paint device. The
...@@ -146,8 +146,8 @@ public: ...@@ -146,8 +146,8 @@ public:
* like sRGB). * like sRGB).
*/ */
virtual QImage convertToQImage(const KoColorProfile *dstProfile, virtual QImage convertToQImage(const KoColorProfile *dstProfile,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty) const; KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags) const;
/** /**
* Clear the given rectangle to transparent black. * Clear the given rectangle to transparent black.
......
...@@ -152,7 +152,9 @@ void KisGroupLayer::resetCache(const KoColorSpace *colorSpace) ...@@ -152,7 +152,9 @@ void KisGroupLayer::resetCache(const KoColorSpace *colorSpace)
dev->setX(m_d->x); dev->setX(m_d->x);
dev->setY(m_d->y); dev->setY(m_d->y);
quint8* defaultPixel = colorSpace->allocPixelBuffer(1); 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); dev->setDefaultPixel(defaultPixel);
delete[] defaultPixel; delete[] defaultPixel;
m_d->paintDevice = dev; m_d->paintDevice = dev;
......
...@@ -96,7 +96,6 @@ class KisImage::KisImagePrivate ...@@ -96,7 +96,6 @@ class KisImage::KisImagePrivate
public: public:
KisBackgroundSP backgroundPattern; KisBackgroundSP backgroundPattern;
quint32 lockCount; quint32 lockCount;
bool sizeChangedWhileLocked;
KisPerspectiveGrid* perspectiveGrid; KisPerspectiveGrid* perspectiveGrid;
qint32 width; qint32 width;
...@@ -291,7 +290,6 @@ void KisImage::init(KisUndoStore *undoStore, qint32 width, qint32 height, const ...@@ -291,7 +290,6 @@ void KisImage::init(KisUndoStore *undoStore, qint32 width, qint32 height, const
} }
m_d->lockCount = 0; m_d->lockCount = 0;
m_d->sizeChangedWhileLocked = false;
m_d->perspectiveGrid = 0; m_d->perspectiveGrid = 0;
m_d->signalRouter = new KisImageSignalRouter(this); m_d->signalRouter = new KisImageSignalRouter(this);
...@@ -345,7 +343,6 @@ void KisImage::barrierLock() ...@@ -345,7 +343,6 @@ void KisImage::barrierLock()
if (m_d->scheduler) { if (m_d->scheduler) {
m_d->scheduler->barrierLock(); m_d->scheduler->barrierLock();
} }
m_d->sizeChangedWhileLocked = false;
} }
m_d->lockCount++; m_d->lockCount++;
} }
...@@ -358,10 +355,6 @@ bool KisImage::tryBarrierLock() ...@@ -358,10 +355,6 @@ bool KisImage::tryBarrierLock()
if (m_d->scheduler) { if (m_d->scheduler) {
result = m_d->scheduler->tryBarrierLock(); result = m_d->scheduler->tryBarrierLock();
} }
if (result) {
m_d->sizeChangedWhileLocked = false;
}
} }
if (result) { if (result) {
...@@ -379,7 +372,6 @@ void KisImage::lock() ...@@ -379,7 +372,6 @@ void KisImage::lock()
if (m_d->scheduler) { if (m_d->scheduler) {
m_d->scheduler->lock(); m_d->scheduler->lock();
} }
m_d->sizeChangedWhileLocked = false;
} }
m_d->lockCount++; m_d->lockCount++;
} }
...@@ -392,10 +384,6 @@ void KisImage::unlock() ...@@ -392,10 +384,6 @@ void KisImage::unlock()
m_d->lockCount--; m_d->lockCount--;
if (m_d->lockCount == 0) { if (m_d->lockCount == 0) {
if (m_d->sizeChangedWhileLocked) {
m_d->signalRouter->emitNotification(SizeChangedSignal);
}
if (m_d->scheduler) { if (m_d->scheduler) {
m_d->scheduler->unlock(); m_d->scheduler->unlock();
} }
...@@ -429,7 +417,6 @@ void KisImage::setSize(const QSize& size) ...@@ -429,7 +417,6 @@ void KisImage::setSize(const QSize& size)
{ {
m_d->width = size.width(); m_d->width = size.width();
m_d->height = size.height(); m_d->height = size.height();
emitSizeChanged();
} }
void KisImage::resizeImageImpl(const QRect& newRect, bool cropLayers) void KisImage::resizeImageImpl(const QRect& newRect, bool cropLayers)
...@@ -439,7 +426,8 @@ 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"); QString actionName = cropLayers ? i18n("Crop Image") : i18n("Resize Image");
KisImageSignalVector emitSignals; KisImageSignalVector emitSignals;
emitSignals << SizeChangedSignal << ModifiedSignal; emitSignals << ComplexSizeChangedSignal(newRect, newRect.size());
emitSignals << ModifiedSignal;
KisProcessingApplicator applicator(this, m_d->rootLayer, KisProcessingApplicator applicator(this, m_d->rootLayer,
KisProcessingApplicator::RECURSIVE | KisProcessingApplicator::RECURSIVE |
...@@ -483,15 +471,6 @@ void KisImage::cropNode(KisNodeSP node, const QRect& newRect) ...@@ -483,15 +471,6 @@ void KisImage::cropNode(KisNodeSP node, const QRect& newRect)
applicator.end(); 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) void KisImage::scaleImage(const QSize &size, qreal xres, qreal yres, KisFilterStrategy *filterStrategy)
{ {
bool resolutionChanged = xres != xRes() && yres != yRes(); bool resolutionChanged = xres != xRes() && yres != yRes();
...@@ -501,11 +480,10 @@ void KisImage::scaleImage(const QSize &size, qreal xres, qreal yres, KisFilterSt ...@@ -501,11 +480,10 @@ void KisImage::scaleImage(const QSize &size, qreal xres, qreal yres, KisFilterSt
KisImageSignalVector emitSignals; KisImageSignalVector emitSignals;
if (resolutionChanged) emitSignals << ResolutionChangedSignal; if (resolutionChanged) emitSignals << ResolutionChangedSignal;
if (sizeChanged) emitSignals << SizeChangedSignal; if (sizeChanged) emitSignals << ComplexSizeChangedSignal(bounds(), size);
emitSignals << ModifiedSignal; emitSignals << ModifiedSignal;
// XXX: Translate after 2.4 is released QString actionName = sizeChanged ? i18n("Scale Image") : i18n("Change Image Resolution");
QString actionName = sizeChanged ? "Scale Image" : "Change Image Resolution";
KisProcessingApplicator::ProcessingFlags signalFlags = KisProcessingApplicator::ProcessingFlags signalFlags =
(resolutionChanged || sizeChanged) ? (resolutionChanged || sizeChanged) ?
...@@ -584,7 +562,7 @@ void KisImage::rotateImpl(const QString &actionName, ...@@ -584,7 +562,7 @@ void KisImage::rotateImpl(const QString &actionName,
// These signals will be emitted after processing is done // These signals will be emitted after processing is done
KisImageSignalVector emitSignals; KisImageSignalVector emitSignals;
if (sizeChanged) emitSignals << SizeChangedSignal; if (sizeChanged) emitSignals << ComplexSizeChangedSignal(bounds(), newSize);
emitSignals << ModifiedSignal; emitSignals << ModifiedSignal;
// These flags determine whether updates are transferred to the UI during processing // These flags determine whether updates are transferred to the UI during processing
...@@ -658,7 +636,7 @@ void KisImage::shearImpl(const QString &actionName, ...@@ -658,7 +636,7 @@ void KisImage::shearImpl(const QString &actionName,
if (newSize == size()) return; if (newSize == size()) return;
KisImageSignalVector emitSignals; KisImageSignalVector emitSignals;
if (resizeImage) emitSignals << SizeChangedSignal; if (resizeImage) emitSignals << ComplexSizeChangedSignal(bounds(), newSize);
emitSignals << ModifiedSignal; emitSignals << ModifiedSignal;
KisProcessingApplicator::ProcessingFlags signalFlags = KisProcessingApplicator::ProcessingFlags signalFlags =
...@@ -1093,7 +1071,9 @@ QImage KisImage::convertToQImage(qint32 x, ...@@ -1093,7 +1071,9 @@ QImage KisImage::convertToQImage(qint32 x,
{ {
KisPaintDeviceSP dev = m_d->rootLayer->projection(); KisPaintDeviceSP dev = m_d->rootLayer->projection();
if (!dev) return QImage(); 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) { if (m_d->backgroundPattern) {
m_d->backgroundPattern->paintBackground(image, QRect(x, y, w, h)); m_d->backgroundPattern->paintBackground(image, QRect(x, y, w, h));
...@@ -1174,7 +1154,9 @@ QImage KisImage::convertToQImage(const QRect& scaledRect, const QSize& scaledIma ...@@ -1174,7 +1154,9 @@ QImage KisImage::convertToQImage(const QRect& scaledRect, const QSize& scaledIma
} }
delete [] imageRow; 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) { if (m_d->backgroundPattern) {
m_d->backgroundPattern->paintBackground(image, scaledRect, scaledImageSize, QSize(imageWidth, imageHeight)); m_d->backgroundPattern->paintBackground(image, scaledRect, scaledImageSize, QSize(imageWidth, imageHeight));
......
...@@ -529,7 +529,24 @@ signals: ...@@ -529,7 +529,24 @@ signals:
*/ */
void sigImageModified(); 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 sigProfileChanged(const KoColorProfile * profile);
void sigColorSpaceChanged(const KoColorSpace* cs); void sigColorSpaceChanged(const KoColorSpace* cs);
void sigResolutionChanged(double xRes, double yRes); void sigResolutionChanged(double xRes, double yRes);
......
...@@ -41,7 +41,7 @@ KisImageSignalRouter::KisImageSignalRouter(KisImageWSP image) ...@@ -41,7 +41,7 @@ KisImageSignalRouter::KisImageSignalRouter(KisImageWSP image)
SLOT(slotNotification(KisImageSignalType))); SLOT(slotNotification(KisImageSignalType)));
CONNECT_TO_IMAGE(sigImageModified()); 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(sigProfileChanged(const KoColorProfile*));
CONNECT_TO_IMAGE(sigColorSpaceChanged(const KoColorSpace*)); CONNECT_TO_IMAGE(sigColorSpaceChanged(const KoColorSpace*));
CONNECT_TO_IMAGE(sigResolutionChanged(double, double)); CONNECT_TO_IMAGE(sigResolutionChanged(double, double));
...@@ -86,7 +86,7 @@ void KisImageSignalRouter::emitAboutToRemoveANode(KisNode *parent, int index) ...@@ -86,7 +86,7 @@ void KisImageSignalRouter::emitAboutToRemoveANode(KisNode *parent, int index)
void KisImageSignalRouter::slotNotification(KisImageSignalType type) void KisImageSignalRouter::slotNotification(KisImageSignalType type)
{ {
switch(type) { switch(type.id) {
case LayersChangedSignal: case LayersChangedSignal:
emit sigLayersChangedAsync(); emit sigLayersChangedAsync();
break; break;
...@@ -94,7 +94,8 @@ void KisImageSignalRouter::slotNotification(KisImageSignalType type) ...@@ -94,7 +94,8 @@ void KisImageSignalRouter::slotNotification(KisImageSignalType type)
emit sigImageModified(); emit sigImageModified();
break; break;
case SizeChangedSignal: case SizeChangedSignal:
emit sigSizeChanged(m_image->width(), m_image->height()); emit sigSizeChanged(type.sizeChangedSignal.oldStillPoint,
type.sizeChangedSignal.newStillPoint);
break; break;
case ProfileChangedSignal: case ProfileChangedSignal:
emit sigProfileChanged(m_image->profile()); emit sigProfileChanged(m_image->profile());
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
class KoColorSpace; class KoColorSpace;
class KoColorProfile; class KoColorProfile;
enum KisImageSignalType { enum KisImageSignalTypeEnum {
LayersChangedSignal, LayersChangedSignal,
ModifiedSignal, ModifiedSignal,
SizeChangedSignal, SizeChangedSignal,
...@@ -38,6 +38,65 @@ enum KisImageSignalType { ...@@ -38,6 +38,65 @@ enum KisImageSignalType {
ResolutionChangedSignal 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; typedef QVector<KisImageSignalType> KisImageSignalVector;
class KRITAIMAGE_EXPORT KisImageSignalRouter : public QObject class KRITAIMAGE_EXPORT KisImageSignalRouter : public QObject
...@@ -65,7 +124,7 @@ signals: ...@@ -65,7 +124,7 @@ signals:
// Notifications // Notifications
void sigImageModified(); void sigImageModified();
void sigSizeChanged(qint32 w, qint32 h); void sigSizeChanged(const QPointF &oldStillPoint, const QPointF &newStillPoint);
void sigProfileChanged(const KoColorProfile * profile); void sigProfileChanged(const KoColorProfile * profile);
void sigColorSpaceChanged(const KoColorSpace* cs); void sigColorSpaceChanged(const KoColorSpace* cs);
void sigResolutionChanged(double xRes, double yRes); void sigResolutionChanged(double xRes, double yRes);
......
...@@ -519,7 +519,9 @@ QImage KisLayer::createThumbnail(qint32 w, qint32 h) ...@@ -519,7 +519,9 @@ QImage KisLayer::createThumbnail(qint32 w, qint32 h)
KisPaintDeviceSP originalDevice = original(); KisPaintDeviceSP originalDevice = original();
return originalDevice ? return originalDevice ?
originalDevice->createThumbnail(w, h, KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::BlackpointCompensation) : QImage(); originalDevice->createThumbnail(w, h,
KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::InternalConversionFlags) : QImage();
} }
qint32 KisLayer::x() const qint32 KisLayer::x() const
......
...@@ -276,7 +276,9 @@ QImage KisMask::createThumbnail(qint32 w, qint32 h) ...@@ -276,7 +276,9 @@ QImage KisMask::createThumbnail(qint32 w, qint32 h)
selection() ? selection()->projection() : 0; selection() ? selection()->projection() : 0;
return originalDevice ? 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) void KisMask::testingInitSelection(const QRect &rect)
......
...@@ -650,7 +650,9 @@ void KisPaintDevice::convertFromQImage(const QImage& _image, const KoColorProfil ...@@ -650,7 +650,9 @@ void KisPaintDevice::convertFromQImage(const QImage& _image, const KoColorProfil
quint8 * dstData = new quint8[image.width() * image.height() * pixelSize()]; quint8 * dstData = new quint8[image.width() * image.height() * pixelSize()];
KoColorSpaceRegistry::instance() KoColorSpaceRegistry::instance()
->colorSpace(RGBAColorModelID.id(), Integer8BitsColorDepthID.id(), profile) ->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()); writeBytes(dstData, offsetX, offsetY, image.width(), image.height());
delete[] dstData; delete[] dstData;
......
...@@ -409,8 +409,8 @@ public: ...@@ -409,8 +409,8 @@ public:
* @return a command that can be used to undo the conversion. * @return a command that can be used to undo the conversion.
*/ */
KUndo2Command* convertTo(const KoColorSpace * dstColorSpace, KUndo2Command* convertTo(const KoColorSpace * dstColorSpace,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty); KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags);
/** /**
* Changes the profile of the colorspace of this paint device to the given * Changes the profile of the colorspace of this paint device to the given
...@@ -436,8 +436,8 @@ public: ...@@ -436,8 +436,8 @@ public:
* like sRGB). * like sRGB).
*/ */
virtual QImage convertToQImage(const KoColorProfile *dstProfile, qint32 x, qint32 y, qint32 w, qint32 h, virtual QImage convertToQImage(const KoColorProfile *dstProfile, qint32 x, qint32 y, qint32 w, qint32 h,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty) const; KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags) const;
/** /**
* Create an RGBA QImage from a rectangle in the paint device. The * Create an RGBA QImage from a rectangle in the paint device. The
...@@ -448,8 +448,8 @@ public: ...@@ -448,8 +448,8 @@ public:
* like sRGB). * like sRGB).
*/ */
virtual QImage convertToQImage(const KoColorProfile * dstProfile, virtual QImage convertToQImage(const KoColorProfile * dstProfile,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty) const; KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags) const;
/** /**
* Creates a paint device thumbnail of the paint device, retaining * Creates a paint device thumbnail of the paint device, retaining
...@@ -474,15 +474,15 @@ public: ...@@ -474,15 +474,15 @@ public:
* @param rect: only this rect will be used for the thumbnail * @param rect: only this rect will be used for the thumbnail
*/ */
virtual QImage createThumbnail(qint32 maxw, qint32 maxh, QRect rect, virtual QImage createThumbnail(qint32 maxw, qint32 maxh, QRect rect,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty); KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags);
/** /**
* Cached version of createThumbnail(qint32 maxw, qint32 maxh, const KisSelection *selection, QRect rect) * Cached version of createThumbnail(qint32 maxw, qint32 maxh, const KisSelection *selection, QRect rect)
*/ */
virtual QImage createThumbnail(qint32 maxw, qint32 maxh, virtual QImage createThumbnail(qint32 maxw, qint32 maxh,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::IntentPerceptual, KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::Empty); KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags);
/** /**
* Fill c and opacity with the values found at x and y. * Fill c and opacity with the values found at x and y.
......
...@@ -151,8 +151,8 @@ void KisPainter::init() ...@@ -151,8 +151,8 @@ void KisPainter::init()
d->mirrorVerticaly = false; d->mirrorVerticaly = false;
d->paramInfo.opacity = 1.0f; d->paramInfo.opacity = 1.0f;
d->paramInfo.flow = 1.0f; d->paramInfo.flow = 1.0f;
d->renderingIntent = KoColorConversionTransformation::IntentPerceptual; d->renderingIntent = KoColorConversionTransformation::InternalRenderingIntent;
d->conversionFlags = KoColorConversionTransformation::Empty; d->conversionFlags = KoColorConversionTransformation::InternalConversionFlags;