Text archives Help
- From: sparker@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1856 - trunk/Core/Color
- Date: Tue, 20 Nov 2007 00:06:46 -0700 (MST)
Author: sparker
Date: Tue Nov 20 00:06:46 2007
New Revision: 1856
Modified:
trunk/Core/Color/ColorSpace.h
Log:
Added ability to compute min/max for color components
Modified: trunk/Core/Color/ColorSpace.h
==============================================================================
--- trunk/Core/Color/ColorSpace.h (original)
+++ trunk/Core/Color/ColorSpace.h Tue Nov 20 00:06:46 2007
@@ -199,6 +199,23 @@
return sum*(1/ComponentType(NumComponents));
}
+ ComponentType maxComponent() const
+ {
+ ComponentType max = data[0];
+ for(int i = 1; i < NumComponents; i++)
+ if(data[i] > max)
+ max = data[i];
+ return max;
+ }
+ ComponentType minComponent() const
+ {
+ ComponentType min = data[0];
+ for(int i = 1; i < NumComponents; i++)
+ if(data[i] > min)
+ min = data[i];
+ return min;
+ }
+
// Apply functor
ColorSpace<Traits> attenuate(ComponentType scale) const {
using SCIRun::Exp;
- [Manta] r1856 - trunk/Core/Color, sparker, 11/20/2007
Archive powered by MHonArc 2.6.16.