mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Color3f. Add operator <
This commit is contained in:
parent
0e832fad06
commit
5d672356d2
@ -258,6 +258,20 @@ Color3f Color3f::fromByteColor(ubyte r, ubyte g, ubyte b)
|
||||
return c;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool operator < (const Color3f& color1, const Color3f& color2)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if (color1.m_rgb[i] > color2.m_rgb[i])
|
||||
return false;
|
||||
else if (color1.m_rgb[i] < color2.m_rgb[i])
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
@ -432,6 +446,5 @@ const ubyte* Color3ub::ptr() const
|
||||
return m_rgb;
|
||||
}
|
||||
|
||||
|
||||
} // namespace cvf
|
||||
|
||||
|
@ -135,10 +135,13 @@ public:
|
||||
|
||||
static Color3f fromByteColor(ubyte r, ubyte g, ubyte b);
|
||||
|
||||
friend bool operator < (const Color3f& color1, const Color3f& color2);
|
||||
|
||||
private:
|
||||
float m_rgb[3];
|
||||
};
|
||||
|
||||
bool operator < (const Color3f& color1, const Color3f& color2);
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
|
Loading…
Reference in New Issue
Block a user