Add equality op that compares against a clamped integer

This commit is contained in:
Jonas Kulla 2013-09-27 00:55:48 +02:00
parent 35521c25c0
commit 43aacc13d9
1 changed files with 5 additions and 0 deletions

View File

@ -270,6 +270,11 @@ struct NormValue
norm = unNorm / 255.0;
}
bool operator ==(int value) const
{
return unNorm == clamp(value, 0, 255);
}
operator int() const
{
return unNorm;