Krita Source Code Documentation
Loading...
Searching...
No Matches
KisImage::KisImagePrivate Class Reference

Classes

struct  SetImageProjectionColorSpace
 

Public Member Functions

void convertImageColorSpaceImpl (const KoColorSpace *dstColorSpace, bool convertLayers, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags)
 
 KisImagePrivate (KisImage *_q, qint32 w, qint32 h, const KoColorSpace *c, KisUndoStore *undo, KisImageAnimationInterface *_animationInterface)
 
void notifyProjectionUpdatedInPatches (const QRect &rc, QVector< KisRunnableStrokeJobData * > &jobs)
 
void requestProjectionUpdateImpl (KisNode *node, const QVector< QRect > &rects, const QRect &cropRect, KisProjectionUpdateFlags flags)
 
bool tryCancelCurrentStrokeAsync ()
 
void updateHDRMetadataOnColorSpaceChange (const KoColorSpace *newColorSpace)
 
 ~KisImagePrivate ()
 

Public Attributes

bool allowMasksOnRootNode = false
 
KisImageAnimationInterfaceanimationInterface
 
vKisAnnotationSP annotations
 
QPointF axesCenter
 
const KoColorSpacecolorSpace
 
std::optional< KisColorVolumeInformationcolorVolumeInformation
 
KisCompositeProgressProxy compositeProgressProxy
 
QList< KisLayerCompositionSPcompositions
 
KisSelectionMaskSP deselectedGlobalSelectionMask
 
std::optional< double > diffuseWhiteLightLevel
 
QAtomicInt disableDirtyRequests
 
QStack< KisProjectionUpdatesFilterCookiedisabledUpdatesCookies
 
QAtomicInt disableUIUpdateSignals
 
KisImageGlobalSelectionManagementInterface globalSelectionInterface
 
qint32 height
 
bool isolateGroup
 
bool isolateLayer
 
KisNodeSP isolationRootNode
 
KisLegacyUndoAdapter legacyUndoAdapter
 
quint32 lockCount = 0
 
bool lockedForReadOnly
 
KisSelectionMaskSP overlaySelectionMask
 
KisPostExecutionUndoAdapter postExecutionUndoAdapter
 
QVector< KisProjectionUpdatesFilterSPprojectionUpdatesFilters
 
KisProofingConfigurationSP proofingConfig
 
KisImageq
 
std::optional< KisRelativeContentLightLevelInformationrelativeContentLightLevelInformation
 
KisGroupLayerSP rootLayer
 
KisLocklessStack< QRect > savedDisabledUIUpdates
 
KisUpdateScheduler scheduler
 
KisImageSignalRouter signalRouter
 
KisSelectionMaskSP targetOverlaySelectionMask
 
QScopedPointer< KisUndoStoreundoStore
 
qint32 width
 
WrapAroundAxis wrapAroundModeAxis = WRAPAROUND_BOTH
 
bool wrapAroundModePermitted = false
 
double xres = 1.0
 
double yres = 1.0
 

Detailed Description

Definition at line 121 of file kis_image.cc.

Constructor & Destructor Documentation

◆ KisImagePrivate()

KisImage::KisImagePrivate::KisImagePrivate ( KisImage * _q,
qint32 w,
qint32 h,
const KoColorSpace * c,
KisUndoStore * undo,
KisImageAnimationInterface * _animationInterface )
inline

Definition at line 124 of file kis_image.cc.

