Commit 0e77e36c authored by David Gobbi's avatar David Gobbi
Browse files

ENH: Remove old checkerboarding code.

parent ac80a0f1
...@@ -427,32 +427,3 @@ void vtkImageSliceMapper::GetDimensionIndices( ...@@ -427,32 +427,3 @@ void vtkImageSliceMapper::GetDimensionIndices(
} }
} }
} }
//----------------------------------------------------------------------------
void vtkImageSliceMapper::CheckerboardImage(
unsigned char *data, int xsize, int ysize,
const double imageSpacing[3], vtkImageProperty *property)
{
// Get the imagedata dims that correspond to the texture "x" and "y"
int xdim, ydim;
this->GetDimensionIndices(this->Orientation, xdim, ydim);
// Get the checkerboard spacing and the offset fraction
double spacing[2], offset[2];
property->GetCheckerboardSpacing(spacing);
property->GetCheckerboardOffset(offset);
// Adjust the spacing according to the image data spacing, add a tolerance
// to prefer rounding up since ties happen often and can cause different
// platforms/compilers to give different results
spacing[0] = floor(spacing[0]/imageSpacing[xdim] + 0.50000762939453125);
spacing[1] = floor(spacing[1]/imageSpacing[ydim] + 0.50000762939453125);
// Center the checkerboard at the image center, because it looks nice
offset[0] = floor(0.5*xsize + spacing[0]*offset[0] + 0.50000762939453125);
offset[1] = floor(0.5*ysize + spacing[1]*offset[1] + 0.50000762939453125);
// Note that spacing has been converted to integer spacing
vtkImageMapper3D::CheckerboardRGBA(
data, xsize, ysize, offset[0], offset[1], spacing[0], spacing[1]);
}
...@@ -154,12 +154,6 @@ protected: ...@@ -154,12 +154,6 @@ protected:
// Get the dimension indices according to the orientation. // Get the dimension indices according to the orientation.
static void GetDimensionIndices(int orientation, int &xdim, int &ydim); static void GetDimensionIndices(int orientation, int &xdim, int &ydim);
// Description:
// Do a checkerboard pattern to the alpha of an RGBA image
void CheckerboardImage(
unsigned char *data, int xsize, int ysize,
const double imageSpacing[3], vtkImageProperty *property);
vtkTimeStamp LoadTime; vtkTimeStamp LoadTime;
int SliceNumber; int SliceNumber;
int SliceNumberMinValue; int SliceNumberMinValue;
......
...@@ -232,28 +232,19 @@ void vtkOpenGLImageSliceMapper::RenderTexturedPolygon( ...@@ -232,28 +232,19 @@ void vtkOpenGLImageSliceMapper::RenderTexturedPolygon(
renWin->GetContextCreationTime() > loadTime || renWin->GetContextCreationTime() > loadTime ||
recursive) recursive)
{ {
// whether to try to use the input data directly as the texture
bool reuseData = true;
if (checkerboard && !useFragmentProgram && !this->ExactPixelMatch)
{
reuseData = false;
}
// get the data to load as a texture // get the data to load as a texture
int xsize = this->TextureSize[0]; int xsize = this->TextureSize[0];
int ysize = this->TextureSize[1]; int ysize = this->TextureSize[1];
int bytesPerPixel = this->TextureBytesPerPixel; int bytesPerPixel = this->TextureBytesPerPixel;
// whether to try to use the input data directly as the texture
bool reuseData = true;
// generate the data to be used as a texture
unsigned char *data = this->MakeTextureData( unsigned char *data = this->MakeTextureData(
(this->PassColorData ? 0 : property), input, extent, xsize, ysize, (this->PassColorData ? 0 : property), input, extent, xsize, ysize,
bytesPerPixel, reuseTexture, reuseData); bytesPerPixel, reuseTexture, reuseData);
// software fallback for checkerboarding the image
if (checkerboard && !useFragmentProgram && !this->ExactPixelMatch)
{
this->CheckerboardImage(data, xsize, ysize, spacing, property);
}
GLuint tempIndex = 0; GLuint tempIndex = 0;
#ifdef GL_VERSION_1_1 #ifdef GL_VERSION_1_1
......
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