Krita Source Code Documentation
Loading...
Searching...
No Matches
CFHardOverlay< T, ClampPolicy > Struct Template Reference

#include <KoCompositeOpFunctions.h>

+ Inheritance diagram for CFHardOverlay< T, ClampPolicy >:

Static Public Member Functions

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

Detailed Description

template<class T, template< typename > typename ClampPolicy>
struct CFHardOverlay< T, ClampPolicy >

Definition at line 809 of file KoCompositeOpFunctions.h.

Member Function Documentation

◆ composeChannel()

template<class T , template< typename > typename ClampPolicy>
static T CFHardOverlay< T, ClampPolicy >::composeChannel ( T src,
T dst )
inlinestatic

Definition at line 810 of file KoCompositeOpFunctions.h.

810 {
811 using namespace Arithmetic;
812 using clamp_policy = ClampPolicy<T>;
813 using composite_type = typename KoColorSpaceMathsTraits<T>::compositetype;
814
815 if (isZeroValueStrict(dst)) {
816 return zeroValue<T>();
817 }
818
819 if (isUnitValueStrict(src)) {
820 return clamp_policy::clippedMaxValue();
821 }
822
823 if(src >= halfValue<T>()) {
824 return clamp_policy::clampResultAllowNegative(
825 clamp_policy::fixInfiniteAfterDivision(
826 divideInCompositeSpace<T>(composite_type(dst),
827 2 * composite_type(inv(src)))
828 )
829 );
830 }
831
832 return clamp_policy::clampResultAllowNegative(
833 multiplyInCompositeSpace<T>(composite_type(dst),
834 2 * composite_type(src))
835 );
836 }
bool isUnitValueStrict(T value)
bool isZeroValueStrict(T value)

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