SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
RasterColorRamp Struct Reference

Gradient mapping from a normalised value in [0,1] to a QColor. More...

#include <colorramp.h>

Collaboration diagram for RasterColorRamp:

Public Member Functions

QColor colorAt (double normalisedPos) const
 
QColor colorForValue (double value) const
 
QJsonObject toJson () const
 

Static Public Member Functions

static RasterColorRamp fromJson (const QJsonObject &j)
 
static RasterColorRamp grayscale (double min=0.0, double max=255.0)
 
static RasterColorRamp viridis (double min=0.0, double max=1.0)
 
static RasterColorRamp plasma (double min=0.0, double max=1.0)
 
static RasterColorRamp magma (double min=0.0, double max=1.0)
 
static RasterColorRamp inferno (double min=0.0, double max=1.0)
 
static RasterColorRamp cividis (double min=0.0, double max=1.0)
 
static RasterColorRamp turbo (double min=0.0, double max=1.0)
 
static RasterColorRamp rdBu (double min=0.0, double max=1.0)
 
static RasterColorRamp rdYlGn (double min=0.0, double max=1.0)
 
static RasterColorRamp spectral (double min=0.0, double max=1.0)
 
static RasterColorRamp brBG (double min=0.0, double max=1.0)
 
static RasterColorRamp legacySWMM5Interval (double min=0.0, double max=1.0)
 
static RasterColorRamp legacySWMMPollutant (double min=0.0, double max=1.0)
 
static RasterColorRamp terrain (double min=0.0, double max=1.0)
 
static RasterColorRamp plotly3 (double min=0.0, double max=1.0)
 
static RasterColorRamp iceFire (double min=0.0, double max=1.0)
 
static RasterColorRamp blackbody (double min=0.0, double max=1.0)
 
static RasterColorRamp electric (double min=0.0, double max=1.0)
 
static RasterColorRamp hot (double min=0.0, double max=1.0)
 
static RasterColorRamp jet (double min=0.0, double max=1.0)
 
static RasterColorRamp picnic (double min=0.0, double max=1.0)
 
static RasterColorRamp portland (double min=0.0, double max=1.0)
 
static RasterColorRamp rainbow (double min=0.0, double max=1.0)
 
static RasterColorRamp bluered (double min=0.0, double max=1.0)
 
static RasterColorRamp waterDepth (double min=0.0, double max=1.0)
 
static RasterColorRamp builtin (const QString &name)
 
static QStringList builtinNames ()
 

Public Attributes

double minValue = 0.0
 
double maxValue = 1.0
 
QGradientStops stops
 
bool clampMin = false
 
bool clampMax = false
 
RampInterp interp = RampInterp::Rgb
 

Detailed Description

Gradient mapping from a normalised value in [0,1] to a QColor.

Member Function Documentation

◆ blackbody()

RasterColorRamp RasterColorRamp::blackbody ( double  min = 0.0,
double  max = 1.0 
)
static

◆ bluered()

RasterColorRamp RasterColorRamp::bluered ( double  min = 0.0,
double  max = 1.0 
)
static

◆ brBG()

RasterColorRamp RasterColorRamp::brBG ( double  min = 0.0,
double  max = 1.0 
)
static

◆ builtin()

RasterColorRamp RasterColorRamp::builtin ( const QString &  name)
static

Look up a built-in ramp by short name (case-insensitive). Returns grayscale() when the name is unknown so callers never get an invalid ramp. Recognised names: "grayscale", "viridis", "plasma", "magma", "inferno", "cividis", "turbo", "rdbu", "rdylgn", "spectral", "brbg", "legacy-swmm-5interval", "legacy-swmm-pollutant", "terrain", plus Slice BB-β Plotly entries: "plotly3", "icefire", "blackbody", "electric", "hot", "jet", "picnic", "portland", "rainbow", "bluered", and the 2026-09-01 depth-fill default "water-depth".

Here is the call graph for this function:
Here is the caller graph for this function:

◆ builtinNames()

QStringList RasterColorRamp::builtinNames ( )
static

Names of all built-in ramps, in catalogue order. Used by the ColorRampComboBox to populate its dropdown.

◆ cividis()

RasterColorRamp RasterColorRamp::cividis ( double  min = 0.0,
double  max = 1.0 
)
static

◆ colorAt()

QColor RasterColorRamp::colorAt ( double  normalisedPos) const

Interpolated colour for a normalised position in [0,1].

Here is the caller graph for this function:

◆ colorForValue()

QColor RasterColorRamp::colorForValue ( double  value) const

Colour for a raw data value (normalises to [0,1] then calls colorAt).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ electric()

