ST_SetColorInterp

更新时间:
复制 MD 格式

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

Syntax

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

Parameters

ParameterDescription
rastThe raster that you want to query.
band_snThe sequence number of the band, starting at 0.
interpThe color interpretation to assign. See Color interpretation values for valid values.

Color interpretation values

The interp parameter accepts the following ColorInterp enum values.

ValueDescription
UndefinedThe color interpretation type is not defined.
GrayIndexThe associated gray color table.
RGBIndexThe associated RGB color table.
RGBAIndexThe associated RGBA color table.
CMYKIndexThe associated CMYK color table.
HSLIndexThe associated HSL color table.
RedBandThe red band.
GreenBandThe green band.
BlueBandThe blue band.
AlphaBandThe alpha band.
HueBandThe hue band in the HSL color model.
SaturationBandThe saturation band in the HSL color model.
LightnessBandThe lightness band in the HSL color model.
CyanBandThe cyan band in the CMYK color model.
MegentaBandThe magenta band in the CMYK color model.
YellowBandThe yellow band in the CMYK color model.
BlackBandThe black band in the CMYK color model.
YBandThe Y band in the YCbCr color model.
CbBandThe Cb band in the YCbCr color model.
CrBandThe Cr band in the YCbCr color model.

To list all color interpretation values supported by your database, run:

SELECT enumlabel FROM pg_enum WHERE enumtypid = 'colorinterp'::regtype;

Examples

UPDATE raster_table SET rast = ST_SetColorInterp(rast, 0, 'YBand');