Skip to content
import { createRenderer } from "@arcgis/core/smartMapping/raster/renderers/rgb.js";
Since
ArcGIS Maps SDK 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.

Type definitions

RasterRGBRendererParameters

Type definition

stretchType

Property
Type
RasterStretchType | undefined

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

rgbBandIds

Property
Type
[ number, number, number ] | undefined

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

gamma

Property
Type
[ number, number, number ] | undefined

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

Property
Type
boolean | undefined

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

dynamicRangeAdjustment

Property
Type
boolean | undefined

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

Property
Type
boolean | undefined

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.

RasterRGBResult

Type definition

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

renderer

Property
Type
RasterStretchRenderer

The RGB RasterStretchRenderer renderer to apply to the input layer.

rgbBandIds

Property
Type
[ number, number, number ] | null | undefined

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

Functions

createRenderer

Function

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

Signature
createRenderer (parameters: RasterRGBRendererParameters): Promise<RasterRGBResult>
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for generating a RGB stretch visualization. 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.

Returns
Promise<RasterRGBResult>

Resolves to an object containing a stretch renderer that can be set on the input renderer.