From 43aacc13d9af4659b395b09b8b23460b415ab289 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Fri, 27 Sep 2013 00:55:48 +0200 Subject: [PATCH] Add equality op that compares against a clamped integer --- src/etc-internal.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/etc-internal.h b/src/etc-internal.h index 67c0a25..64a6c74 100644 --- a/src/etc-internal.h +++ b/src/etc-internal.h @@ -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;