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

#include <KoCompositeOpFunctions.h>

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

Definition at line 514 of file KoCompositeOpFunctions.h.

Member Function Documentation

◆ composeChannel()

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

Definition at line 515 of file KoCompositeOpFunctions.h.

515 {
516 using namespace Arithmetic;
517
518 qreal fsrc = scale<qreal>(src);
519 qreal fdst = scale<qreal>(dst);
520
521 if(fsrc > 0.5) {
522 // lerp(dst, sqrt(dst), (2.0 * fsrc - 1.0))
523 return scale<T>(fdst + (2.0 * fsrc - 1.0) * (sqrt(fdst) - fdst));
524 }
525
526 // lerp(dst, dst^2, (1.0 - 2.0 * fsrc))
527 return scale<T>(fdst - (1.0 - 2.0*fsrc) * fdst * (1.0 - fdst));
528 }

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