Why the rect is artificial? That's easy! It does not represent any real piece of the image. It is intentionally stretched to get through the overlapping stripes of neutrality and poke neighbouring tiles. Thanks to the rect we get the coordinates of all the tiles involved into update process
53{
55
57 if (updateRect.isEmpty()) return info;
58
61
62 auto needCreateProofingTransform =
63 [this] () {
64 return !
m_d->proofingTransform &&
65 m_d->proofingConfig &&
67 };
68
69
70 if (convertColorSpace && needCreateProofingTransform()) {
71
72 QWriteLocker locker(&
m_d->lock);
73 if (needCreateProofingTransform()) {
75 m_d->proofingConfig->proofingDepth,
76 m_d->proofingConfig->proofingProfile);
78 KoColorConversionTransformation::ConversionFlags displayFlags =
m_d->proofingConfig->determineDisplayFlags(
m_d->conversionOptions.m_conversionFlags);
79
82 m_d->conversionOptions.m_destinationColorSpace,
83 proofingSpace,
84 m_d->proofingConfig->conversionIntent,
85 displayIntent,
86 m_d->proofingConfig->useBlackPointCompensationFirstTransform,
87 m_d->proofingConfig->warningColor,
88 displayFlags));
89 }
90 }
91
92 QReadLocker locker(&
m_d->lock);
93
103 QRect artificialRect =
kisGrowRect(updateRect,
m_d->textureBorder);
105
106 int firstColumn =
xToCol(artificialRect.left());
107 int lastColumn =
xToCol(artificialRect.right());
108 int firstRow =
yToRow(artificialRect.top());
109 int lastRow =
yToRow(artificialRect.bottom());
110
112
113 if (!
m_d->channelFlags.isEmpty() &&
115
117 }
118
119 qint32 numItems = (lastColumn - firstColumn + 1) * (lastRow - firstRow + 1);
121
122 QRect alignedUpdateRect = updateRect;
123 QRect alignedBounds =
bounds;
124
125 if (levelOfDetail) {
128 }
129
130 for (int col = firstColumn; col <= lastColumn; col++) {
131 for (int row = firstRow; row <= lastRow; row++) {
132
134
137 alignedTileTextureRect,
138 alignedUpdateRect,
139 alignedBounds,
140 levelOfDetail,
142
143 if (tileInfo->valid()) {
144 tileInfo->retrieveData(projection,
channelFlags,
m_d->onlyOneChannelSelected,
m_d->selectedChannelIndex);
145
146 if (convertColorSpace) {
147 if (
m_d->proofingTransform) {
148 tileInfo->proofTo(
m_d->conversionOptions.m_destinationColorSpace,
m_d->proofingConfig->displayFlags,
m_d->proofingTransform.data());
149 } else {
150 tileInfo->convertTo(
m_d->conversionOptions.m_destinationColorSpace,
m_d->conversionOptions.m_renderingIntent,
m_d->conversionOptions.m_conversionFlags);
151 }
152 }
153
155 }
156 else {
157 dbgUI <<
"Trying to create an empty tileinfo record" << col << row << alignedTileTextureRect << updateRect <<
bounds;
158 }
159 }
160 }
161
164 return info;
165}
KisTextureTileUpdateInfoSPList tileList
void assignLevelOfDetail(int lod)
void assignDirtyImageRect(const QRect &rect)
const KoColorSpace * colorSpace() const
static KoColorConversionTransformation * generateProofingTransform(const KoColorSpace *srcCS, const KoColorSpace *dstCS, const KoColorSpace *proofingSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::Intent proofingIntent, bool bpcFirstTransform, KoColor gamutWarning, KoColorConversionTransformation::ConversionFlags displayConversionFlags)
virtual quint32 channelCount() const =0
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
T kisGrowRect(const T &rect, U offset)
QRect calculatePhysicalTileRect(int col, int row, const QRect &imageBounds, int levelOfDetail) const
const KoColorSpace * colorSpace(const QString &colorModelId, const QString &colorDepthId, const KoColorProfile *profile)
static KoColorSpaceRegistry * instance()