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

#include <KoCompositeOpFunctions.h>

+ Inheritance diagram for CFPinLight< 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 CFPinLight< T >

Definition at line 571 of file KoCompositeOpFunctions.h.

Member Function Documentation

◆ composeChannel()

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

b is guaranteed to be in range 0...1 since the inputs are clamped, so no additional clamping is needed

Definition at line 572 of file KoCompositeOpFunctions.h.

572 {
573 using namespace Arithmetic;
574 using composite_type = typename KoColorSpaceMathsTraits<T>::compositetype;
575
576 // TODO: verify that the formula is correct (the first max would be useless here)
577 // max(0, max(2*src-1, min(dst, 2*src)))
578 composite_type src2 = composite_type(src) + src;
579 composite_type a = qMin<composite_type>(dst, src2);
580 composite_type b = qMax<composite_type>(src2-Arithmetic::unitValue<T>(), a);
581
586 return b;
587 }

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