diff --git a/Rendering/Core/vtkImageMapper3D.cxx b/Rendering/Core/vtkImageMapper3D.cxx index 494c9e4c5503bcc8a429cc20e70df74ada0d6ff0..209b7cc04ba60e26f72d09cef8f31a2178f540cc 100644 --- a/Rendering/Core/vtkImageMapper3D.cxx +++ b/Rendering/Core/vtkImageMapper3D.cxx @@ -753,21 +753,6 @@ static VTK_THREAD_RETURN_TYPE vtkImageMapperMapColors(void* arg) return VTK_THREAD_RETURN_VALUE; } -//------------------------------------------------------------------------------ -// Given an image and an extent that describes a single slice, this method -// will return a contiguous block of unsigned char data that can be loaded -// into a texture. -// The values of xsize, ysize, bytesPerPixel, and reuseTexture must be -// pre-loaded with the current texture size and depth, with subTexture -// set to 1 if only a subTexture is to be generated. -// When the method returns, these values will be set to the dimensions -// of the data that was produced, and subTexture will remain set to 1 -// if xsize,ysize describe a subtexture size. -// If subTexture is not set to one upon return, then xsize,ysize will -// describe the full texture size, with the assumption that the full -// texture must be reloaded. -// If reuseData is false upon return, then the returned array must be -// freed after use with delete []. unsigned char* vtkImageMapper3D::MakeTextureData(vtkImageProperty* property, vtkImageData* input, int extent[6], int& xsize, int& ysize, int& bytesPerPixel, bool& reuseTexture, bool& reuseData) { diff --git a/Rendering/Core/vtkImageMapper3D.h b/Rendering/Core/vtkImageMapper3D.h index d64244a98d4d705cba02e798a9c27dc74aafa127..02f63c10d28465be1e48463ada06aec457834de2 100644 --- a/Rendering/Core/vtkImageMapper3D.h +++ b/Rendering/Core/vtkImageMapper3D.h @@ -179,8 +179,19 @@ protected: /** * Perform window/level and color mapping operations to produce - * unsigned char data that can be used as a texture. See the - * source file for more information. + * unsigned char data that can be used as a texture. + * + * Given an image and an extent that describes a single slice, this method + * will return a contiguous block of unsigned char data that can be loaded + * into a texture. + * The values of xsize, ysize, bytesPerPixel, must be pre-loaded with the + * current texture size and depth. + * When the method returns, these values will be set to the dimensions + * of the data that was produced. + * The values of reuseData and reuseTexture are typically pre-loaded with true. + * If reuseTexture is false upon return, then texture size or format has changed + * If reuseData is false upon return, then the returned array must be + * freed after use with delete []. */ unsigned char* MakeTextureData(vtkImageProperty* property, vtkImageData* input, int extent[6], int& xsize, int& ysize, int& bytesPerPixel, bool& reuseTexture, bool& reuseData); diff --git a/Rendering/OpenGL2/vtkOpenGLImageSliceMapper.cxx b/Rendering/OpenGL2/vtkOpenGLImageSliceMapper.cxx index ddf9081f4488a46dcf5ddd6b81c15cb65543a78a..eb6a0a0acbabc1a09ff4cde33b82767d938a2a1a 100644 --- a/Rendering/OpenGL2/vtkOpenGLImageSliceMapper.cxx +++ b/Rendering/OpenGL2/vtkOpenGLImageSliceMapper.cxx @@ -252,9 +252,9 @@ void vtkOpenGLImageSliceMapper::RenderTexturedPolygon( input->GetMTime() > loadTime || orientationChanged || sliceChanged || recursive) { // get the data to load as a texture - int xsize; - int ysize; - int bytesPerPixel; + int xsize = this->TextureSize[0]; + int ysize = this->TextureSize[1]; + int bytesPerPixel = this->TextureBytesPerPixel; // whether to try to use the input data directly as the texture bool reuseData = true;