Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Aaron Knoll
VTK-m
Commits
b18a595d
Commit
b18a595d
authored
Aug 30, 2018
by
Aaron Knoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ColorTable fix for crash on volta.
parent
1d5a40e5
Pipeline
#115089
passed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
vtkm/exec/ColorTable.hxx
vtkm/exec/ColorTable.hxx
+4
-2
No files found.
vtkm/exec/ColorTable.hxx
View file @
b18a595d
...
...
@@ -303,6 +303,8 @@ inline float DivergingAngleDiff(float a1, float a2)
VTKM_EXEC
inline
float
DivergingAdjustHue
(
const
vtkm
::
Vec
<
float
,
3
>&
msh
,
float
unsatM
)
{
const
float
sinS
=
vtkm
::
Sin
(
msh
[
1
]);
if
(
msh
[
0
]
>=
unsatM
-
0.1
f
)
{
// The best we can do is hold hue constant.
...
...
@@ -312,8 +314,7 @@ inline float DivergingAdjustHue(const vtkm::Vec<float, 3>& msh, float unsatM)
{
// This equation is designed to make the perceptual change of the
// interpolation to be close to constant.
float
hueSpin
=
(
msh
[
1
]
*
vtkm
::
Sqrt
(
unsatM
*
unsatM
-
msh
[
0
]
*
msh
[
0
])
/
(
msh
[
0
]
*
vtkm
::
Sin
(
msh
[
1
])));
float
hueSpin
=
msh
[
1
]
*
vtkm
::
Sqrt
(
unsatM
*
unsatM
-
msh
[
0
]
*
msh
[
0
])
/
(
msh
[
0
]
*
sinS
);
constexpr
float
one_third_pi
=
vtkm
::
Pi_3f
();
// Spin hue away from 0 except in purple hues.
...
...
@@ -609,6 +610,7 @@ vtkm::Vec<float, 3> ColorTableDiverging::MapThroughColorSpace(const vtkm::Vec<fl
detail
::
LabToMsh
(
lab2
,
msh2
);
// If the endpoints are distinct saturated colors, then place white in between
// them.
constexpr
float
one_third_pi
=
vtkm
::
Pi_3f
();
if
((
msh1
[
1
]
>
0.05
f
)
&&
(
msh2
[
1
]
>
0.05
f
)
&&
(
detail
::
DivergingAngleDiff
(
msh1
[
2
],
msh2
[
2
])
>
one_third_pi
))
...
...
Write
Preview
Markdown
is supported
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