template<class _CSTrait>
class KoMixColorsOpImpl< _CSTrait >::MixDataResult
Definition at line 188 of file KoMixColorsOpImpl.h.
template<class _CSTrait >
FIXME: The following code relies on the unit value for floating point spaces being 1.0 We should be using the division functions in KoColorSpaceMaths for this, but right now it is not clear how to call these functions.
Definition at line 206 of file KoMixColorsOpImpl.h.
206 {
207#ifdef SANITY_CHECKS
208
210 std::numeric_limits<mix_type>::max() /
pow2(
mix_type(MathsTraits::unitValue));
211
212 if (m_numPixels > maxSaneNumPixels) {
213 qWarning() << "SANITY CHECK FAILED: KoMixColorOp got too many pixels to mix, the containing type may overflow";
214 qWarning() <<
" " <<
ppVar(m_numPixels);
215 qWarning() <<
" " <<
ppVar(maxSaneNumPixels);
216 }
217#endif
218
220
227
228 for (int i = 0; i < (int)_CSTrait::channels_nb; i++) {
229 if (i != _CSTrait::alpha_pos) {
230
232
233 if (
v > MathsTraits::max) {
234 v = MathsTraits::max;
235 }
236 if (
v < MathsTraits::min) {
237 v = MathsTraits::min;
238 }
240 }
241 }
242
243 if (_CSTrait::alpha_pos != -1) {
245
246 if (
v > MathsTraits::max) {
247 v = MathsTraits::max;
248 }
249 if (
v < MathsTraits::min) {
250 v = MathsTraits::min;
251 }
252 dstColor[ _CSTrait::alpha_pos ] =
v;
253 }
254 } else {
255 memset(dst, 0,
sizeof(
channels_type) * _CSTrait::channels_nb);
256 }
257 }
static T safeDivideWithRound(T dividend, std::enable_if_t<!std::numeric_limits< T >::is_integer, T > divisor)
References KoMixColorsOpImpl< _CSTrait >::MixDataResult::normalizeFactor, pow2(), ppVar, safeDivideWithRound(), KoMixColorsOpImpl< _CSTrait >::MixDataResult::totalAlpha, KoMixColorsOpImpl< _CSTrait >::MixDataResult::totals, and v.