Krita Source Code Documentation
Loading...
Searching...
No Matches
GrayPixelWrapper< T > Struct Template Reference

Public Types

typedef T channel_type
 
typedef KoGrayTraits< T >::Pixel pixel_type
 

Public Member Functions

alpha () const
 
bool checkMultipliedColorsConsistent () const
 
bool checkUnmultipliedColorsConsistent (const pixel_type &mult) const
 
 GrayPixelWrapper (pixel_type &_pixel)
 
void setUnmultiplied (const pixel_type &mult, T newAlpha)
 

Public Attributes

pixel_typepixel
 

Detailed Description

template<typename T>
struct GrayPixelWrapper< T >

Definition at line 284 of file exr_converter.cc.

Member Typedef Documentation

◆ channel_type

template<typename T >
typedef T GrayPixelWrapper< T >::channel_type

Definition at line 286 of file exr_converter.cc.

◆ pixel_type

template<typename T >
typedef KoGrayTraits<T>::Pixel GrayPixelWrapper< T >::pixel_type

Definition at line 287 of file exr_converter.cc.

Constructor & Destructor Documentation

◆ GrayPixelWrapper()

template<typename T >
GrayPixelWrapper< T >::GrayPixelWrapper ( pixel_type & _pixel)
inline

Definition at line 289 of file exr_converter.cc.

289: pixel(_pixel) {}
pixel_type & pixel

Member Function Documentation

◆ alpha()

template<typename T >
T GrayPixelWrapper< T >::alpha ( ) const
inline

Definition at line 291 of file exr_converter.cc.

291 {
292 return pixel.alpha;
293 }

References KoGrayTraits< _channels_type_ >::Pixel::alpha, and GrayPixelWrapper< T >::pixel.

◆ checkMultipliedColorsConsistent()

template<typename T >
bool GrayPixelWrapper< T >::checkMultipliedColorsConsistent ( ) const
inline

Definition at line 295 of file exr_converter.cc.

295 {
296 return !(std::abs(pixel.alpha) <= alphaEpsilon<T>() &&
298 }
static bool qFuzzyIsNull(half h)

References KoGrayTraits< _channels_type_ >::Pixel::alpha, KoGrayTraits< _channels_type_ >::Pixel::gray, GrayPixelWrapper< T >::pixel, and qFuzzyIsNull().

◆ checkUnmultipliedColorsConsistent()

template<typename T >
bool GrayPixelWrapper< T >::checkUnmultipliedColorsConsistent ( const pixel_type & mult) const
inline

Definition at line 300 of file exr_converter.cc.

300 {
301 const T alpha = std::abs(pixel.alpha);
302
303 return alpha >= alphaNoiseThreshold<T>() ||
304 qFuzzyCompare(T(pixel.gray * alpha), mult.gray);
305 }
static bool qFuzzyCompare(half p1, half p2)

References KoGrayTraits< _channels_type_ >::Pixel::alpha, GrayPixelWrapper< T >::alpha(), KoGrayTraits< _channels_type_ >::Pixel::gray, GrayPixelWrapper< T >::pixel, and qFuzzyCompare().

◆ setUnmultiplied()

template<typename T >
void GrayPixelWrapper< T >::setUnmultiplied ( const pixel_type & mult,
T newAlpha )
inline

Definition at line 307 of file exr_converter.cc.

307 {
308 const T absoluteAlpha = std::abs(newAlpha);
309
310 pixel.gray = mult.gray / absoluteAlpha;
311 pixel.alpha = newAlpha;
312 }

References KoGrayTraits< _channels_type_ >::Pixel::alpha, KoGrayTraits< _channels_type_ >::Pixel::gray, and GrayPixelWrapper< T >::pixel.

Member Data Documentation

◆ pixel

template<typename T >
pixel_type& GrayPixelWrapper< T >::pixel

Definition at line 314 of file exr_converter.cc.


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