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;
199 connect(
undoStore.data(), SIGNAL(historyStateChanged()), &
signalRouter, SLOT(emitImageModifiedNotification()));
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()) {
884 PurgeUnusedDataStroke(
KisImageSP image,
bool isCancellable)
892 this->enableJob(JOB_DOSTROKE,
true);
895 setClearsRedoOnStart(!isCancellable);
896 setRequestsOtherStrokesToEnd(!isCancellable);
897 setCanForgetAboutMe(isCancellable);
900 void initStrokeCallback()
override
907 [&paintDevicesList, &projectionsList,
this](
KisNodeSP node) {
908 KisPaintDeviceList deviceList = node->getLodCapableDevices();
910 Q_FOREACH (KisPaintDeviceSP dev, deviceList) {
915 if (dev == node->paintDevice() && !canForgetAboutMe()) {
916 paintDevicesList << dev;
918 projectionsList << dev;
929 projectionsList.removeAll(dev);
937 paintDevicesList << projectionsList;
938 projectionsList.clear();
947 addMutatedJobs(jobsData);
950 void finishStrokeCallback()
override {
951 for (
auto it = m_transactions.begin(); it != m_transactions.end(); ++it) {
952 QScopedPointer<KUndo2Command> cmd(it->endAndTake());
962 m_transactions.clear();
964 m_finalCommand->redo();
965 m_image->postExecutionUndoAdapter()->addCommand(
toQShared(m_finalCommand.take()));
970 if (node->preferredThumbnailBoundsMode() != KisThumbnailBoundsMode::Precise) {
971 node->setPreferredThumbnailBoundsMode(KisThumbnailBoundsMode::Precise);
978 QScopedPointer<KUndo2Command> m_finalCommand;
979 std::vector<KisTransaction> m_transactions;
982 KisStrokeId id = startStroke(
new PurgeUnusedDataStroke(
this, isCancellable));
988 const bool isLayer = qobject_cast<KisLayer*>(node.
data());
1001 emitSignals, actionName, extraData);
1019 bool sizeChanged =
size != this->
size();
1021 if (!resolutionChanged && !sizeChanged)
return;
1031 KisProcessingApplicator::ProcessingFlags signalFlags =
1032 (resolutionChanged || sizeChanged) ?
1038 emitSignals, actionName);
1040 qreal sx = qreal(
size.width()) / this->
size().width();
1041 qreal sy = qreal(
size.height()) / this->
size().height();
1043 QTransform shapesCorrection;
1045 if (resolutionChanged) {
1046 shapesCorrection = QTransform::fromScale(
xRes() / xres,
yRes() / yres);
1059 if (resolutionChanged) {
1089 QTransform transform = worker.
transform();
1091 offset = center - transform.map(center);
1096 emitSignals, actionName);
1102 offset.x(), offset.y(),
1140 else if (selection) {
1145 baseBounds = baseBounds.united(node->
exactBounds());
1158 QTransform transform = worker.
transform();
1161 QRect newRect = transform.mapRect(baseBounds);
1162 newSize = newRect.size();
1163 offset = -newRect.topLeft();
1166 QPointF origin = QRectF(baseBounds).center();
1169 offset = -(transform.map(origin) - origin);
1174 (newSize.width() != baseBounds.width() ||
1175 newSize.height() != baseBounds.height());
1182 KisProcessingApplicator::ProcessingFlags signalFlags =
1190 emitSignals, actionName);
1197 offset.x(), offset.y(),
1227 if (nodes.size() == 1 && nodes[0]->inherits(
"KisMask")) {
1231 rotateImpl(
kundo2_i18np(
"Rotate Layer",
"Rotate %1 Layers", nodes.size()), nodes, radians,
false, selection);
1238 double angleX,
double angleY,
1246 double angleX,
double angleY,
1253 else if (selection) {
1258 baseBounds = baseBounds.united(node->
exactBounds());
1261 const QPointF origin = QRectF(baseBounds).center();
1264 const qreal pi = 3.1415926535897932385;
1265 const qreal deg2rad = pi / 180.0;
1267 qreal tanX = tan(angleX * deg2rad);
1268 qreal tanY = tan(angleY * deg2rad);
1280 QRect newRect = worker.
transform().mapRect(baseBounds);
1281 newSize = newRect.size();
1283 else offset = origin - worker.
transform().map(origin);
1286 if (newSize == baseBounds.size())
return;
1291 KisProcessingApplicator::ProcessingFlags signalFlags =
1297 emitSignals, actionName);
1305 offset.x(), offset.y(),
1331 if (nodes.size() == 1 && nodes[0]->inherits(
"KisMask")) {
1333 angleX, angleY, selection);
1337 angleX, angleY, selection);
1350 KoColorConversionTransformation::ConversionFlags conversionFlags)
1358 if (!dstColorSpace || *srcColorSpace == *dstColorSpace)
return;
1367 emitSignals, actionName);
1371 srcColorSpace, dstColorSpace,
1372 renderingIntent, conversionFlags),
1404 KoColorConversionTransformation::ConversionFlags conversionFlags)
1408 if (!dstColorSpace || *srcColorSpace == *dstColorSpace)
return;
1419 if (convertLayers) {
1425 emitSignals, actionName);
1435 srcColorSpace, dstColorSpace,
1436 renderingIntent, conversionFlags),
1451 KoColorConversionTransformation::ConversionFlags conversionFlags)
1469 KisProcessingApplicator::ProcessingFlags flags =
1474 emitSignals, actionName);
1500 if (!dstColorSpace)
return false;
1505 emitSignals, actionName);
1509 srcColorSpace, dstColorSpace),
1525 imageProfileIsSame &=
1528 return *node->colorSpace()->profile() != *profile;
1531 if (imageProfileIsSame) {
1542 if (!dstColorSpace)
return false;
1549 emitSignals, actionName);
1559 srcColorSpace, dstColorSpace),
1604 qWarning() <<
"WARNING: Ignoring attempt to set image x resolution <= 0 (" << xres <<
")!";
1610 qWarning() <<
"WARNING: Ignoring attempt to set image y resolution <= 0 (" << yres <<
")!";
1616 return QPointF(documentCoord.x() *
xRes(), documentCoord.y() *
yRes());
1622 return QPoint(qFloor(pixelCoord.x()), qFloor(pixelCoord.y()));
1632 return QPointF(pixelCoord.x() /
xRes(), pixelCoord.y() /
yRes());
1637 return QPointF((pixelCoord.x() + 0.5) /
xRes(), (pixelCoord.y() + 0.5) /
yRes());
1680 return visitor.
count();
1692 return visitor.
count();
1703 childNode->accept(visitor);
1705 return visitor.
count();
1741 imageRect.getRect(&x, &y, &w, &h);
1752 if (!dev)
return QImage();
1764 if (scaledImageSize.isEmpty()) {
1772 double scaleX = qreal(scaledImageSize.width()) /
width();
1773 double scaleY = qreal(scaledImageSize.height()) /
height();
1776 if (scaleX < 1.0/256 || scaleY < 1.0/256) {
1804 QRect boundRect =
bounds();
1809 boundRect = t.
map(boundRect);
1909 if ((*it) && (*it)->type() == type) {
1913 qWarning() <<
"Skipping deleted annotation";
1924 if ((*it)->type() == type) {
1983 for (
int y = 0; y < rc.height(); y += patchHeight) {
1984 for (
int x = 0; x < rc.width(); x += patchWidth) {
1985 QRect patchRect(x, y, patchWidth, patchHeight);
1997 if ((isolateLayer || isolateGroup) ==
false)
return false;
2006 StartIsolatedModeStroke(
KisNodeSP node,
KisImageSP image,
bool isolateLayer,
bool isolateGroup)
2011 m_isolateLayer(isolateLayer),
2012 m_isolateGroup(isolateGroup)
2015 this->enableJob(JOB_DOSTROKE,
true);
2017 setClearsRedoOnStart(
false);
2020 void initStrokeCallback()
override {
2021 if (m_isolateLayer ==
false && m_isolateGroup ==
true) {
2023 m_newRoot = m_newRoot->parent() ? m_newRoot->parent() : m_newRoot;
2027 m_newRoot->projectionLeaf()->explicitlyRegeneratePassThroughProjection();
2028 m_prevRoot = m_image->m_d->isolationRootNode;
2030 const bool beforeVisibility = m_newRoot->projectionLeaf()->visible();
2031 const bool prevRootBeforeVisibility = m_prevRoot ? m_prevRoot->projectionLeaf()->visible() :
false;
2033 m_image->m_d->isolationRootNode = m_newRoot;
2034 Q_EMIT m_image->sigIsolatedModeChanged();
2036 const bool afterVisibility = m_newRoot->projectionLeaf()->visible();
2037 const bool prevRootAfterVisibility = m_prevRoot ? m_prevRoot->projectionLeaf()->visible() :
false;
2039 m_newRootNeedsFullRefresh = beforeVisibility != afterVisibility;
2040 m_prevRootNeedsFullRefresh = prevRootBeforeVisibility != prevRootAfterVisibility;
2043 void finishStrokeCallback()
override {
2047 if (m_prevRoot && m_prevRootNeedsFullRefresh) {
2048 m_image->refreshGraphAsync(m_prevRoot);
2051 if (m_newRootNeedsFullRefresh) {
2052 m_image->refreshGraphAsync(m_newRoot);
2055 if (!m_prevRootNeedsFullRefresh && !m_newRootNeedsFullRefresh) {
2057 m_image->m_d->notifyProjectionUpdatedInPatches(m_image->bounds(), jobs);
2058 this->runnableJobsInterface()->addRunnableJobs(jobs);
2061 m_image->invalidateAllFrames();
2068 bool m_newRootNeedsFullRefresh =
false;
2069 bool m_prevRootNeedsFullRefresh =
false;
2071 bool m_isolateLayer;
2072 bool m_isolateGroup;
2089 m_oldRootNode(
nullptr),
2090 m_oldNodeNeedsRefresh(
false)
2092 this->enableJob(JOB_INIT);
2093 this->enableJob(JOB_DOSTROKE,
true);
2095 setClearsRedoOnStart(
false);
2098 void initStrokeCallback()
override {
2099 if (!m_image->m_d->isolationRootNode)
return;
2101 m_oldRootNode = m_image->m_d->isolationRootNode;
2103 const bool beforeVisibility = m_oldRootNode->projectionLeaf()->visible();
2104 m_image->m_d->isolationRootNode = 0;
2105 m_image->m_d->isolateLayer =
false;
2106 m_image->m_d->isolateGroup =
false;
2107 Q_EMIT m_image->sigIsolatedModeChanged();
2108 const bool afterVisibility = m_oldRootNode->projectionLeaf()->visible();
2110 m_oldNodeNeedsRefresh = (beforeVisibility != afterVisibility);
2113 void finishStrokeCallback()
override {
2115 m_image->invalidateAllFrames();
2117 if (m_oldNodeNeedsRefresh){
2118 m_oldRootNode->setDirty(m_image->bounds());
2127 m_image->m_d->notifyProjectionUpdatedInPatches(m_image->bounds(), jobs);
2128 this->runnableJobsInterface()->addRunnableJobs(jobs);
2135 bool m_oldNodeNeedsRefresh;
2174 return scheduler.tryCancelCurrentStrokeAsync();
2242 if (leaf->shouldBeRendered()) {
2243 for (
auto it = changeRects.begin(); it != changeRects.end(); ++it) {
2248 leaf = leaf->nextSibling();
2251 std::swap(requestedRects, changeRects);
2267 if ((*it)->filterRefreshGraph(
this,
root.
data(), requestedRects, cropRect, flags)) {
2360 postponedUpdates.append(
rect);
2363 return postponedUpdates;
2374 if (dirtyRect.isEmpty())
return;
2416 const QRect &cropRect,
2417 KisProjectionUpdateFlags flags)
2419 if (rects.isEmpty())
return;
2421 scheduler.updateProjection(node, rects, cropRect, flags);
2436 if ((*it)->filter(
this, node, rects, flags)) {
2457 Q_FOREACH (
const QRect &rc, rects) {
2459 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
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)
typedef void(QOPENGLF_APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC)(GLuint buffer)
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()