Krita Source Code Documentation
Loading...
Searching...
No Matches
HSYType Struct Reference

#include <KoColorSpaceMaths.h>

Static Public Member Functions

template<class TReal >
static TReal getLightness (TReal r, TReal g, TReal b)
 
template<class TReal >
static TReal getSaturation (TReal r, TReal g, TReal b)
 

Static Public Attributes

static constexpr bool lightnessIsAverage = true
 

Detailed Description

Definition at line 909 of file KoColorSpaceMaths.h.

Member Function Documentation

◆ getLightness()

template<class TReal >
static TReal HSYType::getLightness ( TReal r,
TReal g,
TReal b )
inlinestatic

Definition at line 912 of file KoColorSpaceMaths.h.

912 {
913 return TReal(0.299)*r + TReal(0.587)*g + TReal(0.114)*b;
914 }

◆ getSaturation()

template<class TReal >
static TReal HSYType::getSaturation ( TReal r,
TReal g,
TReal b )
inlinestatic

Definition at line 917 of file KoColorSpaceMaths.h.

917 {
918 return Arithmetic::max(r,g,b) - Arithmetic::min(r,g,b);
919 }
T max(T a, T b, T c)
T min(T a, T b, T c)

References Arithmetic::max(), and Arithmetic::min().

Member Data Documentation

◆ lightnessIsAverage

constexpr bool HSYType::lightnessIsAverage = true
staticconstexpr

Definition at line 921 of file KoColorSpaceMaths.h.


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