42 #ifndef ACG_ICOLORCODER_HH 43 #define ACG_ICOLORCODER_HH 45 #include <ACG/Math/VectorT.hh> 46 #include <ACG/Config/ACGDefines.hh> 53 const T clamp(
const T v,
const T lo,
const T hi)
73 virtual ACG::Vec4f color_float4_raw(
float _v)
const = 0;
76 virtual float min()
const = 0;
79 virtual float max()
const = 0;
83 auto clamped = clamp(_v, min(), max());
84 auto col = color4_raw(clamped);
85 if (mapOutsideRangeToAlpha0_ && clamped != _v) {
91 virtual ACG::Vec4f color_float4(
float _v)
const {
92 auto clamped = clamp(_v, min(), max());
93 auto col = color_float4_raw(clamped);
94 if (mapOutsideRangeToAlpha0_ && clamped != _v) {
111 inline QColor color_qcolor(
float _v)
const 114 return QColor(c[0], c[1], c[2], c[3]);
118 inline ACG::Vec4f operator() (
float _v)
const {
119 return color_float4(_v);
122 void setMapOutsideRangeToAlpha0(
bool value)
124 mapOutsideRangeToAlpha0_ = value;
127 bool getMapOutsideRangeToAlpha0()
const 129 return mapOutsideRangeToAlpha0_;
133 bool mapOutsideRangeToAlpha0_ =
false;
142 #endif // ICOLORCODER_HH Namespace providing different geometric functions concerning angles.
VectorT< unsigned char, 3 > Vec3uc
VectorT< float, 3 > Vec3f