01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.styling;
17:
18: import org.geotools.event.GTComponent;
19:
20: /**
21: * The ColorMap element defines either the colors of a palette-type raster
22: * source or the mapping of fixed-numeric pixel values to colors.
23: * <pre>
24: * <xs:element name="ColorMap">
25: * <xs:complexType>
26: * <xs:choice minOccurs="0" maxOccurs="unbounded">
27: * <xs:element ref="sld:ColorMapEntry"/>
28: * </xs:choice>
29: * </xs:complexType>
30: * </xs:element>
31: * </pre>
32: * For example, a DEM raster giving elevations in meters above sea level can be
33: * translated to a colored image with a ColorMap. The quantity attributes of
34: * a color-map are used for translating between numeric matrixes and color
35: * rasters and the ColorMap entries should be in order of increasing numeric
36: * quantity so that intermediate numeric values can be matched to a color (or
37: * be interpolated between two colors). Labels may be used for legends or
38: * may be used in the future to match character values. Not all systems can
39: * support opacity in colormaps. The default opacity is 1.0 (fully opaque).
40: * Defaults for quantity and label are system-dependent.
41: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/styling/ColorMap.java $
42: */
43: public interface ColorMap extends GTComponent {
44: public static final int TYPE_RAMP = 1;
45: public static final int TYPE_INTERVALS = 2;
46: public static final int TYPE_VALUES = 3;
47:
48: public void addColorMapEntry(ColorMapEntry entry);
49:
50: public ColorMapEntry[] getColorMapEntries();
51:
52: public ColorMapEntry getColorMapEntry(int i);
53:
54: public int getType();
55:
56: public void setType(int type);
57:
58: void accept(StyleVisitor visitor);
59: }
|