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
| Parameter | Description |
|---|---|
rast | The raster object. |
band_sn | The band index, starting from 0. |
interp | The color interpretation type. For valid values, see the ColorInterp values table. |
ColorInterp values
| Value | Description |
|---|---|
Undefined | No color interpretation is defined. |
GrayIndex | Index into an associated gray color table. |
RGBIndex | Index into an associated RGB color table. |
RGBAIndex | Index into an associated RGBA color table. |
CMYKIndex | Index into an associated CMYK color table. |
HSLIndex | Index into an associated HSL color table. |
RedBand | Red band in the RGB color model. |
GreenBand | Green band in the RGB color model. |
BlueBand | Blue band in the RGB color model. |
AlphaBand | Alpha band in the RGBA color model. |
HueBand | Hue band in the HSL color model. |
SaturationBand | Saturation band in the HSL color model. |
LightnessBand | Lightness band in the HSL color model. |
CyanBand | Cyan band in the CMYK color model. |
MagentaBand | Magenta band in the CMYK color model. |
YellowBand | Yellow band in the CMYK color model. |
BlackBand | Black band in the CMYK color model. |
YBand | Y band in the YCbCr color model. |
CbBand | Cb band in the YCbCr color model. |
CrBand | Cr 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)该文章对您有帮助吗?