134 for (qint32
y = 0;
y < rc.height();
y++) {
135 for (qint32
x = 0;
x < rc.width();
x++) {
137 qreal dstAlpha = cs->
opacityF(layerIt->rawData());
139 qreal newAlpha = sel * dstAlpha / (1.0 - dstAlpha + sel * dstAlpha);
140 float mask = newAlpha / dstAlpha;
144 layerIt->nextPixel();
168 if (!destination)
return;
174 if (!dst || !src)
return;
303 quint8 *data =
new quint8[w * h];
305 ba = QByteArray((
const char*)data, (
int)(w * h));
float value(const T *src, size_t ch)
virtual const quint8 * oldRawData() const =0
virtual bool nextPixel()=0
void process(KisPixelSelectionSP pixelSelection, const QRect &rect) override
QRect changeRect(const QRect &rect, KisDefaultBoundsBaseSP defaultBounds) override
static KisClipboard * instance()
void setClip(KisPaintDeviceSP dev, const QPoint &topLeft)
QRect changeRect(const QRect &rect, KisDefaultBoundsBaseSP defaultBounds) override
void process(KisPixelSelectionSP pixelSelection, const QRect &rect) override
void process(KisPixelSelectionSP pixelSelection, const QRect &rect) override
QRect changeRect(const QRect &rect, KisDefaultBoundsBaseSP defaultBounds) override
QRect changeRect(const QRect &rect, KisDefaultBoundsBaseSP defaultBounds) override
void process(KisPixelSelectionSP pixelSelection, const QRect &rect) override
void process(KisPixelSelectionSP pixelSelection, const QRect &rect) override
QRect changeRect(const QRect &rect, KisDefaultBoundsBaseSP defaultBounds) override
QRect changeRect(const QRect &rect, KisDefaultBoundsBaseSP defaultBounds) override
void process(KisPixelSelectionSP pixelSelection, const QRect &rect) override
KisHLineIteratorSP createHLineIteratorNG(qint32 x, qint32 y, qint32 w)
const KoColorSpace * colorSpace() const
void clearSelection(KisSelectionSP selection)
KisDefaultBoundsBaseSP defaultBounds() const
void readBytes(quint8 *data, qint32 x, qint32 y, qint32 w, qint32 h) const
void writeBytes(const quint8 *data, qint32 x, qint32 y, qint32 w, qint32 h)
static void copyAreaOptimized(const QPoint &dstPt, KisPaintDeviceSP src, KisPaintDeviceSP dst, const QRect &originalSrcRect)
QRect changeRect(const QRect &rect, KisDefaultBoundsBaseSP defaultBounds) override
void process(KisPixelSelectionSP pixelSelection, const QRect &rect) override
QRect changeRect(const QRect &rect, KisDefaultBoundsBaseSP defaultBounds) override
void process(KisPixelSelectionSP pixelSelection, const QRect &rect) override
virtual qreal opacityF(const quint8 *pixel) const =0
virtual void applyAlphaNormedFloatMask(quint8 *pixels, const float *alpha, qint32 nPixels) const =0
void resize(int w, int h)
void cut(Node *node)
cut erases the area defined by the selection from the node and puts a copy on the clipboard.
void intersect(Selection *selection)
void copy(Node *node)
copy copies the area defined by the selection from the node to the clipboard.
Selection(KisSelectionSP selection, QObject *parent=0)
void paste(Node *destination, int x, int y)
paste pastes the content of the clipboard to the given node, limited by the area of the current selec...
void selectAll(Node *node, int value)
KisSelectionSP selection() const
bool operator==(const Selection &other) const
void shrink(int xRadius, int yRadius, bool edgeLock)
Selection * duplicate() const
void subtract(Selection *selection)
void setPixelData(QByteArray value, int x, int y, int w, int h)
setPixelData writes the given bytes, of which there must be enough, into the Selection.
void border(int xRadius, int yRadius)
QByteArray pixelData(int x, int y, int w, int h) const
pixelData reads the given rectangle from the Selection's mask and returns it as a byte array....
void grow(int xradius, int yradius)
bool operator!=(const Selection &other) const
void add(Selection *selection)
void select(int x, int y, int w, int h, int value)
void replace(Selection *selection)
void symmetricdifference(Selection *selection)
virtual QRect exactBounds() const
virtual KisPaintDeviceSP paintDevice() const =0
bool hasEditablePaintDevice() const
void moveTo(const QPoint &pt) override
void select(const QRect &r, quint8 selectedness=MAX_SELECTED)
void applySelection(KisPixelSelectionSP selection, SelectionAction action)
KisPixelSelectionSP projection() const
bool hasNonEmptyPixelSelection() const
KisPixelSelectionSP pixelSelection
QRect selectedExactRect() const
Slow, but exact way of determining the rectangle that encloses the selection.