80 if (!brush->canPaintFor(info))
100 if (!externalSourceNode || !externalSourceNode->
graphListener()) {
101 externalSourceNode =
m_node;
104 realSourceDevice = externalSourceNode->
projection();
118 static KoColor color(Qt::black, cs);
136 QPointF hotSpot = brush->hotSpot(shape, info);
140 qint32 sw = dstRect.width();
141 qint32 sh = dstRect.height();
185 copyPainter.
bitBltOldData(0, 0, realSourceDevice, srcPoint.x(), srcPoint.y(), sw, sh);
191 QRect healRect(dstRect);
193 const bool smallWidth = healRect.width() < 3;
194 const bool smallHeight = healRect.height() < 3;
196 if (smallWidth || smallHeight) {
197 healRect.adjust(-1, -1, 1, 1);
200 const int healSW = healRect.width();
201 const int healSH = healRect.height();
206 QScopedArrayPointer<qreal> matrix(
new qreal[ 3 * healSW * healSH ]);
212 qreal* matrixIt = matrix.
data();
213 for (
int j = 0; j < healSH; j++) {
214 for (
int i = 0; i < healSW; i++) {
216 tmpCs->
toLabA16(tmpIt->rawData(), (quint8*)tmpData, 1);
218 for (
int k = 0; k < 3; k++) {
219 matrixIt[k] = srcData[k] / (qreal)qMax((
int)tmpData [k], 1);
232 QScopedArrayPointer<qreal> solution(
new qreal[ 3 * healSW * healSH ]);
237 solution.swap(matrix);
240 }
while (err > 0.00001 && iter < 100);
245 matrixIt = &matrix[0];
246 for (
int j = 0; j < healSH; j++) {
247 for (
int i = 0; i < healSW; i++) {
248 tmpCs->
toLabA16(tmpIt2->rawData(), (quint8*)tmpData, 1);
250 for (
int k = 0; k < 3; k++) {
251 tmpData[k] = (int)
CLAMP(matrixIt[k] * qMax((
int) tmpData[k], 1), 0, 65535);
253 tmpCs->
fromLabA16((quint8*)tmpData, tmpIt2->rawData(), 1);
KisFixedPaintDeviceSP fetchDab(const KoColorSpace *cs, KisColorSource *colorSource, const QPointF &cursorPoint, KisDabShape const &, const KisPaintInformation &info, qreal softnessFactor, QRect *dstDabRect, qreal lightnessStrength=1.0)
void bitBltOldData(qint32 dstX, qint32 dstY, const KisPaintDeviceSP srcDev, qint32 srcX, qint32 srcY, qint32 srcWidth, qint32 srcHeight)
void bitBltWithFixedSelection(qint32 dstX, qint32 dstY, const KisPaintDeviceSP srcDev, const KisFixedPaintDeviceSP selection, qint32 selX, qint32 selY, qint32 srcX, qint32 srcY, qint32 srcWidth, qint32 srcHeight)