128 : q(_q)
129 , lockedForReadOnly(false)
130 , width(w)
131 , height(h)
132 , colorSpace(c ? c : KoColorSpaceRegistry::instance()->rgb8())
134 , isolateLayer(false)
135 , isolateGroup(false)
137 , legacyUndoAdapter(undoStore.data(), _q)
139 , signalRouter(_q)
140 , animationInterface(_animationInterface)
141 , scheduler(_q, _q)
142 , axesCenter(QPointF(0.5, 0.5))
143 {
144 {
145 KisImageConfig cfg(true);
146 if (cfg.enableProgressReporting()) {
148 }
149
150 // Each of these lambdas defines a new factory function.
152 [=](bool forgettable) {
153 return KisLodSyncPair(
156 });
157
159 [=]() {
161
166
167 return std::make_pair(suspend, resume);
168 });
169
171 [this] () {
172 undoStore->purgeRedoState();
173 });
174
176 [this] () {
177
179
180 bool addedUIUpdateRequestSuccessfully = false;
181
182 for (auto it = std::make_reverse_iterator(projectionUpdatesFilters.end());
183 it != std::make_reverse_iterator(projectionUpdatesFilters.begin());
184 ++it) {
185
188
189 if (iface) {
191 addedUIUpdateRequestSuccessfully = true;
192 break;
193 }
194 }
195
196 KIS_SAFE_ASSERT_RECOVER_NOOP(addedUIUpdateRequestSuccessfully);
197 });
198 }
199
201
202 connect(q, SIGNAL(sigImageModified()), KisMemoryStatisticsServer::instance(), SLOT(notifyImageChanged()));
203 connect(undoStore.data(), SIGNAL(historyStateChanged()), &signalRouter, SLOT(emitImageModifiedNotification()));
204 }
PythonPluginManager * instance
The KisDumbUndoStore class doesn't actually save commands, so you cannot undo or redo!
KisCompositeProgressProxy compositeProgressProxy
Definition kis_image.cc:282
KisImageAnimationInterface * animationInterface
Definition kis_image.cc:278
KisUpdateScheduler scheduler
Definition kis_image.cc:279
KisImageGlobalSelectionManagementInterface globalSelectionInterface
Definition kis_image.cc:251
void updateHDRMetadataOnColorSpaceChange(const KoColorSpace *newColorSpace)
Definition kis_image.cc:305
KisPostExecutionUndoAdapter postExecutionUndoAdapter
Definition kis_image.cc:267
KisLegacyUndoAdapter legacyUndoAdapter
Definition kis_image.cc:266
QScopedPointer< KisUndoStore > undoStore
Definition kis_image.cc:265
const KoColorSpace * colorSpace
Definition kis_image.cc:248
QVector< KisProjectionUpdatesFilterSP > projectionUpdatesFilters
Definition kis_image.cc:275
KisImageSignalRouter signalRouter
Definition kis_image.cc:277
void sigImageModified()
int currentLevelOfDetail() const
QRect bounds() const override
static QList< KisStrokeJobData * > createSuspendJobsData(KisImageWSP image)
static QList< KisStrokeJobData * > createResumeJobsData(KisImageWSP image)
static QList< KisStrokeJobData * > createJobsData(KisImageWSP image)
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130
std::pair< KisStrokeStrategy *, QList< KisStrokeJobData * > > KisSuspendResumePair
std::pair< KisStrokeStrategy *, QList< KisStrokeJobData * > > KisLodSyncPair
KisWeakSharedPtr< KisImage > KisImageWSP
Definition kis_types.h:70
QAction * undo(const QObject *recvr, const char *slot, QObject *parent)
static KisMemoryStatisticsServer * instance()
void setPostSyncLod0GUIPlaneRequestForResumeCallback(const std::function< void()> &callback)
void setProgressProxy(KoProgressProxy *progressProxy)
void setSuspendResumeUpdatesStrokeStrategyFactory(const KisSuspendResumeStrategyPairFactory &factory)
void setLod0ToNStrokeStrategyFactory(const KisLodSyncStrokeStrategyFactory &factory)
void setPurgeRedoStateCallback(const std::function< void()> &callback)

References KisSuspendProjectionUpdatesStrokeStrategy::SuspendUpdatesFilterInterface::addExplicitUIUpdateRect(), KisImage::bounds(), colorSpace, compositeProgressProxy, KisSyncLodCacheStrokeStrategy::createJobsData(), KisSuspendProjectionUpdatesStrokeStrategy::createResumeJobsData(), KisSuspendProjectionUpdatesStrokeStrategy::createSharedData(), KisSuspendProjectionUpdatesStrokeStrategy::createSuspendJobsData(), KisImage::currentLevelOfDetail(), KisImageConfig::enableProgressReporting(), KisMemoryStatisticsServer::instance(), KIS_SAFE_ASSERT_RECOVER_NOOP, projectionUpdatesFilters, q, scheduler, KisUpdateScheduler::setLod0ToNStrokeStrategyFactory(), KisUpdateScheduler::setPostSyncLod0GUIPlaneRequestForResumeCallback(), KisUpdateScheduler::setProgressProxy(), KisUpdateScheduler::setPurgeRedoStateCallback(), KisUpdateScheduler::setSuspendResumeUpdatesStrokeStrategyFactory(), KisImage::sigImageModified(), signalRouter, undoStore, and updateHDRMetadataOnColorSpaceChange().

