Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christian Butz
VTK
Commits
0e77e36c
Commit
0e77e36c
authored
Jun 17, 2011
by
David Gobbi
Browse files
ENH: Remove old checkerboarding code.
parent
ac80a0f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Rendering/vtkImageSliceMapper.cxx
View file @
0e77e36c
...
...
@@ -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
]);
}
Rendering/vtkImageSliceMapper.h
View file @
0e77e36c
...
...
@@ -154,12 +154,6 @@ protected:
// Get the dimension indices according to the orientation.
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
;
int
SliceNumber
;
int
SliceNumberMinValue
;
...
...
Rendering/vtkOpenGLImageSliceMapper.cxx
View file @
0e77e36c
...
...
@@ -232,28 +232,19 @@ void vtkOpenGLImageSliceMapper::RenderTexturedPolygon(
renWin
->
GetContextCreationTime
()
>
loadTime
||
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
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
;
// generate the data to be used as a texture
unsigned
char
*
data
=
this
->
MakeTextureData
(
(
this
->
PassColorData
?
0
:
property
),
input
,
extent
,
xsize
,
ysize
,
bytesPerPixel
,
reuseTexture
,
reuseData
);
// software fallback for checkerboarding the image
if
(
checkerboard
&&
!
useFragmentProgram
&&
!
this
->
ExactPixelMatch
)
{
this
->
CheckerboardImage
(
data
,
xsize
,
ysize
,
spacing
,
property
);
}
GLuint
tempIndex
=
0
;
#ifdef GL_VERSION_1_1
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment