Sets the color interpretation for a specified band of a raster object.
Syntax
raster ST_SetColorInterp(raster rast, integer band_sn, ColorInterp interp);Parameters
| Parameter | Description |
|---|---|
rast | The raster that you want to query. |
band_sn | The sequence number of the band, starting at 0. |
interp | The color interpretation to assign. See Color interpretation values for valid values. |
Color interpretation values
The interp parameter accepts the following ColorInterp enum values.
| Value | Description |
|---|---|
Undefined | The color interpretation type is not defined. |
GrayIndex | The associated gray color table. |
RGBIndex | The associated RGB color table. |
RGBAIndex | The associated RGBA color table. |
CMYKIndex | The associated CMYK color table. |
HSLIndex | The associated HSL color table. |
RedBand | The red band. |
GreenBand | The green band. |
BlueBand | The blue band. |
AlphaBand | The alpha band. |
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. |
MegentaBand | 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. |
YBand | The Y band in the YCbCr color model. |
CbBand | The Cb band in the YCbCr color model. |
CrBand | The 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');该文章对您有帮助吗?