#include <cpExtensions/Visualization/ImageBlender.h>
-#include <cmath>
#include <cstring>
#include <vtkDataObject.h>
}
else
{
- r = double( 1 );
- g = b = double( 0 );
+ TColor c;
+ r = c.R;
+ g = c.G;
+ b = c.B;
} // fi
}
);
if( c > double( 0 ) )
{
- double cr, cg, cb;
- this->GetColor( i, cr, cg, cb );
- double n = std::sqrt( ( cr * cr ) + ( cg * cg ) + ( cb * cb ) );
- r *= cr * n;
- g *= cg * n;
- b *= cb * n;
+ TColor rgb = this->m_Colors[ i ];
+ r *= rgb.R * rgb.N;
+ g *= rgb.G * rgb.N;
+ b *= rgb.B * rgb.N;
a = _1;
} // fi
#include <cpExtensions/cpExtensions_Export.h>
+#include <cmath>
#include <map>
+
#include <vtkThreadedImageAlgorithm.h>
namespace cpExtensions
protected:
struct TColor
{
- double R, G, B;
+ double R, G, B, N;
TColor(
const double& r = double( 1 ),
const double& g = double( 0 ),
: R( r ),
G( g ),
B( b )
- { }
+ {
+ this->N = std::sqrt( ( r * r ) + ( g * g ) + ( b * b ) );
+ }
};
mutable std::map< unsigned int, TColor > m_Colors;