BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Colour scale based on magma colour map. More...
#include <BDSColourScaleMagma.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 magma colour map.
This class linearly interpolates between values.
The colour map is "magma" 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/magma.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 BDSColourScaleMagma.hh.
BDSColourScaleMagma::BDSColourScaleMagma | ( | ) |
Definition at line 65 of file BDSColourScaleMagma.cc.
|
virtual |
Definition at line 69 of file BDSColourScaleMagma.cc.
|
virtual |
Implements BDSColourScale.
Definition at line 72 of file BDSColourScaleMagma.cc.
|
staticprivate |
Definition at line 59 of file BDSColourScaleMagma.hh.
|
private |
Definition at line 61 of file BDSColourScaleMagma.hh.