Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Michael Migliore
VTK
Commits
115f9bc7
Commit
115f9bc7
authored
Oct 01, 2014
by
Dave DeMarle
Browse files
now 000 is reserved as the no value (background) color
Change-Id: I785da81295112a9e037bc7f0a09d06d2a22430bf
parent
562e93f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Rendering/OpenGL/Testing/Data/Baseline/TestValuePasses.png.md5
View file @
115f9bc7
8d9a7245142bce37a190f0069e84e40e
b52558a95fb130bfa772715d9cdcaf39
Rendering/OpenGL/vtkValuePainter.cxx
View file @
115f9bc7
...
...
@@ -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
*
0xfffff
f
;
int
valueI
=
valueS
*
0xfffff
e
+
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
)
0xfffff
f
;
double
valueS
=
(
valueI
-
0x1
)
/
(
double
)
0xfffff
e
;
//0 is reserved as "nothing"
value
=
valueS
*
scale
+
min
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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