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

#include <KoCompositeOpFunctions.h>

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

Definition at line 491 of file KoCompositeOpFunctions.h.

Member Function Documentation

◆ composeChannel()

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

soft-light scales the color using sqrt and pow2 functions, hence we cannot support HDR values

Definition at line 492 of file KoCompositeOpFunctions.h.

492 {
493 using namespace Arithmetic;
494
500 qreal fsrc = scale<qreal>(src);
501 qreal fdst = scale<qreal>(dst);
502
503 if(fsrc > 0.5) {
504 qreal D = (fdst > 0.25) ? sqrt(fdst) : ((16.0*fdst - 12.0)*fdst + 4.0)*fdst;
505 return scale<T>(fdst + (2.0*fsrc - 1.0) * (D - fdst));
506 }
507
508 return scale<T>(fdst - (1.0 - 2.0 * fsrc) * fdst * (1.0 - fdst));
509 }
qreal D(qreal t, const QPointF &P0, const QPointF &P1, const QPointF &P2, const QPointF &P3, const QPointF &p)

References D().


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