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

Public Member Functions

float fixupChroma (float c, float v)
 
bool hasChroma (float v)
 
float valueFromRGB (float r, float g, float b, float m, float M)
 
void writeRGB (float *r, float *g, float *b, int sextant, float x, float c, float v)
 

Detailed Description

Definition at line 145 of file kis_hsv_adjustment.cpp.

Member Function Documentation

◆ fixupChroma()

float HCIPolicy::fixupChroma ( float c,
float v )
inline

Definition at line 158 of file kis_hsv_adjustment.cpp.

158 {
159 static const float oneThird = 1.0f / 3.0f;
160
161 if (v >= oneThird) {
162 c = qMin(c, 1.5f * (1.0f - v));
163 } else {
164 c = qMin(c, 3.0f * v);
165 }
166
167 return c;
168 }
qreal v

References v.

◆ hasChroma()

bool HCIPolicy::hasChroma ( float v)
inline

Definition at line 147 of file kis_hsv_adjustment.cpp.

147 {
148 static const float EPSILON = 1e-9f;
149 return v > EPSILON && v < 1.0f - EPSILON;
150 }
#define EPSILON

References EPSILON, and v.

◆ valueFromRGB()

float HCIPolicy::valueFromRGB ( float r,
float g,
float b,
float m,
float M )
inline

Definition at line 152 of file kis_hsv_adjustment.cpp.

152 {
153 Q_UNUSED(m);
154 Q_UNUSED(M);
155 return (r + g + b) / 3.0f;
156 }

◆ writeRGB()

void HCIPolicy::writeRGB ( float * r,
float * g,
float * b,
int sextant,
float x,
float c,
float v )
inline

Definition at line 170 of file kis_hsv_adjustment.cpp.

172 {
173
174 static const float oneThird = 1.0f / 3.0f;
175
176 const float m = v - oneThird * (c + x);
177 const float M = c + m;
178
179 writeRGBSimple(r, g, b, sextant, x, m, M);
180 }
static void writeRGBSimple(float *r, float *g, float *b, int sextant, float x, float m, float M)

References v, and writeRGBSimple().


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