RasterColorRamp RasterColorRamp::electric ( double  min = 0.0,
double  max = 1.0 
)
static

◆ fromJson()

RasterColorRamp RasterColorRamp::fromJson ( const QJsonObject &  j)
static
Here is the caller graph for this function:

◆ grayscale()

RasterColorRamp RasterColorRamp::grayscale ( double  min = 0.0,
double  max = 255.0 
)
static
Here is the caller graph for this function:

◆ hot()

RasterColorRamp RasterColorRamp::hot ( double  min = 0.0,
double  max = 1.0 
)
static

◆ iceFire()

RasterColorRamp RasterColorRamp::iceFire ( double  min = 0.0,
double  max = 1.0 
)
static

◆ inferno()

RasterColorRamp RasterColorRamp::inferno ( double  min = 0.0,
double  max = 1.0 
)
static

◆ jet()

RasterColorRamp RasterColorRamp::jet ( double  min = 0.0,
double  max = 1.0 
)
static

◆ legacySWMM5Interval()

RasterColorRamp RasterColorRamp::legacySWMM5Interval ( double  min = 0.0,
double  max = 1.0 
)
static

◆ legacySWMMPollutant()

RasterColorRamp RasterColorRamp::legacySWMMPollutant ( double  min = 0.0,
double  max = 1.0 
)
static

◆ magma()

RasterColorRamp RasterColorRamp::magma ( double  min = 0.0,
double  max = 1.0 
)
static

◆ picnic()

RasterColorRamp RasterColorRamp::picnic ( double  min = 0.0,
double  max = 1.0 
)
static

◆ plasma()

RasterColorRamp RasterColorRamp::plasma ( double  min = 0.0,
double  max = 1.0 
)
static

◆ plotly3()

RasterColorRamp RasterColorRamp::plotly3 ( double  min = 0.0,
double  max = 1.0 
)
static

◆ portland()

RasterColorRamp RasterColorRamp::portland ( double  min = 0.0,
double  max = 1.0 
)
static

◆ rainbow()

RasterColorRamp RasterColorRamp::rainbow ( double  min = 0.0,
double  max = 1.0 
)
static

◆ rdBu()

RasterColorRamp RasterColorRamp::rdBu ( double  min = 0.0,
double  max = 1.0 
)
static

◆ rdYlGn()

RasterColorRamp RasterColorRamp::rdYlGn ( double  min = 0.0,
double  max = 1.0 
)
static

◆ spectral()

RasterColorRamp RasterColorRamp::spectral ( double  min = 0.0,
double  max = 1.0 
)
static

◆ terrain()

RasterColorRamp RasterColorRamp::terrain ( double  min = 0.0,
double  max = 1.0 
)
static

The historic 5-stop 2D mesh terrain elevation palette (deep blue → green → ochre → off-white). Registering it as a named builtin lets the mesh-fill default agree between the editor's ramp combo and the renderer (which used a hard-coded copy of these stops).

◆ toJson()

QJsonObject RasterColorRamp::toJson ( ) const

JSON round-trip — used by .oswp persistence and the custom-ramp library.

Here is the caller graph for this function:

◆ turbo()

RasterColorRamp RasterColorRamp::turbo ( double  min = 0.0,
double  max = 1.0 
)
static

◆ viridis()

RasterColorRamp RasterColorRamp::viridis ( double  min = 0.0,
double  max = 1.0 
)
static
Here is the caller graph for this function:

◆ waterDepth()

RasterColorRamp RasterColorRamp::waterDepth ( double  min = 0.0,
double  max = 1.0 
)
static

2026-09-01 — sequential water-depth ramp for the 2D inundation / smooth-depth fill: very light blue at ~40% opacity for barely-wet cells (the shoreline fades into the terrain beneath) deepening to a fully opaque navy at maximum depth (user direction: deeper water = dark blue, shallower = lighter shade). The only builtin carrying an alpha gradient in its stops — interpolation and JSON round-trip alpha already, so it rides the existing machinery unchanged.

Member Data Documentation

◆ clampMax

bool RasterColorRamp::clampMax = false

When true, values above maxValue are transparent.

◆ clampMin

bool RasterColorRamp::clampMin = false

When true, values below minValue are transparent.

◆ interp

RampInterp RasterColorRamp::interp = RampInterp::Rgb

Colour-space used between adjacent stops.

◆ maxValue

double RasterColorRamp::maxValue = 1.0

◆ minValue

double RasterColorRamp::minValue = 0.0

◆ stops

QGradientStops RasterColorRamp::stops

Sorted list of (position [0..1], QColor) pairs.


The documentation for this struct was generated from the following files: