Commit 115f9bc7 authored by Dave DeMarle's avatar Dave DeMarle
Browse files

now 000 is reserved as the no value (background) color

Change-Id: I785da81295112a9e037bc7f0a09d06d2a22430bf
parent 562e93f9
8d9a7245142bce37a190f0069e84e40e
b52558a95fb130bfa772715d9cdcaf39
......@@ -243,7 +243,7 @@ void vtkValuePainter::ValueToColor(double value, double min, double scale,
double valueS = (value - min)/scale;
valueS = (valueS<0.0?0.0:valueS); //prevent underflow
valueS = (valueS>1.0?1.0:valueS); //prevent overflow
int valueI = valueS * 0xffffff;
int valueI = valueS * 0xfffffe + 0x1; //0 is reserved as "nothing"
color[0] = (unsigned char)((valueI & 0xff0000)>>16);
color[1] = (unsigned char)((valueI & 0x00ff00)>>8);
......@@ -256,7 +256,7 @@ void vtkValuePainter::ColorToValue(unsigned char *color, double min, double scal
{
//TODO: make this configurable
int valueI = ((int)(*(color+0)))<<16 | ((int)(*(color+1)))<<8 | ((int)(*(color+2)));
double valueS = valueI/(double)0xffffff;
double valueS = (valueI-0x1)/(double)0xfffffe; //0 is reserved as "nothing"
value = valueS*scale + min;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment