BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Colour scale based on viridis colour map. More...
#include <BDSColourScaleViridis.hh>
Public Member Functions | |
virtual G4Colour | GetValue (G4double numberFromZeroToOne) const |
virtual G4Colour | GetValue (G4double numberFromZeroToOne) const =0 |
Private Attributes | |
G4double | dataStep |
Static Private Attributes | |
static std::vector< std::array< G4double, 3 > > | data |
Colour scale based on viridis colour map.
This class linearly interpolates between values.
The colour map is "viridis" created by Stefan van der Walt (@stefanv) and Nathaniel Smith (@njsmith). Full credit goes to them for their excellent colour scale. Details can be found here: https://cran.r-project.org/web/packages/viridis/vignettes/intro-to-viridis.html The values hard-coded in this class come from a json file on @stefanv, in the package "scale-color-perceptual", specifically https://github.com/stefanv/scale-color-perceptual/blob/master/rgb/viridis.json
This file has 256 values and has been cut by a fraction of 1/8 to 32 values as we will linearly interpolate anyway and want to save memory.
Definition at line 49 of file BDSColourScaleViridis.hh.
BDSColourScaleViridis::BDSColourScaleViridis | ( | ) |
Definition at line 64 of file BDSColourScaleViridis.cc.
|
virtual |
Definition at line 68 of file BDSColourScaleViridis.cc.
|
virtual |
Implements BDSColourScale.
Definition at line 71 of file BDSColourScaleViridis.cc.
|
staticprivate |
Definition at line 58 of file BDSColourScaleViridis.hh.
|
private |
Definition at line 60 of file BDSColourScaleViridis.hh.