21#include <klocalizedstring.h>
107#define SANITY_CHECK_LOCKED(name) \
108 if (!locked()) warnKrita() << "Locking policy failed:" << name \
109 << "has been called without the image" \
112#define SANITY_CHECK_LOCKED(name)
116 qRegisterMetaType<KisImageSP>(
"KisImageSP");
150 [=](
bool forgettable) {
165 return std::make_pair(suspend, resume);
178 bool addedUIUpdateRequestSuccessfully =
false;
189 addedUIUpdateRequestSuccessfully =
true;
285 const QRect &cropRect,
286 KisProjectionUpdateFlags flags);
295 KoColorConversionTransformation::ConversionFlags conversionFlags);
319 colorSpace, undoStore,
323 moveToThread(qApp->thread());
345 switch (image.format()) {
346 case QImage::Format_Invalid:
347 case QImage::Format_Mono:
348 case QImage::Format_MonoLSB:
351 case QImage::Format_Indexed8:
352 case QImage::Format_RGB32:
353 case QImage::Format_ARGB32:
354 case QImage::Format_ARGB32_Premultiplied:
357 case QImage::Format_RGB16:
360 case QImage::Format_ARGB8565_Premultiplied:
361 case QImage::Format_RGB666:
362 case QImage::Format_ARGB6666_Premultiplied:
363 case QImage::Format_RGB555:
364 case QImage::Format_ARGB8555_Premultiplied:
365 case QImage::Format_RGB888:
366 case QImage::Format_RGB444:
367 case QImage::Format_ARGB4444_Premultiplied:
368 case QImage::Format_RGBX8888:
369 case QImage::Format_RGBA8888:
370 case QImage::Format_RGBA8888_Premultiplied:
373 case QImage::Format_BGR30:
374 case QImage::Format_A2BGR30_Premultiplied:
375 case QImage::Format_RGB30:
376 case QImage::Format_A2RGB30_Premultiplied:
379 case QImage::Format_Alpha8:
382 case QImage::Format_Grayscale8:
385 case QImage::Format_Grayscale16:
388 case QImage::Format_RGBX64:
389 case QImage::Format_RGBA64:
390 case QImage::Format_RGBA64_Premultiplied:
407 return new KisImage(*
this, 0, exactCopy);
441 if (colorSpaceChanged) {
445 if (resolutionChanged) {
451 setObjectName(rhs.objectName());
464 oldRoot->disconnect();
468#define EMIT_IF_NEEDED if (!(policy & REPLACE)) {} else emit
473 if (colorSpaceChanged) {
476 if (resolutionChanged) {
497 QQueue<KisNodeSP> linearizedNodes;
500 linearizedNodes.enqueue(node);
503 [&linearizedNodes, exactCopy, &rhs,
this](
KisNodeSP node) {
504 KisNodeSP refNode = linearizedNodes.dequeue();
528 using KeyframeChannelContainer = QMap<QString, KisKeyframeChannel*>;
530 for (KeyframeChannelContainer::iterator i = keyframeChannels.begin();
531 i != keyframeChannels.end(); i++) {
532 keyframeChannels[i.key()]->setNode(node);
570 rhs.width(), rhs.height(),
576 moveToThread(qApp->thread());
606 KisNodeSP deletedNode = parent->at(index);
644 UpdateOverlaySelectionStroke(
KisImageSP image)
649 setClearsRedoOnStart(
false);
652 void initStrokeCallback()
override {
655 if (oldMask == newMask)
return;
659 m_image->m_d->overlaySelectionMask = newMask;
661 if (oldMask || newMask) {
662 m_image->
m_d->rootLayer->notifyChildMaskChanged();
666 const QRect oldMaskRect = oldMask->
graphListener() ? oldMask->
extent() : m_image->bounds();
667 m_image->m_d->rootLayer->setDirtyDontResetAnimationCache(oldMaskRect);
674 m_image->undoAdapter()->emitSelectionChanged();
717 QString baseName = _baseName;
720 int maxLayerIndex = 0;
721 QRegularExpression numberedLayerRegexp(
".* (\\d+)$");
723 [&numLayers, &maxLayerIndex, &numberedLayerRegexp] (
KisNodeSP node) {
724 if (node->inherits(
"KisLayer")) {
725 QRegularExpressionMatch match = numberedLayerRegexp.match(node->name());
727 if (match.hasMatch()) {
728 maxLayerIndex = qMax(maxLayerIndex, match.captured(1).toInt());
735 if (numLayers == 1) {
736 return i18nc(
"Name for the bottom-most layer in the layerstack",
"Background");
739 if (baseName.isEmpty()) {
740 baseName = i18n(
"Paint Layer");
743 return QString(
"%1 %2").arg(baseName).arg(maxLayerIndex + 1);
836 if (newRect ==
bounds() && !cropLayers)
return;
854 emitSignals, actionName, extraData);
856 if (cropLayers || !newRect.topLeft().isNull()) {
885 PurgeUnusedDataStroke(
KisImageSP image,
bool isCancellable)
891 this->enableJob(JOB_DOSTROKE,
true);
892 setClearsRedoOnStart(
false);
893 setRequestsOtherStrokesToEnd(!isCancellable);
894 setCanForgetAboutMe(isCancellable);
897 void initStrokeCallback()
override
904 deviceList << node->getLodCapableDevices();
912 if (!device)
continue;
920 addMutatedJobs(jobsData);
933 const bool isLayer = qobject_cast<KisLayer*>(node.
data());
946 emitSignals, actionName, extraData);
964 bool sizeChanged =
size != this->
size();
966 if (!resolutionChanged && !sizeChanged)
return;
976 KisProcessingApplicator::ProcessingFlags signalFlags =
977 (resolutionChanged || sizeChanged) ?
983 emitSignals, actionName);
985 qreal sx = qreal(
size.width()) / this->
size().width();
986 qreal sy = qreal(
size.height()) / this->
size().height();
988 QTransform shapesCorrection;
990 if (resolutionChanged) {
991 shapesCorrection = QTransform::fromScale(
xRes() / xres,
yRes() / yres);
1004 if (resolutionChanged) {
1034 QTransform transform = worker.
transform();
1036 offset = center - transform.map(center);
1041 emitSignals, actionName);
1047 offset.x(), offset.y(),
1085 else if (selection) {
1090 baseBounds = baseBounds.united(node->
exactBounds());
1103 QTransform transform = worker.
transform();
1106 QRect newRect = transform.mapRect(baseBounds);
1107 newSize = newRect.size();
1108 offset = -newRect.topLeft();
1111 QPointF origin = QRectF(baseBounds).center();
1114 offset = -(transform.map(origin) - origin);
1119 (newSize.width() != baseBounds.width() ||
1120 newSize.height() != baseBounds.height());
1127 KisProcessingApplicator::ProcessingFlags signalFlags =
1135 emitSignals, actionName);
1142 offset.x(), offset.y(),
1172 if (nodes.size() == 1 && nodes[0]->inherits(
"KisMask")) {
1176 rotateImpl(
kundo2_i18np(
"Rotate Layer",
"Rotate %1 Layers", nodes.size()), nodes, radians,
false, selection);
1183 double angleX,
double angleY,
1191 double angleX,
double angleY,
1198 else if (selection) {
1203 baseBounds = baseBounds.united(node->
exactBounds());
1206 const QPointF origin = QRectF(baseBounds).center();
1209 const qreal pi = 3.1415926535897932385;
1210 const qreal deg2rad = pi / 180.0;
1212 qreal tanX = tan(angleX * deg2rad);
1213 qreal tanY = tan(angleY * deg2rad);
1225 QRect newRect = worker.
transform().mapRect(baseBounds);
1226 newSize = newRect.size();
1228 else offset = origin - worker.
transform().map(origin);
1231 if (newSize == baseBounds.size())
return;
1236 KisProcessingApplicator::ProcessingFlags signalFlags =
1242 emitSignals, actionName);
1250 offset.x(), offset.y(),
1276 if (nodes.size() == 1 && nodes[0]->inherits(
"KisMask")) {
1278 angleX, angleY, selection);
1282 angleX, angleY, selection);
1295 KoColorConversionTransformation::ConversionFlags conversionFlags)
1303 if (!dstColorSpace || *srcColorSpace == *dstColorSpace)
return;
1312 emitSignals, actionName);
1316 srcColorSpace, dstColorSpace,
1317 renderingIntent, conversionFlags),
1349 KoColorConversionTransformation::ConversionFlags conversionFlags)
1353 if (!dstColorSpace || *srcColorSpace == *dstColorSpace)
return;
1364 if (convertLayers) {
1370 emitSignals, actionName);
1380 srcColorSpace, dstColorSpace,
1381 renderingIntent, conversionFlags),
1396 KoColorConversionTransformation::ConversionFlags conversionFlags)
1414 KisProcessingApplicator::ProcessingFlags flags =
1419 emitSignals, actionName);
1445 if (!dstColorSpace)
return false;
1450 emitSignals, actionName);
1454 srcColorSpace, dstColorSpace),
1470 imageProfileIsSame &=
1473 return *node->colorSpace()->profile() != *profile;
1476 if (imageProfileIsSame) {
1487 if (!dstColorSpace)
return false;
1494 emitSignals, actionName);
1504 srcColorSpace, dstColorSpace),
1549 qWarning() <<
"WARNING: Ignoring attempt to set image x resolution <= 0 (" << xres <<
")!";
1555 qWarning() <<
"WARNING: Ignoring attempt to set image y resolution <= 0 (" << yres <<
")!";
1561 return QPointF(documentCoord.x() *
xRes(), documentCoord.y() *
yRes());
1567 return QPoint(qFloor(pixelCoord.x()), qFloor(pixelCoord.y()));
1577 return QPointF(pixelCoord.x() /
xRes(), pixelCoord.y() /
yRes());
1582 return QPointF((pixelCoord.x() + 0.5) /
xRes(), (pixelCoord.y() + 0.5) /
yRes());
1625 return visitor.
count();
1637 return visitor.
count();
1648 childNode->accept(visitor);
1650 return visitor.
count();
1686 imageRect.getRect(&x, &y, &w, &h);
1697 if (!dev)
return QImage();
1709 if (scaledImageSize.isEmpty()) {
1717 double scaleX = qreal(scaledImageSize.width()) /
width();
1718 double scaleY = qreal(scaledImageSize.height()) /
height();
1721 if (scaleX < 1.0/256 || scaleY < 1.0/256) {
1749 QRect boundRect =
bounds();
1754 boundRect = t.
map(boundRect);
1854 if ((*it) && (*it)->type() == type) {
1858 qWarning() <<
"Skipping deleted annotation";
1869 if ((*it)->type() == type) {
1928 for (
int y = 0; y < rc.height(); y += patchHeight) {
1929 for (
int x = 0; x < rc.width(); x += patchWidth) {
1930 QRect patchRect(x, y, patchWidth, patchHeight);
1942 if ((isolateLayer || isolateGroup) ==
false)
return false;
1951 StartIsolatedModeStroke(
KisNodeSP node,
KisImageSP image,
bool isolateLayer,
bool isolateGroup)
1956 m_isolateLayer(isolateLayer),
1957 m_isolateGroup(isolateGroup)
1960 this->enableJob(JOB_DOSTROKE,
true);
1962 setClearsRedoOnStart(
false);
1965 void initStrokeCallback()
override {
1966 if (m_isolateLayer ==
false && m_isolateGroup ==
true) {
1968 m_newRoot = m_newRoot->parent() ? m_newRoot->parent() : m_newRoot;
1972 m_newRoot->projectionLeaf()->explicitlyRegeneratePassThroughProjection();
1973 m_prevRoot = m_image->m_d->isolationRootNode;
1975 const bool beforeVisibility = m_newRoot->projectionLeaf()->visible();
1976 const bool prevRootBeforeVisibility = m_prevRoot ? m_prevRoot->projectionLeaf()->visible() :
false;
1978 m_image->m_d->isolationRootNode = m_newRoot;
1979 Q_EMIT m_image->sigIsolatedModeChanged();
1981 const bool afterVisibility = m_newRoot->projectionLeaf()->visible();
1982 const bool prevRootAfterVisibility = m_prevRoot ? m_prevRoot->projectionLeaf()->visible() :
false;
1984 m_newRootNeedsFullRefresh = beforeVisibility != afterVisibility;
1985 m_prevRootNeedsFullRefresh = prevRootBeforeVisibility != prevRootAfterVisibility;
1988 void finishStrokeCallback()
override {
1992 if (m_prevRoot && m_prevRootNeedsFullRefresh) {
1993 m_image->refreshGraphAsync(m_prevRoot);
1996 if (m_newRootNeedsFullRefresh) {
1997 m_image->refreshGraphAsync(m_newRoot);
2000 if (!m_prevRootNeedsFullRefresh && !m_newRootNeedsFullRefresh) {
2002 m_image->m_d->notifyProjectionUpdatedInPatches(m_image->bounds(), jobs);
2003 this->runnableJobsInterface()->addRunnableJobs(jobs);
2006 m_image->invalidateAllFrames();
2013 bool m_newRootNeedsFullRefresh =
false;
2014 bool m_prevRootNeedsFullRefresh =
false;
2016 bool m_isolateLayer;
2017 bool m_isolateGroup;
2034 m_oldRootNode(
nullptr),
2035 m_oldNodeNeedsRefresh(
false)
2037 this->enableJob(JOB_INIT);
2038 this->enableJob(JOB_DOSTROKE,
true);
2040 setClearsRedoOnStart(
false);
2043 void initStrokeCallback()
override {
2044 if (!m_image->m_d->isolationRootNode)
return;
2046 m_oldRootNode = m_image->m_d->isolationRootNode;
2048 const bool beforeVisibility = m_oldRootNode->projectionLeaf()->visible();
2049 m_image->m_d->isolationRootNode = 0;
2050 m_image->m_d->isolateLayer =
false;
2051 m_image->m_d->isolateGroup =
false;
2052 Q_EMIT m_image->sigIsolatedModeChanged();
2053 const bool afterVisibility = m_oldRootNode->projectionLeaf()->visible();
2055 m_oldNodeNeedsRefresh = (beforeVisibility != afterVisibility);
2058 void finishStrokeCallback()
override {
2060 m_image->invalidateAllFrames();
2062 if (m_oldNodeNeedsRefresh){
2063 m_oldRootNode->setDirty(m_image->bounds());
2072 m_image->m_d->notifyProjectionUpdatedInPatches(m_image->bounds(), jobs);
2073 this->runnableJobsInterface()->addRunnableJobs(jobs);
2080 bool m_oldNodeNeedsRefresh;
2119 return scheduler.tryCancelCurrentStrokeAsync();
2187 if (leaf->shouldBeRendered()) {
2188 for (
auto it = changeRects.begin(); it != changeRects.end(); ++it) {
2193 leaf = leaf->nextSibling();
2196 std::swap(requestedRects, changeRects);
2212 if ((*it)->filterRefreshGraph(
this,
root.
data(), requestedRects, cropRect, flags)) {
2305 postponedUpdates.append(
rect);
2308 return postponedUpdates;
2319 if (dirtyRect.isEmpty())
return;
2361 const QRect &cropRect,
2362 KisProjectionUpdateFlags flags)
2364 if (rects.isEmpty())
return;
2366 scheduler.updateProjection(node, rects, cropRect, flags);
2381 if ((*it)->filter(
this, node, rects, flags)) {
2402 Q_FOREACH (
const QRect &rc, rects) {
2404 allSplitRects.append(splitRect);
float value(const T *src, size_t ch)
QVector< KisImageSignalType > KisImageSignalVector
@ ColorSpaceChangedSignal
@ ModifiedWithoutUndoSignal
@ ResolutionChangedSignal
const KoID Float32BitsColorDepthID("F32", ki18n("32-bit float/channel"))
const KoID RGBAColorModelID("RGBA", ki18n("RGB/Alpha"))
const quint8 OPACITY_OPAQUE_U8
PythonPluginManager * instance
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void notifyWaitOnImageStarted(KisImage *image)
void notifyWaitOnImageEnded(KisImage *image)
static KisBusyWaitBroker * instance()
The KisDumbUndoStore class doesn't actually save commands, so you cannot undo or redo!
static KisFilterStrategyRegistry * instance()
void invalidateFrames(const KisTimeSpan &range, const QRect &rect)
void notifyNodeChanged(const KisNode *node, const QRect &rect, bool recursive)
void requestTimeSwitchNonGUI(int time, bool useUndo=false)
int updatePatchWidth() const
int updatePatchHeight() const
bool enableProgressReporting(bool requestDefault=false) const
KisSelectionMaskSP deselectedGlobalSelection() const
void setDeselectedGlobalSelection(KisSelectionMaskSP selectionMask)
KisImageGlobalSelectionManagementInterface(KisImage *image)
void emitNotifyBatchUpdateStarted()
void emitNotifyBatchUpdateEnded()
void emitNotification(KisImageSignalType type)
void emitNodeHasBeenAdded(KisNode *parent, int index, KisNodeAdditionFlags flags)
void emitAboutToRemoveANode(KisNode *parent, int index)
void emitNodeChanged(KisNodeSP node)
KisCompositeProgressProxy compositeProgressProxy
KisLocklessStack< QRect > savedDisabledUIUpdates
KisNodeSP isolationRootNode
vKisAnnotationSP annotations
KisSelectionMaskSP deselectedGlobalSelectionMask
void notifyProjectionUpdatedInPatches(const QRect &rc, QVector< KisRunnableStrokeJobData * > &jobs)
KisImageAnimationInterface * animationInterface
bool wrapAroundModePermitted
KisUpdateScheduler scheduler
KisProofingConfigurationSP proofingConfig
KisSelectionMaskSP targetOverlaySelectionMask
KisImageGlobalSelectionManagementInterface globalSelectionInterface
KisSelectionMaskSP overlaySelectionMask
void requestProjectionUpdateImpl(KisNode *node, const QVector< QRect > &rects, const QRect &cropRect, KisProjectionUpdateFlags flags)
bool tryCancelCurrentStrokeAsync()
KisPostExecutionUndoAdapter postExecutionUndoAdapter
KisLegacyUndoAdapter legacyUndoAdapter
QAtomicInt disableUIUpdateSignals
QScopedPointer< KisUndoStore > undoStore
WrapAroundAxis wrapAroundModeAxis
const KoColorSpace * colorSpace
QAtomicInt disableDirtyRequests
QVector< KisProjectionUpdatesFilterSP > projectionUpdatesFilters
KisImageSignalRouter signalRouter
QStack< KisProjectionUpdatesFilterCookie > disabledUpdatesCookies
void convertImageColorSpaceImpl(const KoColorSpace *dstColorSpace, bool convertLayers, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags)
QList< KisLayerCompositionSP > compositions
bool allowMasksOnRootNode
KisGroupLayerSP rootLayer
KisImagePrivate(KisImage *_q, qint32 w, qint32 h, const KoColorSpace *c, KisUndoStore *undo, KisImageAnimationInterface *_animationInterface)
void resizeImage(const QRect &newRect)
start asynchronous operation on resizing the image
KisUndoAdapter * undoAdapter() const
void shearNodes(KisNodeList nodes, double angleX, double angleY, KisSelectionSP selection)
vKisAnnotationSP_it endAnnotations()
void requestStrokeEndActiveNode()
QImage convertToQImage(qint32 x1, qint32 y1, qint32 width, qint32 height, const KoColorProfile *profile)
void sigLayersChangedAsync()
int workingThreadsLimit() const
void invalidateAllFrames() override
void addAnnotation(KisAnnotationSP annotation)
bool wrapAroundModeActive() const
void sigNodeCollapsedChanged()
bool canReselectGlobalSelection()
KisImageGlobalSelectionManagementInterface * globalSelectionManagementInterface() const
void scaleNode(KisNodeSP node, const QPointF ¢er, qreal scaleX, qreal scaleY, KisFilterStrategy *filterStrategy, KisSelectionSP selection)
start asynchronous operation on scaling a subtree of nodes starting at node
void nodeChanged(KisNode *node) override
bool isIsolatingLayer() const
void setLodPreferences(const KisLodPreferences &value)
bool startIsolatedMode(KisNodeSP node, bool isolateLayer, bool isolateGroup)
bool hasUpdatesRunning() const override
void disableUIUpdates() override
void setWorkingThreadsLimit(int value)
void refreshGraphAsync(KisNodeSP root, const QVector< QRect > &rects, const QRect &cropRect, KisProjectionUpdateFlags flags=KisProjectionUpdateFlag::None) override
void nodeHasBeenAdded(KisNode *parent, int index, KisNodeAdditionFlags flags) override
void keyframeChannelAboutToBeRemoved(KisNode *node, KisKeyframeChannel *channel) override
bool cancelStroke(KisStrokeId id) override
KisGroupLayerSP rootLayer() const
void disableDirtyRequests() override
void setWrapAroundModeAxis(WrapAroundAxis value)
void shearImpl(const KUndo2MagicString &actionName, KisNodeSP rootNode, bool resizeImage, double angleX, double angleY, KisSelectionSP selection)
void cropNode(KisNodeSP node, const QRect &newRect, const bool activeFrameOnly=false)
start asynchronous operation on cropping a subtree of nodes starting at node
void enableDirtyRequests() override
QPointF documentToPixel(const QPointF &documentCoord) const
void keyframeChannelHasBeenAdded(KisNode *node, KisKeyframeChannel *channel) override
UndoResult tryUndoUnfinishedLod0Stroke()
void aboutToRemoveANode(KisNode *parent, int index) override
qint32 nChildLayers() const
void shear(double angleX, double angleY)
start asynchronous operation on shearing the image
const KoColorSpace * colorSpace() const
QPointF mirrorAxesCenter() const
KisImageAnimationInterface * animationInterface() const
void shearNode(KisNodeSP node, double angleX, double angleY, KisSelectionSP selection)
start asynchronous operation on shearing a subtree of nodes starting at node
void purgeUnusedData(bool isCancellable)
purge all pixels that have default pixel to free up memory
KisCompositeProgressProxy * compositeProgressProxy()
void requestUndoDuringStroke()
void removeComposition(KisLayerCompositionSP composition)
void setProjectionColorSpace(const KoColorSpace *colorSpace)
void setAllowMasksOnRootNode(bool value)
void copyFromImageImpl(const KisImage &rhs, int policy)
void rotateImpl(const KUndo2MagicString &actionName, KisNodeSP rootNode, double radians, bool resizeImage, KisSelectionSP selection)
void sigStrokeCancellationRequested()
void blockUpdates() override
blockUpdates block updating the image projection
void sigRedoDuringStrokeRequested()
QString nextLayerName(const QString &baseName="") const
KisAnnotationSP annotation(const QString &type)
void flattenLayer(KisLayerSP layer)
KisProjectionUpdatesFilterSP removeProjectionUpdatesFilter(KisProjectionUpdatesFilterCookie cookie) override
removes already installed filter from the stack of updates filers
void sigInternalStopIsolatedModeRequested()
void unifyLayersColorSpace()
bool assignImageProfile(const KoColorProfile *profile, bool blockAllUpdates=false)
QRect effectiveLodBounds() const
bool isIdle(bool allowLocked=false)
void copyFromImage(const KisImage &rhs)
KisProjectionUpdatesFilterCookie currentProjectionUpdatesFilter() const override
QPointF pixelToDocument(const QPointF &pixelCoord) const
void scaleNodes(KisNodeList nodes, const QPointF ¢er, qreal scaleX, qreal scaleY, KisFilterStrategy *filterStrategy, KisSelectionSP selection)
void convertImageColorSpace(const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags)
KisSelectionMaskSP overlaySelectionMask() const
void sigResolutionChanged(double xRes, double yRes)
void barrierLock(bool readOnly=false)
Wait until all the queued background jobs are completed and lock the image.
KisImage * clone(bool exactCopy=false)
void flatten(KisNodeSP activeNode)
void rotateImage(double radians)
start asynchronous operation on rotating the image
WrapAroundAxis wrapAroundModeAxis() const
void sigColorSpaceChanged(const KoColorSpace *cs)
KisPaintDeviceSP projection() const
@ REPLACE
we are replacing the current KisImage with another
@ CONSTRUCT
we are copy-constructing a new KisImage
void scaleImage(const QSize &size, qreal xres, qreal yres, KisFilterStrategy *filterStrategy)
start asynchronous operation on scaling the image
void resizeImageImpl(const QRect &newRect, bool cropLayers)
void immediateLockForReadOnly()
void aboutToAddANode(KisNode *parent, int index) override
void setDefaultProjectionColor(const KoColor &color)
void setProofingConfiguration(KisProofingConfigurationSP proofingConfig)
setProofingConfiguration, this sets the image's proofing configuration, and signals the proofingConfi...
void explicitRegenerateLevelOfDetail()
void notifyBatchUpdateEnded() override
void notifyBatchUpdateStarted() override
bool allowMasksOnRootNode() const
void addComposition(KisLayerCompositionSP composition)
KisPostExecutionUndoAdapter * postExecutionUndoAdapter() const override
qint32 nHiddenLayers() const
void requestStrokeCancellation()
KisNode * graphOverlayNode() const override
void moveCompositionUp(KisLayerCompositionSP composition)
void requestTimeSwitch(int time) override
QPoint documentToImagePixelFloored(const QPointF &documentCoord) const
void addJob(KisStrokeId id, KisStrokeJobData *data) override
void setOverlaySelectionMask(KisSelectionMaskSP mask)
KisImage(KisUndoStore *undoStore, qint32 width, qint32 height, const KoColorSpace *colorSpace, const QString &name)
colorSpace can be null. In that case, it will be initialised to a default color space.
void cropImage(const QRect &newRect)
start asynchronous operation on cropping the image
void setMirrorAxesCenter(const QPointF &value) const
bool assignLayerProfile(KisNodeSP node, const KoColorProfile *profile)
void initialRefreshGraph()
void sigStrokeEndRequested()
void sigUndoDuringStrokeRequested()
void setSize(const QSize &size)
QVector< QRect > enableUIUpdates() override
void nodeCollapsedChanged(KisNode *node) override
KisStrokeId startStroke(KisStrokeStrategy *strokeStrategy) override
void notifySelectionChanged() override
bool isIsolatingGroup() const
void notifyAboutToBeDeleted()
KisLodPreferences lodPreferences() const
void sigAboutToBeDeleted()
void invalidateFrames(const KisTimeSpan &range, const QRect &rect) override
void mergeMultipleLayers(QList< KisNodeSP > mergedLayers, KisNodeSP putAfter)
int currentLevelOfDetail() const
KisSelectionSP globalSelection() const
void sigStrokeEndRequestedActiveNodeFiltered()
KisNodeSP isolationRootNode() const
QList< KisLayerCompositionSP > compositions()
void sigProofingConfigChanged()
void mergeDown(KisLayerSP l, const KisMetaData::MergeStrategy *strategy)
const KUndo2Command * lastExecutedCommand() const override
void removeAnnotation(const QString &type)
KisImageSignalRouter * signalRouter()
QRect bounds() const override
KoColor defaultProjectionColor() const
void convertLayerColorSpace(KisNodeSP node, const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags)
void notifyLayersChanged()
use if the layers have changed completely (eg. when flattening)
friend class KisImageResizeCommand
bool tryBarrierLock(bool readOnly=false)
Tries to lock the image without waiting for the jobs to finish.
KisUndoStore * undoStore()
void unblockUpdates() override
unblockUpdates unblock updating the image project. This only restarts the scheduler and does not sche...
void setModifiedWithoutUndo()
bool hasOverlaySelectionMask() const
KisProjectionUpdatesFilterCookie addProjectionUpdatesFilter(KisProjectionUpdatesFilterSP filter) override
void moveCompositionDown(KisLayerCompositionSP composition)
bool wrapAroundModePermitted() const
void notifyProjectionUpdated(const QRect &rc) override
void sigImageUpdated(const QRect &)
void addSpontaneousJob(KisSpontaneousJob *spontaneousJob)
void rotateNodes(KisNodeList nodes, double radians, KisSelectionSP selection)
void endStroke(KisStrokeId id) override
void notifyUIUpdateCompleted(const QRect &rc) override
const KoColorProfile * profile() const
vKisAnnotationSP_it beginAnnotations()
void requestRedoDuringStroke()
void sigSizeChanged(const QPointF &oldStillPoint, const QPointF &newStillPoint)
void setResolution(double xres, double yres)
void setRootLayer(KisGroupLayerSP rootLayer)
static KisImageSP fromQImage(const QImage &image, KisUndoStore *undoStore)
void convertImageProjectionColorSpace(const KoColorSpace *dstColorSpace)
void setWrapAroundModePermitted(bool value)
void requestProjectionUpdate(KisNode *node, const QVector< QRect > &rects, KisProjectionUpdateFlags flags) override
void setUndoStore(KisUndoStore *undoStore)
KisProofingConfigurationSP proofingConfiguration() const
proofingConfiguration
void rotateNode(KisNodeSP node, double radians, KisSelectionSP selection)
start asynchronous operation on rotating a subtree of nodes starting at node
KisKeyframeChannel stores and manages KisKeyframes. Maps units of time to virtual keyframe values....
void setNode(KisNodeWSP node)
QRect exactBounds() const
void purgeDefaultPixels()
KoColor defaultPixel() const
QImage convertToQImage(const KoColorProfile *dstProfile, qint32 x, qint32 y, qint32 w, qint32 h, KoColorConversionTransformation::Intent renderingIntent=KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::ConversionFlags conversionFlags=KoColorConversionTransformation::internalConversionFlags()) const
void convertFromQImage(const QImage &image, const KoColorProfile *profile, qint32 offsetX=0, qint32 offsetY=0)
static void copyAreaOptimized(const QPoint &dstPt, KisPaintDeviceSP src, KisPaintDeviceSP dst, const QRect &originalSrcRect)
void setUndoStore(KisUndoStore *undoStore)
void applyVisitor(KisProcessingVisitorSP visitor, KisStrokeJobData::Sequentiality sequentiality=KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::Exclusivity exclusivity=KisStrokeJobData::NORMAL)
void applyCommand(KUndo2Command *command, KisStrokeJobData::Sequentiality sequentiality=KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::Exclusivity exclusivity=KisStrokeJobData::NORMAL)
void applyVisitorAllFrames(KisProcessingVisitorSP visitor, KisStrokeJobData::Sequentiality sequentiality=KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::Exclusivity exclusivity=KisStrokeJobData::NORMAL)
The KisProofingConfiguration struct Little struct that stores the proofing configuration for a given ...
bool requestsOtherStrokesToEnd() const
static SharedDataSP createSharedData()
static QList< KisStrokeJobData * > createSuspendJobsData(KisImageWSP image)
static QList< KisStrokeJobData * > createResumeJobsData(KisImageWSP image)
static QList< KisStrokeJobData * > createJobsData(KisImageWSP image)
static KisTimeSpan infinite(int start)
void emitSelectionChanged()
void setUndoStore(KisUndoStore *undoStore)
virtual const KoColorProfile * profile() const =0
static KoColor createTransparent(const KoColorSpace *cs)
A holder for an updater that does nothing.
const T value(const QString &id) const
void setProperty(const QString &name, const QVariant &value)
static bool qFuzzyCompare(half p1, half p2)
This file is part of the Krita application in calligra.
#define KIS_ASSERT_RECOVER(cond)
#define KIS_SAFE_ASSERT_RECOVER(cond)
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
#define KIS_ASSERT_RECOVER_RETURN(cond)
#define KIS_ASSERT_RECOVER_NOOP(cond)
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
#define SANITY_CHECK_LOCKED(name)
KIS_DECLARE_STATIC_INITIALIZER
bool checkMasksNeedConversion(KisNodeSP root, const QRect &bounds)
static bool isLayer(KisNodeSP node)
QSharedPointer< T > toQShared(T *ptr)
std::pair< KisStrokeStrategy *, QList< KisStrokeJobData * > > KisSuspendResumePair
std::pair< KisStrokeStrategy *, QList< KisStrokeJobData * > > KisLodSyncPair
KisSharedPtr< KisAnnotation > KisAnnotationSP
KisWeakSharedPtr< KisImage > KisImageWSP
QSharedPointer< KisProofingConfiguration > KisProofingConfigurationSP
vKisAnnotationSP::iterator vKisAnnotationSP_it
void * KisProjectionUpdatesFilterCookie
KUndo2MagicString kundo2_i18n(const char *text)
KUndo2MagicString kundo2_noi18n(const QString &text)
KUndo2MagicString kundo2_i18np(const char *sing, const char *plur, const A1 &a1)
void flattenImage(KisImageSP image, KisNodeSP activeNode, MergeFlags flags)
KisNodeSP recursiveFindNode(KisNodeSP node, std::function< bool(KisNodeSP)> func)
void flattenLayer(KisImageSP image, KisLayerSP layer, MergeFlags flags)
void recursiveApplyNodes(NodePointer node, Functor func)
void mergeDown(KisImageSP image, KisLayerSP layer, const KisMetaData::MergeStrategy *strategy, MergeFlags flags)
void mergeMultipleNodes(KisImageSP image, KisNodeList mergedNodes, KisNodeSP putAfter, MergeFlags flags)
void addJobConcurrent(QVector< Job * > &jobs, Func func)
void makeContainerUnique(C &container)
QMap< QString, KisKeyframeChannel * > keyframeChannels
virtual KisPaintDeviceSP projection() const =0
virtual QRect exactBounds() const
void setUuid(const QUuid &id)
virtual const KoColorSpace * colorSpace() const =0
FlipFlopCommand(State initialState, KUndo2Command *parent=0)
void setDefaultProjectionColor(KoColor color)
bool accept(KisNodeVisitor &v) override
void setImage(KisImageWSP image) override
KisPaintDeviceSP original() const override
KoColor defaultProjectionColor() const
const KoColorSpace * m_cs
SetImageProjectionColorSpace(const KoColorSpace *cs, KisImageWSP image, State initialState, KUndo2Command *parent=0)
KisPaintDeviceSP projection() const override
virtual KisSelectionMaskSP selectionMask() const
void notifyChildMaskChanged()
bool lodSupported() const
bool lodPreferred() const
KisPaintDeviceSP paintDevice() const override
static KisMemoryStatisticsServer * instance()
bool addNode(KisNodeSP node, KisNodeSP parent=KisNodeSP(), KisNodeAdditionFlags flags=KisNodeAdditionFlag::None)
void setRoot(KisNodeSP root)
virtual void aboutToRemoveANode(KisNode *parent, int index)
virtual void aboutToAddANode(KisNode *parent, int index)
virtual void requestProjectionUpdate(KisNode *node, const QVector< QRect > &rects, KisProjectionUpdateFlags flags)
virtual void nodeHasBeenAdded(KisNode *parent, int index, KisNodeAdditionFlags flags)
virtual void nodeChanged(KisNode *node)
KisNodeSP firstChild() const
QList< KisNodeSP > childNodes(const QStringList &nodeTypes, const KoProperties &properties) const
void setImage(KisImageWSP newImage) override
KisProjectionLeafSP projectionLeaf
virtual KisNodeSP clone() const =0
void setGraphListener(KisNodeGraphListener *graphListener)
KisNodeSP nextSibling() const
KisNodeGraphListener * graphListener
KisPaintDeviceSP paintDevice
QRect extent() const override
void setDirty(const QVector< QRect > &rects) override
bool hasShapeSelection() const
QRect selectedExactRect() const
Slow, but exact way of determining the rectangle that encloses the selection.
virtual void addExplicitUIUpdateRect(const QRect &rc)=0
UndoResult tryUndoLastStrokeAsync()
void unlock(bool resetLodLevels=true)
void addJob(KisStrokeId id, KisStrokeJobData *data) override
void setPostSyncLod0GUIPlaneRequestForResumeCallback(const std::function< void()> &callback)
void setProgressProxy(KoProgressProxy *progressProxy)
void setSuspendResumeUpdatesStrokeStrategyFactory(const KisSuspendResumeStrategyPairFactory &factory)
void addSpontaneousJob(KisSpontaneousJob *spontaneousJob)
KisStrokeId startStroke(KisStrokeStrategy *strokeStrategy) override
void immediateLockForReadOnly()
void setLodPreferences(const KisLodPreferences &value)
int currentLevelOfDetail() const
bool hasUpdatesRunning() const
void setLod0ToNStrokeStrategyFactory(const KisLodSyncStrokeStrategyFactory &factory)
void endStroke(KisStrokeId id) override
void explicitRegenerateLevelOfDetail()
KisLodPreferences lodPreferences() const
bool wrapAroundModeSupported() const
void setThreadsLimit(int value)
KisPostExecutionUndoAdapter * lodNPostExecutionUndoAdapter() const
void setPurgeRedoStateCallback(const std::function< void()> &callback)
bool cancelStroke(KisStrokeId id) override
void fullRefreshAsync(KisNodeSP root, const QVector< QRect > &rects, const QRect &cropRect, KisProjectionUpdateFlags flags)
void reportJobStarted(void *key)
static KisUpdateTimeMonitor * instance()
void reportUpdateFinished(const QRect &rect)
const KoColorSpace * colorSpace(const QString &colorModelId, const QString &colorDepthId, const KoColorProfile *profile)
static KoColorSpaceRegistry * instance()
const KoColorSpace * graya8(const QString &profile=QString())
const KoColorSpace * graya16(const QString &profile=QString())
const KoColorSpace * rgb8(const QString &profileName=QString())
const KoColorSpace * rgb16(const QString &profileName=QString())
const KoColorSpace * alpha8()