Returns the color interpretation type of a specific band in a raster object.
Syntax
text ST_ColorInterp(raster raster_obj, integer band);Parameters
| Parameter | Type | Description |
|---|---|---|
raster_obj | raster | The raster object. |
band | integer | The band index, starting from 0. |
Return values
Returns a text value that identifies how the band data should be interpreted as color. The value corresponds to the band's role in its color model (for example, RedBand identifies the red channel of an RGB or RGBA image).
| Value | Description |
|---|---|
Undefined | No color interpretation is defined. |
GrayIndex | Index into an associated gray value table. |
RGBIndex | Index into an RGB color table. |
RGBAIndex | Index into an RGBA color table. |
RedBand | Red band of the RGB color model. |
GreenBand | Green band of the RGB color model. |
BlueBand | Blue band of the RGB color model. |
AlphaBand | Alpha band of the RGBA color model. |
HueBand | Hue band of the HSL color model. |
SaturationBand | Saturation band of the HSL color model. |
LightnessBand | Lightness band of the HSL color model. |
CyanBand | Cyan band of the CMYK color model. |
MagentaBand | Magenta band of the CMYK color model. |
YellowBand | Yellow band of the CMYK color model. |
BlackBand | Black band of the CMYK color model. |
YCbCr_YBand | Y band of the YCbCr color model. |
YCbCr_CbBand | Cb band of the YCbCr color model. |
YCbCr_CrBand | Cr band of the YCbCr color model. |
Example
Get the color interpretation of band 0 in a raster object:
SELECT ST_ColorInterp(raster_obj, 0) FROM raster_table WHERE id = 1;Output:
RedBand该文章对您有帮助吗?