ST_ColorInterp

更新时间:
复制 MD 格式

Returns the color interpretation type of a specific band in a raster object.

Syntax

text ST_ColorInterp(raster raster_obj, integer band);

Parameters

ParameterTypeDescription
raster_objrasterThe raster object.
bandintegerThe 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).

ValueDescription
UndefinedNo color interpretation is defined.
GrayIndexIndex into an associated gray value table.
RGBIndexIndex into an RGB color table.
RGBAIndexIndex into an RGBA color table.
RedBandRed band of the RGB color model.
GreenBandGreen band of the RGB color model.
BlueBandBlue band of the RGB color model.
AlphaBandAlpha band of the RGBA color model.
HueBandHue band of the HSL color model.
SaturationBandSaturation band of the HSL color model.
LightnessBandLightness band of the HSL color model.
CyanBandCyan band of the CMYK color model.
MagentaBandMagenta band of the CMYK color model.
YellowBandYellow band of the CMYK color model.
BlackBandBlack band of the CMYK color model.
YCbCr_YBandY band of the YCbCr color model.
YCbCr_CbBandCb band of the YCbCr color model.
YCbCr_CrBandCr 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