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

#include <KoCompositeOpFunctions.h>

+ Inheritance diagram for CFHardLight< T >:

Static Public Member Functions

static T composeChannel (T src, T dst)
 
- Static Public Member Functions inherited from KoClampedSourceCompositeOpGenericFunctorBase< T >
static T clampDestinationChannelValue (T value)
 
static T clampSourceChannelValue (T value)
 

Detailed Description

template<class T>
struct CFHardLight< T >

Definition at line 466 of file KoCompositeOpFunctions.h.

Member Function Documentation

◆ composeChannel()

template<class T >
static T CFHardLight< T >::composeChannel ( T src,
T dst )
inlinestatic

Definition at line 467 of file KoCompositeOpFunctions.h.

467 {
468 using namespace Arithmetic;
469 using composite_type = typename KoColorSpaceMathsTraits<T>::compositetype;
470
471 if (isHalfValueFuzzy(src)) {
472 return dst;
473 }
474
475 composite_type src2 = composite_type(src) + src;
476
477 if(src > halfValue<T>()) {
478 // screen(src*2.0 - 1.0, dst)
479 src2 -= unitValue<T>();
480
481 // src2 is guaranteed to be smaller than unitValue<T>() now
482 return Arithmetic::unionShapeOpacity(T(src2), dst);
483 }
484
485 // src2 is guaranteed to be smaller than unitValue<T>() due to 'if'
486 return Arithmetic::mul(T(src2), dst);
487 }
T mul(T a, T b)
T unionShapeOpacity(T a, T b)

References Arithmetic::mul(), and Arithmetic::unionShapeOpacity().


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