Home | Concepts | API | Samples |
Concepts > Rasters > Basic Principles | |||
Color Maps | |||
A color map is a color lookup table, in which every entry specifies a color by a red, green, and blue value in the RGB color model. The values can range from 0.0 to 1.0 in floating point values or from 00 to FF in hexadecimal values. A fourth value, the alpha value, defines opacity. It also ranges from 0.0 to 1.0; 0.0 meaning the color is fully transparent, and 1.0 that the color is fully opaque. A color map usually stores 256 different RGBA-tupels, but other sizes and even procedurally-defined color maps are possible too. When a color map is in use, the pixel values represent an index to the color map. For instance, a pixel value of 16 would index the sixteenth element of the color map. The application renders the pixel according to the intensity of colors defined by the color map element. There are different types of color maps.
Several data types can be used to store color map values.
Color maps can only be applied to rasters with a single raster band and are not verified by the ArcSDE server. It is the responsibility of the application to verify the values contained in the color map. If the color map type is SE_COLORMAP_RGB, it should have the following structure: r0, g0, b0 r1, g1,
b1 Whereas, if the color map type is SE_COLORMAP_RGBA, it should have the following structure: r0, g0, b0, t0 r1, g1,
b1, t1 The ArcSDE Raster API provides functions to set the color map for a particular raster. These functions are used during creation of a raster or when data is loaded into a raster through the RasterAttr object.
The SeRasterBand.setColorMap() or SE_rasbandinfo_set_colormap() function can be used when changes are being made to an existing raster by altering an existing raster band.
In both cases, it is mandatory that there be only one raster band in the raster. If there is more than one band in the raster and a color map must be set, the other remaining raster bands must be deleted. |
feedback |
privacy |
legal |