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:
@@ -258,6 +258,20 @@ Color3f Color3f::fromByteColor(ubyte r, ubyte g, ubyte b)
|
|||||||
return c;
|
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;
|
return m_rgb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace cvf
|
} // namespace cvf
|
||||||
|
|
||||||
|
|||||||
@@ -135,10 +135,13 @@ public:
|
|||||||
|
|
||||||
static Color3f fromByteColor(ubyte r, ubyte g, ubyte b);
|
static Color3f fromByteColor(ubyte r, ubyte g, ubyte b);
|
||||||
|
|
||||||
|
friend bool operator < (const Color3f& color1, const Color3f& color2);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float m_rgb[3];
|
float m_rgb[3];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool operator < (const Color3f& color1, const Color3f& color2);
|
||||||
|
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user