Skip to content

Commit 690ab56

Browse files
committed
Remove DeepSkyObject::hsv2rgb()
1 parent 84d5da0 commit 690ab56

File tree

2 files changed

+1
-59
lines changed

2 files changed

+1
-59
lines changed

src/celengine/deepskyobj.cpp

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -79,66 +79,10 @@ bool DeepSkyObject::pick(const Eigen::ParametrizedLine<double, 3>& ray,
7979
cosAngleToBoundCenter);
8080
else
8181
return false;
82-
}
83-
84-
85-
void DeepSkyObject::hsv2rgb( float *r, float *g, float *b, float h, float s, float v )
86-
{
87-
// r,g,b values are from 0 to 1
88-
// h = [0,360], s = [0,1], v = [0,1]
89-
90-
int i;
91-
float f, p, q, t;
92-
93-
if( s == 0 )
94-
{
95-
// achromatic (grey)
96-
*r = *g = *b = v;
97-
return;
98-
}
99-
100-
h /= 60; // sector 0 to 5
101-
i = static_cast<int>(std::floor( h ));
102-
f = h - static_cast<float>(i); // factorial part of h
103-
p = v * ( 1 - s );
104-
q = v * ( 1 - s * f );
105-
t = v * ( 1 - s * ( 1 - f ) );
10682

107-
switch( i )
108-
{
109-
case 0:
110-
*r = v;
111-
*g = t;
112-
*b = p;
113-
break;
114-
case 1:
115-
*r = q;
116-
*g = v;
117-
*b = p;
118-
break;
119-
case 2:
120-
*r = p;
121-
*g = v;
122-
*b = t;
123-
break;
124-
case 3:
125-
*r = p;
126-
*g = q;
127-
*b = v;
128-
break;
129-
case 4:
130-
*r = t;
131-
*g = p;
132-
*b = v;
133-
break;
134-
default:
135-
*r = v;
136-
*g = p;
137-
*b = q;
138-
break;
139-
}
14083
}
14184

85+
14286
bool DeepSkyObject::load(const AssociativeArray* params, const fs::path& resPath)
14387
{
14488
// Get position

src/celengine/deepskyobj.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ class DeepSkyObject
4040
Eigen::Vector3d getPosition() const;
4141
void setPosition(const Eigen::Vector3d&);
4242

43-
static void hsv2rgb( float*, float*, float*, float, float, float);
44-
4543
virtual const char* getType() const = 0;
4644
virtual void setType(const std::string&) = 0;
4745
virtual std::string getDescription() const;

0 commit comments

Comments
 (0)