require(["esri/smartMapping/raster/renderers/rgb"], (rasterRGBCreator) => { /* code goes here */ });
import * as rasterRGBCreator from "@arcgis/core/smartMapping/raster/renderers/rgb.js";
esri/smartMapping/raster/renderers/rgb
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> | Generates an RGB RasterStretchRenderer to render three selected bands into red, green, and blue color channels. | rgb |
Method Details
-
createRenderer
createRenderer(params){Promise<RasterRGBResult>}
-
Generates an RGB RasterStretchRenderer to render three selected bands into red, green, and blue color channels.
ParametersSpecificationparams ObjectInput parameters for generating a RGB stretch visualization. See the table below for details of each parameter. The
colorRamp
,gamma
,useGamma
, anddynamicRangeAdjustment
parameters are not related to RGB band ID selection or stretch type. Pass them in to preserve the existing settings if desired.SpecificationThe input layer for which the renderer is generated.
renderingRule RasterFunctionoptionalDeprecated since 4.27. Use
rasterFunction
instead.rasterFunction RasterFunctionoptionalSpecifies the function for how the requested image should be processed. When
rasterFunction
is applied, the server returns updated service information that reflects custom processing as defined by the raster function. If not provided, the output renderer is created using the layer'srasterFunction
.stretchType StringoptionalA preferred stretch type can be provided. See RasterStretchRenderer.stretchType for more information.
Possible Values:"none"|"min-max"|"standard-deviation"|"histogram-equalization"|"percent-clip"|"sigmoid"
optional The RGB band indexes following the order of red, green, and blue channels. This array must have three numbers.
optional The gamma values to be used if
useGamma
istrue
. 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 whenstretchType
isnone
,standard-deviation
, ormin-max
. See RasterStretchRenderer.gamma for more information.useGamma BooleanoptionalIndicates whether the
gamma
values should be used. Whenfalse
, the gamma is calculated from the statistics and histogram of the data.dynamicRangeAdjustment BooleanoptionalWhen
true
, calculates the renderer's statistics based on the current display extent and recalculates them as you zoom and pan around the image.estimateStatistics BooleanoptionalUseful 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, unlikedynamicRangeAdjustment
which recalculates statistics on each extent change.signal AbortSignaloptionalAllows for cancelable requests. If canceled, the promise will be rejected with an error named
AbortError
. See also AbortController.ReturnsType Description Promise<RasterRGBResult> Resolves to an object containing a stretch renderer that can be set on the input renderer.
Type Definitions
-
The result object of the createRenderer() method. See the table below for details of each property.
- Properties
-
renderer RasterStretchRenderer
The RGB RasterStretchRenderer renderer to apply to the input layer.
The RGB band indexes following the order of red, green, and blue channels.