◆ ~KisImagePrivate()

KisImage::KisImagePrivate::~KisImagePrivate ( )
inline

First delete the nodes, while strokes and undo are still alive

Firstly we need to disconnect the nodes from the image, because some of the nodes (e.g. KisGroupLayer) may request the image back via defaultBouds() and/or animationInterface()

Stop animation interface. It may use the rootLayer.

Definition at line 206 of file kis_image.cc.

206 {
214
221 if (rootLayer->image() == q) {
223 }
224
225 if (rootLayer->graphListener() == q) {
227 }
228
230
234 delete animationInterface;
235 }
KisGroupLayerSP rootLayer
Definition kis_image.cc:253
KisImageWSP image
void setImage(KisImageWSP image) override
void setGraphListener(KisNodeGraphListener *graphListener)
Definition kis_node.cpp:289
KisNodeGraphListener * graphListener
Definition kis_node.cpp:87

References animationInterface, KisSharedPtr< T >::clear(), KisNode::graphListener, KisBaseNode::image, KIS_SAFE_ASSERT_RECOVER_NOOP, q, rootLayer, KisNode::setGraphListener(), and KisGroupLayer::setImage().

Member Function Documentation

◆ convertImageColorSpaceImpl()

void KisImage::KisImagePrivate::convertImageColorSpaceImpl ( const KoColorSpace * dstColorSpace,
bool convertLayers,
KoColorConversionTransformation::Intent renderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags )

Definition at line 1428 of file kis_image.cc.

1432{
1433 const KoColorSpace *srcColorSpace = this->colorSpace;
1434
1435 if (!dstColorSpace || *srcColorSpace == *dstColorSpace) return;
1436
1437 const KUndo2MagicString actionName =
1438 convertLayers ?
1439 kundo2_i18n("Convert Image Color Space") :
1440 kundo2_i18n("Convert Projection Color Space");
1441
1442 KisImageSignalVector emitSignals;
1443 emitSignals << ColorSpaceChangedSignal;
1444
1445 KisProcessingApplicator::ProcessingFlags flags = KisProcessingApplicator::NO_UI_UPDATES;
1446 if (convertLayers) {
1448 }
1449
1450 KisProcessingApplicator applicator(q, this->rootLayer,
1451 flags,
1452 emitSignals, actionName);
1453
1454 applicator.applyCommand(
1455 new KisImagePrivate::SetImageProjectionColorSpace(dstColorSpace,
1456 KisImageWSP(q),
1459
1460 applicator.applyVisitor(
1462 srcColorSpace, dstColorSpace,
1463 renderingIntent, conversionFlags),
1465
1466 applicator.applyCommand(
1467 new KisImagePrivate::SetImageProjectionColorSpace(srcColorSpace,
1468 KisImageWSP(q),
1471
1472
1473 applicator.end();
1474}
@ ColorSpaceChangedSignal
KUndo2MagicString kundo2_i18n(const char *text)

References KisProcessingApplicator::applyCommand(), KisProcessingApplicator::applyVisitor(), KisStrokeJobData::BARRIER, colorSpace, ColorSpaceChangedSignal, KisStrokeJobData::CONCURRENT, KisProcessingApplicator::end(), KisCommandUtils::FlipFlopCommand::FINALIZING, KisCommandUtils::FlipFlopCommand::INITIALIZING, kundo2_i18n(), KisProcessingApplicator::NO_UI_UPDATES, q, KisProcessingApplicator::RECURSIVE, and rootLayer.

◆ notifyProjectionUpdatedInPatches()

void KisImage::KisImagePrivate::notifyProjectionUpdatedInPatches ( const QRect & rc,
QVector< KisRunnableStrokeJobData * > & jobs )

Definition at line 2005 of file kis_image.cc.

2006{
2007 KisImageConfig imageConfig(true);
2008 int patchWidth = imageConfig.updatePatchWidth();
2009 int patchHeight = imageConfig.updatePatchHeight();
2010
2011 for (int y = 0; y < rc.height(); y += patchHeight) {
2012 for (int x = 0; x < rc.width(); x += patchWidth) {
2013 QRect patchRect(x, y, patchWidth, patchHeight);
2014 patchRect &= rc;
2015
2017 }
2018 }
2019}
void notifyProjectionUpdated(const QRect &rc) override
void addJobConcurrent(QVector< Job * > &jobs, Func func)

References KritaUtils::addJobConcurrent(), KisImage::notifyProjectionUpdated(), KisImageConfig::updatePatchHeight(), and KisImageConfig::updatePatchWidth().

◆ requestProjectionUpdateImpl()

void KisImage::KisImagePrivate::requestProjectionUpdateImpl ( KisNode * node,
const QVector< QRect > & rects,
const QRect & cropRect,
KisProjectionUpdateFlags flags )

Definition at line 2476 of file kis_image.cc.

2481{
2482 if (rects.isEmpty()) return;
2483
2484 scheduler.updateProjection(node, rects, cropRect, flags);
2485}
void updateProjection(KisNodeSP node, const QVector< QRect > &rects, const QRect &cropRect, KisProjectionUpdateFlags flags)

◆ tryCancelCurrentStrokeAsync()

bool KisImage::KisImagePrivate::tryCancelCurrentStrokeAsync ( )

Definition at line 2235 of file kis_image.cc.

2236{
2238}

◆ updateHDRMetadataOnColorSpaceChange()

void KisImage::KisImagePrivate::updateHDRMetadataOnColorSpaceChange ( const KoColorSpace * newColorSpace)
inline

Definition at line 305 of file kis_image.cc.

305 {
306 const KoColorProfile *profile = newColorSpace->profile();
307 if (!profile) return;
308
309 if (profile->hdrReferenceWhite()) {
313 } else if (!newColorSpace->hasHighDynamicRange()) {
315 colorVolumeInformation = std::nullopt;
316 diffuseWhiteLightLevel = std::nullopt;
317 }
318 }
@ TRC_ITU_R_BT_2100_0_PQ
std::optional< KisRelativeContentLightLevelInformation > relativeContentLightLevelInformation
Definition kis_image.cc:284
std::optional< double > diffuseWhiteLightLevel
Definition kis_image.cc:286
std::optional< KisColorVolumeInformation > colorVolumeInformation
Definition kis_image.cc:285
const KoColorProfile * profile() const
virtual bool hasHighDynamicRange() const =0
virtual const KoColorProfile * profile() const =0
virtual std::optional< double > hdrReferenceWhite() const =0
hdrReferenceWhite HDR reference white is only available for Perceptual Quantizer profiles that save t...
virtual TransferCharacteristics getTransferCharacteristics() const
getTransferCharacteristics This function should be subclassed at some point so we can get the value f...

References colorVolumeInformation, diffuseWhiteLightLevel, KoColorProfile::getTransferCharacteristics(), KoColorSpace::hasHighDynamicRange(), KoColorProfile::hdrReferenceWhite(), KisImage::profile(), KoColorSpace::profile(), relativeContentLightLevelInformation, and TRC_ITU_R_BT_2100_0_PQ.

Member Data Documentation

◆ allowMasksOnRootNode

bool KisImage::KisImagePrivate::allowMasksOnRootNode = false

Definition at line 289 of file kis_image.cc.

◆ animationInterface

KisImageAnimationInterface* KisImage::KisImagePrivate::animationInterface

Definition at line 278 of file kis_image.cc.

◆ annotations

vKisAnnotationSP KisImage::KisImagePrivate::annotations

Definition at line 269 of file kis_image.cc.

◆ axesCenter

QPointF KisImage::KisImagePrivate::axesCenter

Definition at line 288 of file kis_image.cc.

◆ colorSpace

const KoColorSpace* KisImage::KisImagePrivate::colorSpace

Definition at line 248 of file kis_image.cc.

◆ colorVolumeInformation

std::optional<KisColorVolumeInformation> KisImage::KisImagePrivate::colorVolumeInformation

Definition at line 285 of file kis_image.cc.

◆ compositeProgressProxy

KisCompositeProgressProxy KisImage::KisImagePrivate::compositeProgressProxy

Definition at line 282 of file kis_image.cc.

◆ compositions

QList<KisLayerCompositionSP> KisImage::KisImagePrivate::compositions

Definition at line 256 of file kis_image.cc.

◆ deselectedGlobalSelectionMask

KisSelectionMaskSP KisImage::KisImagePrivate::deselectedGlobalSelectionMask

Definition at line 252 of file kis_image.cc.

◆ diffuseWhiteLightLevel

std::optional<double> KisImage::KisImagePrivate::diffuseWhiteLightLevel

Definition at line 286 of file kis_image.cc.

◆ disableDirtyRequests

QAtomicInt KisImage::KisImagePrivate::disableDirtyRequests

Definition at line 280 of file kis_image.cc.

◆ disabledUpdatesCookies

QStack<KisProjectionUpdatesFilterCookie> KisImage::KisImagePrivate::disabledUpdatesCookies

Definition at line 276 of file kis_image.cc.

◆ disableUIUpdateSignals

QAtomicInt KisImage::KisImagePrivate::disableUIUpdateSignals

Definition at line 271 of file kis_image.cc.

◆ globalSelectionInterface

KisImageGlobalSelectionManagementInterface KisImage::KisImagePrivate::globalSelectionInterface

Definition at line 251 of file kis_image.cc.

◆ height

qint32 KisImage::KisImagePrivate::height

Definition at line 243 of file kis_image.cc.

◆ isolateGroup

bool KisImage::KisImagePrivate::isolateGroup

Definition at line 260 of file kis_image.cc.

◆ isolateLayer

bool KisImage::KisImagePrivate::isolateLayer

Definition at line 259 of file kis_image.cc.

◆ isolationRootNode

KisNodeSP KisImage::KisImagePrivate::isolationRootNode

Definition at line 258 of file kis_image.cc.

◆ legacyUndoAdapter

KisLegacyUndoAdapter KisImage::KisImagePrivate::legacyUndoAdapter

Definition at line 266 of file kis_image.cc.

◆ lockCount

quint32 KisImage::KisImagePrivate::lockCount = 0

Definition at line 239 of file kis_image.cc.

◆ lockedForReadOnly

bool KisImage::KisImagePrivate::lockedForReadOnly

Definition at line 240 of file kis_image.cc.

◆ overlaySelectionMask

KisSelectionMaskSP KisImage::KisImagePrivate::overlaySelectionMask

Definition at line 255 of file kis_image.cc.

◆ postExecutionUndoAdapter

KisPostExecutionUndoAdapter KisImage::KisImagePrivate::postExecutionUndoAdapter

Definition at line 267 of file kis_image.cc.

◆ projectionUpdatesFilters

QVector<KisProjectionUpdatesFilterSP> KisImage::KisImagePrivate::projectionUpdatesFilters

Definition at line 275 of file kis_image.cc.

◆ proofingConfig

KisProofingConfigurationSP KisImage::KisImagePrivate::proofingConfig

Definition at line 249 of file kis_image.cc.

◆ q

KisImage* KisImage::KisImagePrivate::q

Definition at line 237 of file kis_image.cc.

◆ relativeContentLightLevelInformation

std::optional<KisRelativeContentLightLevelInformation> KisImage::KisImagePrivate::relativeContentLightLevelInformation

Definition at line 284 of file kis_image.cc.

◆ rootLayer

KisGroupLayerSP KisImage::KisImagePrivate::rootLayer

Definition at line 253 of file kis_image.cc.

◆ savedDisabledUIUpdates

KisLocklessStack<QRect> KisImage::KisImagePrivate::savedDisabledUIUpdates

Definition at line 272 of file kis_image.cc.

◆ scheduler

KisUpdateScheduler KisImage::KisImagePrivate::scheduler

Definition at line 279 of file kis_image.cc.

◆ signalRouter

KisImageSignalRouter KisImage::KisImagePrivate::signalRouter

Definition at line 277 of file kis_image.cc.

◆ targetOverlaySelectionMask

KisSelectionMaskSP KisImage::KisImagePrivate::targetOverlaySelectionMask

Definition at line 254 of file kis_image.cc.

◆ undoStore

QScopedPointer<KisUndoStore> KisImage::KisImagePrivate::undoStore

Definition at line 265 of file kis_image.cc.

◆ width

qint32 KisImage::KisImagePrivate::width

Definition at line 242 of file kis_image.cc.

◆ wrapAroundModeAxis

WrapAroundAxis KisImage::KisImagePrivate::wrapAroundModeAxis = WRAPAROUND_BOTH

Definition at line 263 of file kis_image.cc.

◆ wrapAroundModePermitted

bool KisImage::KisImagePrivate::wrapAroundModePermitted = false

Definition at line 262 of file kis_image.cc.

◆ xres

double KisImage::KisImagePrivate::xres = 1.0

Definition at line 245 of file kis_image.cc.

◆ yres

double KisImage::KisImagePrivate::yres = 1.0

Definition at line 246 of file kis_image.cc.


The documentation for this class was generated from the following file: