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

#include <KoCompositeOpFunctions.h>

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

Definition at line 329 of file KoCompositeOpFunctions.h.

Member Function Documentation

◆ composeChannel()

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

dst-unit is a stable point of color-burn belndmode, it never changes, whatever the value of src channel

Definition at line 331 of file KoCompositeOpFunctions.h.

331 {
332 using namespace Arithmetic;
333
338 if (isUnitValueStrict(dst)) {
339 return unitValue<T>();
340 }
341
342 if constexpr (std::numeric_limits<T>::is_integer) {
343 // Handle the case where the denominator is 0. See color dodge for a
344 // detailed explanation
345 if (isZeroValueStrict(src)) {
346 return zeroValue<T>();
347 }
348 }
349
350 using composite_type = typename KoColorSpaceMathsTraits<T>::compositetype;
351 composite_type divisionResult = div(inv(dst), src);
352
353 if constexpr (!std::numeric_limits<T>::is_integer) {
354 if (!std::isfinite(divisionResult)) {
355 return zeroValue<T>();
356 }
357 }
358
359 return inv<T>(clampToSDR<T>(divisionResult));
360 }
bool isUnitValueStrict(T value)
bool isZeroValueStrict(T value)
KoColorSpaceMathsTraits< T >::compositetype div(T a, T b)

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