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

#include <KoCompositeOpFunctions.h>

+ Inheritance diagram for CFLambertLighting< 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 CFLambertLighting< HSXType, channels_type >

Definition at line 139 of file KoCompositeOpFunctions.h.

Member Function Documentation

◆ composeChannels()

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

Definition at line 141 of file KoCompositeOpFunctions.h.

141 {
142 float tr = srcR * dstR * (1.0 / 0.215686);
143 float tg = srcG * dstG * (1.0 / 0.215686);
144 float tb = srcB * dstB * (1.0 / 0.215686);
145
146 if (tr > 1.0) {
147 dstR = 1.0 + (tr - 1.0) * (tr - 1.0) * 0.01925;
148 }
149 else {
150 dstR = tr;
151 }
152
153 if (tg > 1.0) {
154 dstG = 1.0 + (tg - 1.0) * (tg - 1.0) * 0.01925;
155 }
156 else {
157 dstG = tg;
158 }
159
160 if (tb > 1.0) {
161 dstB = 1.0 + (tb - 1.0) * (tb - 1.0) * 0.01925;
162 }
163 else {
164 dstB = tb;
165 }
166
167 ToneMapping<HSXType, float>(dstR, dstG, dstB);
168 }

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