Returns the color interpretation of a specified band in a raster object.
Syntax
text ST_ColorInterp(raster raster_obj, integer band)Parameters
| Parameter | Description |
|---|---|
raster_obj | The raster object. |
band | The band index. Band indexes start from 0. |
Return values
Returns a text value that identifies the color interpretation of the band. The following 18 values may be returned:
| Value | Description |
|---|---|
Undefined | No color interpretation is set for the band. |
GrayIndex | The index of the associated gray value table. |
RGBIndex | The index of the RGB color table. |
RGBAIndex | The index of the RGBA color table. |
RedBand | The red band in the RGB color model. |
GreenBand | The green band in the RGB color model. |
BlueBand | The blue band in the RGB color model. |
AlphaBand | The alpha band in the RGBA color model. |
HueBand | The hue band in the HSL color model. |
SaturationBand | The saturation band in the HSL color model. |
LightnessBand | The lightness band in the HSL color model. |
CyanBand | The cyan band in the CMYK color model. |
MagentaBand | The magenta band in the CMYK color model. |
YellowBand | The yellow band in the CMYK color model. |
BlackBand | The black band in the CMYK color model. |
YCbCr_YBand | The Y band in the YCbCr color model. |
YCbCr_CbBand | The Cb band in the YCbCr color model. |
YCbCr_CrBand | The Cr band in the YCbCr color model. |
When no color interpretation is configured for a band,ST_ColorInterpreturnsUndefined.
Example
Query the color interpretation of band 0 from a raster object:
SELECT ST_ColorInterp(raster_obj, 0) FROM raster_table WHERE id = 1;Output:
st_colorinterp
----------------
RedBand