ST_SetColorInterp
更新时间:
复制 MD 格式
Sets the color interpretation type for a specified band of a raster object. Returns the modified raster object.
Syntax
raster ST_SetColorInterp(raster rast, integer band_sn, ColorInterp interp)Parameters
| Parameter | Description |
|---|---|
rast | The raster object. |
band_sn | The sequence number of the band. Band numbering starts at 0. |
interp | The color interpretation type. See the ColorInterp values table. |
ColorInterp values
The following tables list the valid values for the interp parameter, grouped by color model.
General
| Value | Description |
|---|---|
Undefined | Color interpretation is not defined. |
Indexed color
| Value | Description |
|---|---|
GrayIndex | Index into a gray color table. |
RGBIndex | Index into an RGB color table. |
RGBAIndex | Index into an RGBA color table. |
CMYKIndex | Index into a CMYK color table. |
HSLIndex | Index into an HSL color table. |
RGB and RGBA color models
| Value | Description |
|---|---|
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. |
HSL color model
| Value | Description |
|---|---|
HueBand | Hue band in the HSL color model. |
SaturationBand | Saturation band in the HSL color model. |
LightnessBand | Lightness band in the HSL color model. |
CMYK color model
| Value | Description |
|---|---|
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. |
YCbCr color model
| Value | Description |
|---|---|
YBand | Y (luminance) band in the YCbCr color model. |
CbBand | Cb (chroma blue) band in the YCbCr color model. |
CrBand | Cr (chroma red) band in the YCbCr color model. |
Examples
Set band 0 of the raster column rast to the cyan band of the CMYK color model.
When passing aColorInterpvalue as a string literal in SQL, use theCI_prefix form (for example,'CI_Cyan'forCyanBand). To read back the color interpretation after setting it, use ST_ColorInterp.
UPDATE rast SET rast = ST_SetColorInterp(rast, 0, 'CI_Cyan');Output:
(1 row)See also
ST_ColorInterp — Get the color interpretation type of a band.
该文章对您有帮助吗?