Skip to content
  • ColorRamp
  • class Esri::ArcGISRuntime::ColorRamp

    A ColorRamp object for use in a StretchRenderer. More...

    Header: #include <ColorRamp.h>
    Since: Esri::ArcGISRuntime 100.0
    Inherits: Esri::ArcGISRuntime::Object

    Public Functions

    virtual ~ColorRamp() override

    Static Public Members

    Esri::ArcGISRuntime::ColorRamp *create(Esri::ArcGISRuntime::PresetColorRampType presetColorRampType, int size = 256, QObject *parent = nullptr)
    (since Esri::ArcGISRuntime 300.0) Esri::ArcGISRuntime::ColorRamp *createFromColorStops(const QList<Esri::ArcGISRuntime::ColorStop *> &colorStops, int size = 256, QObject *parent = nullptr)
    (since Esri::ArcGISRuntime 300.0) Esri::ArcGISRuntime::ColorRamp *createFromColors(const QList<QColor> &colors, int size = 256, QObject *parent = nullptr)

    Detailed Description

    Relevant samples:

    • Apply map algebra: Apply map algebra to an elevation raster to floor, mask, and categorize the elevation values into discrete integer-based categories.
    • Blend raster layer: Blend a hillshade with a raster by specifying the elevation data. The resulting raster looks similar to the original raster, but with some terrain shading, giving it a textured look.
    • Stretch renderer: Use a stretch renderer to enhance the visual contrast of raster data for analysis.

    Member Function Documentation

    [override virtual noexcept] ColorRamp::~ColorRamp()

    Destructor.

    [static] Esri::ArcGISRuntime::ColorRamp *ColorRamp::create(Esri::ArcGISRuntime::PresetColorRampType presetColorRampType, int size = 256, QObject *parent = nullptr)

    Returns a color ramp with predefined color ramp type and size.

    • presetColorRampType - The predefined color ramp type.
    • size - The number of steps in the complete resulting gradient. A typical value is 256.
    • parent - The optional parent QObject.

    For the minimum number of steps, see PresetColorRampType.

    [static, since Esri::ArcGISRuntime 300.0] Esri::ArcGISRuntime::ColorRamp *ColorRamp::createFromColorStops(const QList<Esri::ArcGISRuntime::ColorStop *> &colorStops, int size = 256, QObject *parent = nullptr)

    Returns a custom color ramp with a linear gradient between the provided color stops.

    • colorStops - A list of two or more color stops that the color ramp will blend between.
    • size - The number of steps in the complete resulting gradient. A typical value is 256.
    • parent - The optional parent QObject.

    Any pixel values placed in a position before the minimum position provided or after the maximum position provided will be shaded with the color of the nearest color stop.

    The alpha channel of each color is ignored, so every color is treated as if it were completely opaque.

    This function was introduced in Esri::ArcGISRuntime 300.0.

    [static, since Esri::ArcGISRuntime 300.0] Esri::ArcGISRuntime::ColorRamp *ColorRamp::createFromColors(const QList<QColor> &colors, int size = 256, QObject *parent = nullptr)

    Returns a custom color ramp with a linear gradient between the provided colors.

    • colors - A list of two or more colors that the color ramp will blend between.
    • size - The number of steps in the complete resulting gradient. A typical value is 256.
    • parent - The optional parent QObject.

    The alpha channel of each color is ignored, so every color is treated as if it were completely opaque.

    This function was introduced in Esri::ArcGISRuntime 300.0.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.