rgb

AMD: require(["esri/smartMapping/raster/renderers/rgb"], (rasterRGBCreator) => { /* code goes here */ });
ESM: import * as rasterRGBCreator from "@arcgis/core/smartMapping/raster/renderers/rgb";
Object: esri/smartMapping/raster/renderers/rgb
Since: ArcGIS API for JavaScript 4.20

This object contains helper methods for generating an RGB stretch visualization for raster layers (i.e. ImageryLayer, ImageryTileLayer, or WCSLayer).

The createRenderer method in this module generates a renderer that may be applied directly to the input layer.

Method Overview

Name Return Type Summary Object
Promise<RasterRGBResult>more details

Generates an RGB RasterStretchRenderer to render three selected bands into red, green, and blue color channels.

more detailsrgb

Method Details

createRenderer(params){Promise<RasterRGBResult>}

Generates an RGB RasterStretchRenderer to render three selected bands into red, green, and blue color channels.

Parameters:
Specification:
params Object

Input parameters for generating a RGB stretch visualization. See the table below for details of each parameter. The colorRamp, gamma, useGamma, and dynamicRangeAdjustment parameters are not related to RGB band ID selection or stretch type. Pass them in to preserve the existing settings if desired.

Specification:

The input layer for which the renderer is generated.

renderingRule RasterFunction
optional

Specifies the rule for how the requested image should be rendered. When renderingRule is applied, the server returns updated service information that reflects custom processing as defined by the rendering rule. If not provided, the output renderer is created using the layer's renderingRule.

stretchType String
optional

A preferred stretch type can be provided. See RasterStretchRenderer.stretchType for more information.

Possible Values:"none"|"min-max"|"standard-deviation"|"histogram-equalization"|"percent-clip"|"sigmoid"

rgbBandIds Number[]
optional

The RGB band indexes following the order of red, green, and blue channels. This array must have three numbers.

gamma Number[]
optional

The gamma values to be used if useGamma is true. Gamma refers to the degree of contrast between the mid-level gray values of a raster dataset. It does not affect black or white values, only the middle values. By applying a gamma correction, you can control the overall brightness of an ImageryLayer. Gamma stretching is only valid when stretchType is none, standard-deviation, or min-max. See RasterStretchRenderer.gamma for more information.

useGamma Boolean
optional

Indicates whether the gamma values should be used. When false, the gamma is calculated from the statistics and histogram of the data.

dynamicRangeAdjustment Boolean
optional

When true, calculates the renderer's statistics based on the current display extent and recalculates them as you zoom and pan around the image.

estimateStatistics Boolean
optional

Useful in scenarios where an image service does not have statistics. When true, this function estimates global statistics to keep a constant visual on pan and zoom, unlike dynamicRangeAdjustment which recalculates statistics on each extent change.

signal AbortSignal
optional

Allows for cancelable requests. If canceled, the promise will be rejected with an error named AbortError. See also AbortController.

Returns:
Type Description
Promise<RasterRGBResult> Resolves to an object containing a stretch renderer that can be set on the input renderer.

Type Definitions

RasterRGBResult

The result object of the createRenderer() method. See the table below for details of each property.

Properties:

The RGB RasterStretchRenderer renderer to apply to the input layer.

rgbBandIds Number[]

The RGB band indexes following the order of red, green, and blue channels.

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