13#include <klocalizedstring.h>
56 bool onionSkinVisibleOverride =
true;
69 m_d->paintDevice = dev;
71 m_d->paintDevice->setSupportsWraparoundMode(
true);
72 m_d->paintDevice->setParentNode(
this);
83 m_d->paintDevice->setSupportsWraparoundMode(
true);
96 m_d->paintDevice->setSupportsWraparoundMode(
true);
104 const bool copyFrames = (rhs.
m_d->contentChannel != 0);
107 m_d->paintDevice->setSupportsWraparoundMode(
true);
108 m_d->paintChannelFlags = rhs.
m_d->paintChannelFlags;
111 m_d->paintDevice->setSupportsWraparoundMode(
true);
112 m_d->paintChannelFlags = rhs.
m_d->paintChannelFlags;
114 m_d->contentChannel =
m_d->paintDevice->keyframeChannel();
130 return node->inherits(
"KisMask");
135 return m_d->paintDevice;
140 return m_d->paintDevice;
150 const QRect&
rect)
const
162 if (
m_d->contentChannel &&
163 m_d->contentChannel->keyframeCount() > 1 &&
165 m_d->onionSkinVisibleOverride &&
166 !
m_d->paintDevice->defaultBounds()->externalFrameActive()) {
176 if (!
m_d->contentChannel ||
178 m_d->onionSkinCache.reset();
215 if (property.
name == i18n(
"Alpha Locked")) {
218 else if (property.
name == i18n(
"Onion Skins")) {
228 return v.visit(
this);
233 return visitor.
visit(
this, undoAdapter);
244 return m_d->paintChannelFlags;
266 return flags.count(
true) == 0 && !
m_d->paintChannelFlags.isEmpty();
272 if (oldAlphaLocked ==
lock)
return;
274 if(
m_d->paintChannelFlags.isEmpty())
293 if (oldState == state)
return;
295 if (!state && oldState) {
304 SIGNAL(sigOnionSkinChanged()),
308 m_d->onionSkinConnection.clear();
311 if (
m_d->contentChannel) {
312 m_d->contentChannel->setOnionSkinsEnabled(state);
319 m_d->onionSkinCache.reset();
326 const QRect dirtyRect =
339 return m_d->contentChannel;
360 if (contentChannel->onionSkinsEnabled()) {
379 m_d->handleRasterKeyframeChannelUpdateImpl(channel, time).notify(
this);
388 return m_d->handleRasterKeyframeChannelUpdateImpl(channel, time);
408 if (onionSkinsDevice) {
409 list << onionSkinsDevice;
417 return m_d->onionSkinVisibleOverride;
424 const QRect oldExtent =
extent();
426 m_d->onionSkinVisibleOverride =
value;
float value(const T *src, size_t ch)
const QString COMPOSITE_BEHIND
const KoColorSpace * colorSpace() const
KisKeyframeChannel stores and manages KisKeyframes. Maps units of time to virtual keyframe values....
virtual KisTimeSpan affectedFrames(int time) const
Get the set of frames affected by any changes to the value or content of the active keyframe at the g...
virtual QRect affectedRect(int time) const =0
static KisBaseNode::Property getColorSpaceMismatchProperty(const KoColorSpace *cs)
static const KoID onionSkins
static const KoID alphaLocked
static KisBaseNode::Property getProperty(const KoID &id, bool state)
QRect calculateFullExtent(const KisPaintDeviceSP device)
QRect calculateExtent(const KisPaintDeviceSP device, int time)
QRect updateExtentOnAddition(const KisPaintDeviceSP device, int addedTime)
static KisOnionSkinCompositor * instance()
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)
void setCompositeOpId(const KoCompositeOp *op)
virtual void visit(KisNode *node, KisUndoAdapter *undoAdapter)=0
The KisRasterKeyframeChannel is a concrete KisKeyframeChannel subclass that stores and manages KisRas...
bool contains(int time) const
QBitArray channelFlags(bool color=true, bool alpha=false) const
bool boolProperty(const QString &name, bool defaultValue=false) const
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
QIcon loadIcon(const QString &name)
void setNodeProperty(const QString &name, const QVariant &value)
virtual KisKeyframeChannel * requestKeyframeChannel(const QString &id)
const KoProperties & nodeProperties() const
virtual bool supportsKeyframeChannel(const QString &id)
KisTimeSpan affectedRange
void setupTemporaryPainter(KisPainter *painter) const
KisPaintDeviceSP temporaryTarget
bool hasTemporaryTarget() const
KisPaintDeviceSP projection() const override
void setImage(KisImageWSP image) override
QRect exactBounds() const override
QRect extent() const override
const KoColorSpace * colorSpace() const override
returns the image's colorSpace or null, if there is no image
void setSectionModelProperties(const KisBaseNode::PropertyList &properties) override
KisBaseNode::PropertyList sectionModelProperties() const override
virtual void handleKeyframeChannelFrameAdded(const KisKeyframeChannel *channel, int time)
void baseNodeChangedCallback() override
virtual KisPaintDeviceList getLodCapableDevices() const
void addKeyframeChannel(KisKeyframeChannel *channel) override
virtual KisFrameChangeUpdateRecipe handleKeyframeChannelFrameAboutToBeRemovedImpl(const KisKeyframeChannel *channel, int time)
virtual void handleKeyframeChannelFrameChange(const KisKeyframeChannel *channel, int time)
const QBitArray & channelLockFlags() const
void flushOnionSkinCache()
void setChannelLockFlags(const QBitArray &channelFlags)
bool supportsKeyframeChannel(const QString &id) override
QBitArray paintChannelFlags
KisRasterKeyframeChannel * contentChannel
void handleKeyframeChannelFrameAdded(const KisKeyframeChannel *channel, int time) override
KisBaseNode::PropertyList sectionModelProperties() const override
QRect extent() const override
KisKeyframeChannel * requestKeyframeChannel(const QString &id) override
KisFrameChangeUpdateRecipe handleRasterKeyframeChannelUpdateImpl(const KisKeyframeChannel *channel, int time)
void slotExternalUpdateOnionSkins()
bool accept(KisNodeVisitor &v) override
KisPaintDeviceList getLodCapableDevices() const override
bool needProjection() const override
void copyOriginalToProjection(const KisPaintDeviceSP original, KisPaintDeviceSP projection, const QRect &rect) const override
KisSignalAutoConnectionsStore onionSkinConnection
KisPaintLayer(KisImageWSP image, const QString &name, quint8 opacity, KisPaintDeviceSP dev)
KisFrameChangeUpdateRecipe handleKeyframeChannelFrameAboutToBeRemovedImpl(const KisKeyframeChannel *channel, int time) override
~KisPaintLayer() override
QRect exactBounds() const override
void setDecorationsVisible(bool value, bool update) override
void handleKeyframeChannelFrameChange(const KisKeyframeChannel *channel, int time) override
bool decorationsVisible() const override
KisPaintDeviceSP original() const override
void setImage(KisImageWSP image) override
KisOnionSkinCache onionSkinCache
void setSectionModelProperties(const KisBaseNode::PropertyList &properties) override
QIcon icon() const override
void setOnionSkinEnabled(bool state)
KisPaintDeviceSP paintDevice
bool onionSkinEnabled() const
Private(KisPaintLayer *_q)
bool allowAsChild(KisNodeSP) const override
void setAlphaLocked(bool lock)