ST_SetColorInterp

更新时间:
复制 MD 格式

Sets the color interpretation type for a specified band of a raster object.

Syntax

raster ST_SetColorInterp(raster rast, integer band_sn, ColorInterp interp);

Parameters

ParameterDescription
rastThe raster object.
band_snThe band index, starting from 0.
interpThe color interpretation type. For valid values, see the ColorInterp values table.

ColorInterp values

ValueDescription
UndefinedNo color interpretation is defined.
GrayIndexIndex into an associated gray color table.
RGBIndexIndex into an associated RGB color table.
RGBAIndexIndex into an associated RGBA color table.
CMYKIndexIndex into an associated CMYK color table.
HSLIndexIndex into an associated HSL color table.
RedBandRed band in the RGB color model.
GreenBandGreen band in the RGB color model.
BlueBandBlue band in the RGB color model.
AlphaBandAlpha band in the RGBA color model.
HueBandHue band in the HSL color model.
SaturationBandSaturation band in the HSL color model.
LightnessBandLightness band in the HSL color model.
CyanBandCyan band in the CMYK color model.
MagentaBandMagenta band in the CMYK color model.
YellowBandYellow band in the CMYK color model.
BlackBandBlack band in the CMYK color model.
YBandY band in the YCbCr color model.
CbBandCb band in the YCbCr color model.
CrBandCr band in the YCbCr color model.

Example

Set band 0 of the raster to the cyan band of the CMYK color model:

UPDATE rast SET rast = ST_SetColorInterp(rast, 0, 'CI_Cyan');

Output:

(1 row)