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

#include <KoCompositeOpFunctions.h>

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

Definition at line 172 of file KoCompositeOpFunctions.h.

Member Function Documentation

◆ composeChannels()

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

Definition at line 174 of file KoCompositeOpFunctions.h.

174 {
175 float tr = srcR * dstR * 2.0;
176 float tg = srcG * dstG * 2.0;
177 float tb = srcB * dstB * 2.0;
178
179 if (tr > 1.0) {
180 dstR = 1.0 + (tr - 1.0) * (tr - 1.0) * 0.4;
181 }
182 else {
183 dstR = tr;
184 }
185
186 if (tg > 1.0) {
187 dstG = 1.0 + (tg - 1.0) * (tg - 1.0) * 0.4;
188 }
189 else {
190 dstG = tg;
191 }
192
193 if (tb > 1.0) {
194 dstB = 1.0 + (tb - 1.0) * (tb - 1.0) * 0.4;
195 }
196 else {
197 dstB = tb;
198 }
199
200 ToneMapping<HSXType, float>(dstR, dstG, dstB);
201 }

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