Commit 2a0cdde2 authored by Lisa Avila's avatar Lisa Avila

BUG: fixed error in dependent 4 component color calculation

parent 546e4d67
......@@ -29,7 +29,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeGOHelper, "1.7");
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeGOHelper, "1.8");
vtkStandardNewMacro(vtkFixedPointVolumeRayCastCompositeGOHelper);
// Construct a new vtkFixedPointVolumeRayCastCompositeGOHelper with default values
......@@ -235,9 +235,9 @@ void vtkFixedPointCompositeGOHelperGenerateImageFourDependentNN( T *data,
continue;
}
tmp[0] = (val[0]*tmp[3]+0x7fff)>>(8);
tmp[1] = (val[1]*tmp[3]+0x7fff)>>(8);
tmp[2] = (val[2]*tmp[3]+0x7fff)>>(8);
tmp[0] = (val[0]*tmp[3]+0x7f)>>(8);
tmp[1] = (val[1]*tmp[3]+0x7f)>>(8);
tmp[2] = (val[2]*tmp[3]+0x7f)>>(8);
VTKKWRCHelper_CompositeColorAndCheckEarlyTermination( color, tmp, remainingOpacity );
}
......@@ -648,9 +648,9 @@ void vtkFixedPointCompositeGOHelperGenerateImageFourDependentTrilin( T *data,
continue;
}
tmp[0] = (val[0]*tmp[3]+0x7fff)>>8;
tmp[1] = (val[1]*tmp[3]+0x7fff)>>8;
tmp[2] = (val[2]*tmp[3]+0x7fff)>>8;
tmp[0] = (val[0]*tmp[3]+0x7f)>>8;
tmp[1] = (val[1]*tmp[3]+0x7f)>>8;
tmp[2] = (val[2]*tmp[3]+0x7f)>>8;
VTKKWRCHelper_CompositeColorAndCheckEarlyTermination( color, tmp, remainingOpacity );
}
......
......@@ -29,7 +29,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeGOShadeHelper, "1.7");
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeGOShadeHelper, "1.8");
vtkStandardNewMacro(vtkFixedPointVolumeRayCastCompositeGOShadeHelper);
// Construct a new vtkFixedPointVolumeRayCastCompositeGOShadeHelper with default values
......@@ -248,9 +248,9 @@ void vtkFixedPointCompositeGOShadeHelperGenerateImageFourDependentNN( T *data,
val[2] = *(dptr+2);
unsigned short normal = *dirPtr;
tmp[0] = (val[0]*tmp[3]+0x7fff)>>(8);
tmp[1] = (val[1]*tmp[3]+0x7fff)>>(8);
tmp[2] = (val[2]*tmp[3]+0x7fff)>>(8);
tmp[0] = (val[0]*tmp[3]+0x7f)>>(8);
tmp[1] = (val[1]*tmp[3]+0x7f)>>(8);
tmp[2] = (val[2]*tmp[3]+0x7f)>>(8);
VTKKWRCHelper_LookupShading( diffuseShadingTable[0], specularShadingTable[0], normal, tmp );
......@@ -718,9 +718,9 @@ void vtkFixedPointCompositeGOShadeHelperGenerateImageFourDependentTrilin( T *dat
needToSampleDirection = 0;
}
tmp[0] = (val[0]*tmp[3]+0x7fff)>>8;
tmp[1] = (val[1]*tmp[3]+0x7fff)>>8;
tmp[2] = (val[2]*tmp[3]+0x7fff)>>8;
tmp[0] = (val[0]*tmp[3]+0x7f)>>8;
tmp[1] = (val[1]*tmp[3]+0x7f)>>8;
tmp[2] = (val[2]*tmp[3]+0x7f)>>8;
VTKKWRCHelper_InterpolateShading( diffuseShadingTable[0], specularShadingTable[0], tmp );
VTKKWRCHelper_CompositeColorAndCheckEarlyTermination( color, tmp, remainingOpacity );
......
......@@ -29,7 +29,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeHelper, "1.7");
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeHelper, "1.8");
vtkStandardNewMacro(vtkFixedPointVolumeRayCastCompositeHelper);
// Construct a new vtkFixedPointVolumeRayCastCompositeHelper with default values
......@@ -228,9 +228,9 @@ void vtkFixedPointCompositeHelperGenerateImageFourDependentNN( T *data,
val[1] = *(dptr+1);
val[2] = *(dptr+2);
tmp[0] = (val[0]*tmp[3]+0x7fff)>>(8);
tmp[1] = (val[1]*tmp[3]+0x7fff)>>(8);
tmp[2] = (val[2]*tmp[3]+0x7fff)>>(8);
tmp[0] = (val[0]*tmp[3]+0x7f)>>(8);
tmp[1] = (val[1]*tmp[3]+0x7f)>>(8);
tmp[2] = (val[2]*tmp[3]+0x7f)>>(8);
VTKKWRCHelper_CompositeColorAndCheckEarlyTermination( color, tmp, remainingOpacity );
}
......@@ -542,9 +542,9 @@ void vtkFixedPointCompositeHelperGenerateImageFourDependentTrilin( T *data,
continue;
}
tmp[0] = (val[0]*tmp[3]+0x7fff)>>8;
tmp[1] = (val[1]*tmp[3]+0x7fff)>>8;
tmp[2] = (val[2]*tmp[3]+0x7fff)>>8;
tmp[0] = (val[0]*tmp[3]+0x7f)>>8;
tmp[1] = (val[1]*tmp[3]+0x7f)>>8;
tmp[2] = (val[2]*tmp[3]+0x7f)>>8;
VTKKWRCHelper_CompositeColorAndCheckEarlyTermination( color, tmp, remainingOpacity );
}
......
......@@ -29,7 +29,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeShadeHelper, "1.7");
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeShadeHelper, "1.8");
vtkStandardNewMacro(vtkFixedPointVolumeRayCastCompositeShadeHelper);
// Construct a new vtkFixedPointVolumeRayCastCompositeShadeHelper with default values
......@@ -225,9 +225,9 @@ void vtkFixedPointCompositeShadeHelperGenerateImageFourDependentNN( T *data,
tmp[3] = scalarOpacityTable[0][val[3]];
if ( tmp[3] )
{
tmp[0] = (val[0]*tmp[3]+0x7fff)>>(8);
tmp[1] = (val[1]*tmp[3]+0x7fff)>>(8);
tmp[2] = (val[2]*tmp[3]+0x7fff)>>(8);
tmp[0] = (val[0]*tmp[3]+0x7f)>>(8);
tmp[1] = (val[1]*tmp[3]+0x7f)>>(8);
tmp[2] = (val[2]*tmp[3]+0x7f)>>(8);
unsigned short normal = *dirPtr;
VTKKWRCHelper_LookupShading( diffuseShadingTable[0], specularShadingTable[0], normal, tmp );
......@@ -595,9 +595,9 @@ void vtkFixedPointCompositeShadeHelperGenerateImageFourDependentTrilin( T *data,
needToSampleDirection = 0;
}
tmp[0] = (val[0]*tmp[3]+0x7fff)>>8;
tmp[1] = (val[1]*tmp[3]+0x7fff)>>8;
tmp[2] = (val[2]*tmp[3]+0x7fff)>>8;
tmp[0] = (val[0]*tmp[3]+0x7f)>>8;
tmp[1] = (val[1]*tmp[3]+0x7f)>>8;
tmp[2] = (val[2]*tmp[3]+0x7f)>>8;
VTKKWRCHelper_InterpolateShading( diffuseShadingTable[0], specularShadingTable[0], tmp );
VTKKWRCHelper_CompositeColorAndCheckEarlyTermination( color, tmp, remainingOpacity );
......
......@@ -385,9 +385,9 @@
break; \
case 4: \
_alpha = SCALAROPACITYTABLE[IDX[3]]; \
COLOR[0] = static_cast<unsigned short>((IDX[0]*_alpha + 0x7fff)>>8 ); \
COLOR[1] = static_cast<unsigned short>((IDX[1]*_alpha + 0x7fff)>>8 ); \
COLOR[2] = static_cast<unsigned short>((IDX[2]*_alpha + 0x7fff)>>8 ); \
COLOR[0] = static_cast<unsigned short>((IDX[0]*_alpha + 0x7f)>>8 ); \
COLOR[1] = static_cast<unsigned short>((IDX[1]*_alpha + 0x7f)>>8 ); \
COLOR[2] = static_cast<unsigned short>((IDX[2]*_alpha + 0x7f)>>8 ); \
COLOR[3] = _alpha; \
break; \
} \
......
Markdown is supported
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