Krita Source Code Documentation
Loading...
Searching...
No Matches
HSVType 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 = false
 

Detailed Description

Definition at line 970 of file KoColorSpaceMaths.h.

Member Function Documentation

◆ getLightness()

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

Definition at line 973 of file KoColorSpaceMaths.h.

973 {
974 return Arithmetic::max(r,g,b);
975 }
T max(T a, T b, T c)

References Arithmetic::max().

◆ getSaturation()

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

Definition at line 978 of file KoColorSpaceMaths.h.

978 {
979 TReal max = Arithmetic::max(r, g, b);
980 TReal min = Arithmetic::min(r, g, b);
981 return (max > std::numeric_limits<TReal>::epsilon()) ? (max - min) / max : TReal(0.0);
982 }
T min(T a, T b, T c)
constexpr std::enable_if< sizeof...(values)==0, size_t >::type max()

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

Member Data Documentation

◆ lightnessIsAverage

constexpr bool HSVType::lightnessIsAverage = false
staticconstexpr

Definition at line 984 of file KoColorSpaceMaths.h.


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