Skip to content

Add colormap option to set_data + update jet implementation.#1372

Merged
jdumas merged 5 commits intodevfrom
jdumas/colormap
Dec 2, 2019
Merged

Add colormap option to set_data + update jet implementation.#1372
jdumas merged 5 commits intodevfrom
jdumas/colormap

Conversation

@jdumas
Copy link
Copy Markdown
Collaborator

@jdumas jdumas commented Dec 1, 2019

Check all that apply (change to [x])

@jdumas jdumas changed the base branch from master to dev December 1, 2019 19:29
@jdumas
Copy link
Copy Markdown
Collaborator Author

jdumas commented Dec 1, 2019

I'm also tempted to simply mark jet as deprecated and add the turbo colormap:
https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html

@alecjacobson
Copy link
Copy Markdown
Contributor

alecjacobson commented Dec 1, 2019 via email

}

IGL_INLINE void igl::opengl::ViewerData::set_data( const Eigen::VectorXd & D)
IGL_INLINE void igl::opengl::ViewerData::set_data( const Eigen::VectorXd & D, igl::ColorMapType cmap)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep a set_data(D) that uses a default colormap.

We should also use const for input params.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm about default. Found the default it in the .h

@jdumas
Copy link
Copy Markdown
Collaborator Author

jdumas commented Dec 1, 2019

Ok I switched jet to turbo. Here is a comparison:

Jet:
2019-12-01-165823_1280x800_scrot

Turbo:
2019-12-01-165843_1273x814_scrot

@jdumas
Copy link
Copy Markdown
Collaborator Author

jdumas commented Dec 1, 2019

Btw I'm also questioning if we should make Parula our default colormap. Matplotlib developed Viridis and co. because Parula is copyrighted by Matworks. Do we really want to make it our default colormap, or should we stick with Viridis?

@alecjacobson
Copy link
Copy Markdown
Contributor

alecjacobson commented Dec 2, 2019 via email

@jdumas
Copy link
Copy Markdown
Collaborator Author

jdumas commented Dec 2, 2019

That's fine meaning ok to switch to viridis, or ok to keep parula?

@alecjacobson
Copy link
Copy Markdown
Contributor

alecjacobson commented Dec 2, 2019 via email

@alecjacobson
Copy link
Copy Markdown
Contributor

alecjacobson commented Dec 2, 2019 via email

@jdumas
Copy link
Copy Markdown
Collaborator Author

jdumas commented Dec 2, 2019

You mean this website? Their colormaps are defined here. Should be easy to integrate into libigl.

EDIT: Also seems to be available in this CSV file.

@jdumas
Copy link
Copy Markdown
Collaborator Author

jdumas commented Dec 2, 2019

I've switched to Viridis by default. Should be close enough to Parula to not perturb the tutorials. I'll merge once the build passes. We can add the colorbrew palette in a separate PR. Given that these are discrete colormaps, we can add a function to directly return the colorbar given the number of steps required by the user.

@jdumas jdumas merged commit 77ed624 into dev Dec 2, 2019
@jdumas jdumas deleted the jdumas/colormap branch December 14, 2019 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants