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

#include <KoCompositeOpFunctions.h>

+ Inheritance diagram for CFDivide< T >:

Static Public Member Functions

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

Detailed Description

template<class T>
struct CFDivide< T >

Definition at line 441 of file KoCompositeOpFunctions.h.

Member Function Documentation

◆ composeChannel()

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

Since input values are clamped, we can never get a negative infinity as a result of an operation. Hence we can just clamp the result to SDR safely.

Definition at line 442 of file KoCompositeOpFunctions.h.

442 {
443 using namespace Arithmetic;
444 using composite_type = typename KoColorSpaceMathsTraits<T>::compositetype;
445
446 if (isZeroValueStrict(dst)) {
447 return zeroValue<T>();
448 }
449
450 if (isZeroValueStrict(src)) {
451 return unitValue<T>();
452 }
453
454 composite_type result = div(dst, src);
455
461 return clampToSDRTop<T>(result);
462 }
bool isZeroValueStrict(T value)
KoColorSpaceMathsTraits< T >::compositetype div(T a, T b)

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