Krita Source Code Documentation
Loading...
Searching...
No Matches
KoMixColorsOpImpl< _CSTrait >::WeightsWrapper Struct Reference

Public Types

typedef KoColorSpaceMathsTraits< typename_CSTrait::channels_type >::mixtype mixtype
 

Public Member Functions

void nextPixel ()
 
int normalizeFactor () const
 
void premultiplyAlphaWithWeight (mixtype &alpha) const
 
 WeightsWrapper (const qint16 *weights, int weightSum)
 

Private Attributes

int m_sumOfWeights {0}
 
const qint16 * m_weights
 

Detailed Description

template<class _CSTrait>
struct KoMixColorsOpImpl< _CSTrait >::WeightsWrapper

Definition at line 139 of file KoMixColorsOpImpl.h.

Member Typedef Documentation

◆ mixtype

template<class _CSTrait >
typedef KoColorSpaceMathsTraits<typename_CSTrait::channels_type>::mixtype KoMixColorsOpImpl< _CSTrait >::WeightsWrapper::mixtype

Definition at line 141 of file KoMixColorsOpImpl.h.

Constructor & Destructor Documentation

◆ WeightsWrapper()

template<class _CSTrait >
KoMixColorsOpImpl< _CSTrait >::WeightsWrapper::WeightsWrapper ( const qint16 * weights,
int weightSum )
inline

Definition at line 143 of file KoMixColorsOpImpl.h.

144 : m_weights(weights), m_sumOfWeights(weightSum)
145 {
146 }

Member Function Documentation

◆ nextPixel()

template<class _CSTrait >
void KoMixColorsOpImpl< _CSTrait >::WeightsWrapper::nextPixel ( )
inline

Definition at line 148 of file KoMixColorsOpImpl.h.

148 {
149 m_weights++;
150 }

References KoMixColorsOpImpl< _CSTrait >::WeightsWrapper::m_weights.

◆ normalizeFactor()

template<class _CSTrait >
int KoMixColorsOpImpl< _CSTrait >::WeightsWrapper::normalizeFactor ( ) const
inline

Definition at line 156 of file KoMixColorsOpImpl.h.

156 {
157 return m_sumOfWeights;
158 }

References KoMixColorsOpImpl< _CSTrait >::WeightsWrapper::m_sumOfWeights.

◆ premultiplyAlphaWithWeight()

template<class _CSTrait >
void KoMixColorsOpImpl< _CSTrait >::WeightsWrapper::premultiplyAlphaWithWeight ( mixtype & alpha) const
inline

Definition at line 152 of file KoMixColorsOpImpl.h.

152 {
153 alpha *= *m_weights;
154 }

References KoMixColorsOpImpl< _CSTrait >::WeightsWrapper::m_weights.

Member Data Documentation

◆ m_sumOfWeights

template<class _CSTrait >
int KoMixColorsOpImpl< _CSTrait >::WeightsWrapper::m_sumOfWeights {0}
private

Definition at line 162 of file KoMixColorsOpImpl.h.

162{0};

◆ m_weights

template<class _CSTrait >
const qint16* KoMixColorsOpImpl< _CSTrait >::WeightsWrapper::m_weights
private

Definition at line 161 of file KoMixColorsOpImpl.h.


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