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

#include <KoCompositeOpFunctions.h>

+ Inheritance diagram for CFGammaDark< T >:

Static Public Member Functions

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

Detailed Description

template<class T>
struct CFGammaDark< T >

Definition at line 723 of file KoCompositeOpFunctions.h.

Member Function Documentation

◆ composeChannel()

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

Definition at line 724 of file KoCompositeOpFunctions.h.

724 {
725 using namespace Arithmetic;
726
727 const qreal dstReal = scale<qreal>(dst);
728
729 if (isZeroValueFuzzy(dstReal)) {
730 return zeroValue<T>();
731 }
732
733 if (isUnitValueFuzzy(dstReal)) {
734 return unitValue<T>();
735 }
736
737 // power(dst, 1/src)
738
739 const qreal srcReal = scale<qreal>(src);
740 const qreal exponent = 1.0 / srcReal;
741
742 if (std::isfinite(exponent)) {
743 return scale<T>(
744 std::min<qreal>(pow(dstReal, exponent),
746 } else {
747 return zeroValue<T>();
748 }
749 }

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