11#include <klocalizedstring.h>
34 Private() : useSelectionInProjection(true) {}
35 Private(
const Private &rhs) : useSelectionInProjection(rhs.useSelectionInProjection) {}
86 m_d->selection->pixelSelection()->setDefaultPixel(
KoColor(Qt::white,
m_d->selection->pixelSelection()->colorSpace()));
87 m_d->selection->pixelSelection()->setSupportsWraparoundMode(
true);
88 m_d->selection->setParentNode(
this);
89 m_d->selection->updateProjection();
99 m_d->selection->pixelSelection()->setDirty();
106 m_d->imageConnections.clear();
109 m_d->selection->setResolutionProxy(
m_d->selection->resolutionProxy()->createOrCloneDetached(
image));
119 return node->inherits(
"KisMask");
125 return m_d->paintDevice;
129 return m_d->selection->pixelSelection();
135 return m_d->selection;
140 m_d->useSelectionInProjection =
value;
146 m_d->selection->updateProjection(
rect);
169 return tempSelection;
174 const QRect&
rect)
const
178 if (
m_d->useSelectionInProjection) {
193 return m_d->selection ?
194 rect &
m_d->selection->selectedRect() :
216 if (!
m_d->paintDevice) {
219 m_d->paintDevice->clear();
222 m_d->paintDevice->clear();
228 return m_d->selection;
235 m_d->selection->setParentNode(
this);
238 m_d->selection->pixelSelection()->setSupportsWraparoundMode(
true);
239 m_d->selection->updateProjection();
252 if (
m_d->selection->pixelSelection()->defaultBounds()->bounds() != imageSP->
bounds()) {
253 qWarning() <<
"WARNING: KisSelectionBasedLayer::setInternalSelection"
254 <<
"New selection has suspicious default bounds";
255 qWarning() <<
"WARNING:" <<
ppVar(
m_d->selection->pixelSelection()->defaultBounds()->bounds());
256 qWarning() <<
"WARNING:" <<
ppVar(imageSP->
bounds());
267 return m_d->selection ?
m_d->selection->x() : 0;
272 return m_d->selection ?
m_d->selection->y() : 0;
277 if (
m_d->selection) {
278 m_d->selection->setX(
x);
284 if (
m_d->selection) {
285 m_d->selection->setY(
y);
291 return !
m_d->selection || !
m_d->selection->hasShapeSelection();
299 return contentChannel;
328 if (
m_d->selection) {
329 resultRect =
m_d->selection->selectedRect();
334 if (temporaryTarget) {
351 if (
m_d->selection) {
352 resultRect =
m_d->selection->selectedExactRect();
357 if (temporaryTarget) {
375 return originalDevice && originalSelection ?
387 return originalDevice && originalSelection ? originalDevice->
sequenceNumber() : -1;
float value(const T *src, size_t ch)
const quint8 OPACITY_OPAQUE_U8
const KoColorSpace * colorSpace() const
QRect bounds() const override
KisKeyframeChannel stores and manages KisKeyframes. Maps units of time to virtual keyframe values....
KisRasterKeyframeChannel * keyframeChannel() const
int sequenceNumber() const
QImage createThumbnail(qint32 maxw, qint32 maxh, QRect rect, qreal oversample=1, KoColorConversionTransformation::Intent renderingIntent=KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::ConversionFlags conversionFlags=KoColorConversionTransformation::internalConversionFlags())
KisPaintDeviceFramesInterface * framesInterface()
QRect exactBounds() const
static void copyAreaOptimized(const QPoint &dstPt, KisPaintDeviceSP src, KisPaintDeviceSP dst, const QRect &originalSrcRect)
void bitBlt(qint32 dstX, qint32 dstY, const KisPaintDeviceSP srcDev, qint32 srcX, qint32 srcY, qint32 srcWidth, qint32 srcHeight)
The KisRasterKeyframeChannel is a concrete KisKeyframeChannel subclass that stores and manages KisRas...
void setFilenameSuffix(const QString &suffix)
KisSharedPtr< T > toStrongRef() const
toStrongRef returns a KisSharedPtr which may be dereferenced.
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
KisSharedPtr< KisDefaultBounds > KisDefaultBoundsSP
QSharedPointer< T > toQShared(T *ptr)
KisSharedPtr< KisPaintDevice > KisPaintDeviceSP
KisWeakSharedPtr< KisNode > KisNodeWSP
KisSharedPtr< KisSelection > KisSelectionSP
virtual KisKeyframeChannel * requestKeyframeChannel(const QString &id)
virtual bool supportsKeyframeChannel(const QString &id)
void setupTemporaryPainter(KisPainter *painter) const
KisPaintDeviceSP temporaryTarget
bool hasTemporaryTarget() const
KisPaintDeviceSP projection() const override
void setImage(KisImageWSP image) override
const KoColorSpace * colorSpace() const override
returns the image's colorSpace or null, if there is no image
void addKeyframeChannel(KisKeyframeChannel *channel) override
Describes base behaviour for selection base classes like KisAdjustmentLayer and KisGeneratorLayer....
void setUseSelectionInProjection(bool value) const
QRect needRect(const QRect &rect, PositionToFilthy pos=N_FILTHY) const override
KisSelectionSP fetchComposedInternalSelection(const QRect &rect) const
void setImage(KisImageWSP image) override
bool needProjection() const override
qint32 x() const override
bool useSelectionInProjection
void copyOriginalToProjection(const KisPaintDeviceSP original, KisPaintDeviceSP projection, const QRect &rect) const override
bool allowAsChild(KisNodeSP node) const override
virtual void resetCache(const KoColorSpace *colorSpace)
KisSelectionBasedLayer(KisImageWSP image, const QString &name, KisSelectionSP selection, KisFilterConfigurationSP filterConfig)
Private(const Private &rhs)
qint32 y() const override
int thumbnailSeqNo() const override
QRect extent() const override
void setInternalSelection(KisSelectionSP selection)
QRect cropChangeRectBySelection(const QRect &rect) const
KisKeyframeChannel * requestKeyframeChannel(const QString &id) override
void slotImageSizeChanged()
~KisSelectionBasedLayer() override
KisPaintDeviceSP paintDevice
void setX(qint32 x) override
bool supportsLodPainting() const override
bool supportsKeyframeChannel(const QString &id) override
QRect exactBounds() const override
void setY(qint32 y) override
KisSignalAutoConnectionsStore imageConnections
KisSelectionSP internalSelection() const
QImage createThumbnail(qint32 w, qint32 h, Qt::AspectRatioMode aspectRatioMode=Qt::IgnoreAspectRatio) override
KisPaintDeviceSP original() const override
KisPixelSelectionSP pixelSelection