81 if (!brush->canPaintFor(info))
101 if (!externalSourceNode || !externalSourceNode->
graphListener()) {
102 externalSourceNode =
m_node;
105 realSourceDevice = externalSourceNode->
projection();
119 static KoColor color(Qt::black, cs);
137 QPointF hotSpot = brush->hotSpot(shape, info);
141 qint32 sw = dstRect.width();
142 qint32 sh = dstRect.height();
186 copyPainter.
bitBltOldData(0, 0, realSourceDevice, srcPoint.x(), srcPoint.y(), sw, sh);
192 QRect healRect(dstRect);
194 const bool smallWidth = healRect.width() < 3;
195 const bool smallHeight = healRect.height() < 3;
197 if (smallWidth || smallHeight) {
198 healRect.adjust(-1, -1, 1, 1);
201 const int healSW = healRect.width();
202 const int healSH = healRect.height();
207 std::unique_ptr<qreal[]> matrix(
new qreal[ 3 * healSW * healSH ]);
213 qreal* matrixIt = matrix.get();
214 for (
int j = 0; j < healSH; j++) {
215 for (
int i = 0; i < healSW; i++) {
217 tmpCs->
toLabA16(tmpIt->rawData(), (quint8*)tmpData, 1);
219 for (
int k = 0; k < 3; k++) {
220 matrixIt[k] = srcData[k] / (qreal)qMax((
int)tmpData [k], 1);
233 std::unique_ptr<qreal[]> solution(
new qreal[ 3 * healSW * healSH ]);
238 solution.swap(matrix);
241 }
while (err > 0.00001 && iter < 100);
246 matrixIt = &matrix[0];
247 for (
int j = 0; j < healSH; j++) {
248 for (
int i = 0; i < healSW; i++) {
249 tmpCs->
toLabA16(tmpIt2->rawData(), (quint8*)tmpData, 1);
251 for (
int k = 0; k < 3; k++) {
252 tmpData[k] = (int)
CLAMP(matrixIt[k] * qMax((
int) tmpData[k], 1), 0, 65535);
254 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)