Krita Source Code Documentation
Loading...
Searching...
No Matches
CFTint< HSXType, channels_type > Struct Template Reference

#include <KoCompositeOpFunctions.h>

+ Inheritance diagram for CFTint< HSXType, channels_type >:

Static Public Member Functions

static void composeChannels (float srcR, float srcG, float srcB, float &dstR, float &dstG, float &dstB)
 
- Static Public Member Functions inherited from KoClampedSourceAndDestinationCompositeOpGenericFunctorBase< channels_type >
static channels_type clampDestinationChannelValue (channels_type value)
 
static channels_type clampSourceChannelValue (channels_type value)
 

Detailed Description

template<class HSXType, typename channels_type>
struct CFTint< HSXType, channels_type >

Definition at line 123 of file KoCompositeOpFunctions.h.

Member Function Documentation

◆ composeChannels()

template<class HSXType , typename channels_type >
static void CFTint< HSXType, channels_type >::composeChannels ( float srcR,
float srcG,
float srcB,
float & dstR,
float & dstG,
float & dstB )
inlinestatic

Definition at line 125 of file KoCompositeOpFunctions.h.

125 {
126 using namespace Arithmetic;
127 // This mode is useful to change the color of a sketch, to make it easier to ink over it.
128 // Unlike the Color function above, it changes black to the src color and interpolates to white.
129
130 const float light = getLightness<HSXType>(dstR, dstG, dstB);
131 const float oneMinusLight = unitValue<float>() - light;
132 dstR = light + srcR * oneMinusLight;
133 dstG = light + srcG * oneMinusLight;
134 dstB = light + srcB * oneMinusLight;
135 }

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