001 //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/branches/2.2_testing/src/org/deegree/model/coverage/ColorInterpretation.java $
002 /*---------------- FILE HEADER ------------------------------------------
003
004 This file is part of deegree.
005 Copyright (C) 2001-2008 by:
006 EXSE, Department of Geography, University of Bonn
007 http://www.giub.uni-bonn.de/deegree/
008 lat/lon GmbH
009 http://www.lat-lon.de
010
011 This library is free software; you can redistribute it and/or
012 modify it under the terms of the GNU Lesser General Public
013 License as published by the Free Software Foundation; either
014 version 2.1 of the License, or (at your option) any later version.
015
016 This library is distributed in the hope that it will be useful,
017 but WITHOUT ANY WARRANTY; without even the implied warranty of
018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019 Lesser General Public License for more details.
020
021 You should have received a copy of the GNU Lesser General Public
022 License along with this library; if not, write to the Free Software
023 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024
025 Contact:
026
027 Andreas Poth
028 lat/lon GmbH
029 Aennchenstr. 19
030 53115 Bonn
031 Germany
032 E-Mail: poth@lat-lon.de
033
034 Prof. Dr. Klaus Greve
035 Department of Geography
036 University of Bonn
037 Meckenheimer Allee 166
038 53115 Bonn
039 Germany
040 E-Mail: greve@giub.uni-bonn.de
041
042
043 ---------------------------------------------------------------------------*/
044 package org.deegree.model.coverage;
045
046 /**
047 * Specifies the mapping of a band to a color model component.
048 *
049 * @UML codelist CV_ColorInterpretation
050 * @author <A HREF="http://www.opengis.org">OpenGIS® consortium</A>
051 * @version <A HREF="http://www.opengis.org/docs/01-004.pdf">Grid Coverage specification 1.0</A>
052 *
053 * @see PaletteInterpretation
054 * @see SampleDimension
055 */
056 final class ColorInterpretation extends CodeList {
057 /**
058 * Serial number for compatibility with different versions.
059 */
060 private static final long serialVersionUID = 6947933527594223350L;
061
062 /**
063 * Band is not associated with a color model component.
064 *
065 * @UML conditional CV_Undefined
066 */
067 public static final ColorInterpretation UNDEFINED = new ColorInterpretation( "UNDEFINED", 0 );
068
069 /**
070 * Band is an index into a lookup table.
071 *
072 * @UML conditional CV_GrayIndex
073 * @see #PALETTE_INDEX
074 * @see PaletteInterpretation#GRAY
075 */
076 public static final ColorInterpretation GRAY_INDEX = new ColorInterpretation( "GRAY_INDEX", 1 );
077
078 /**
079 * Band is a color index into a color table.
080 *
081 * @UML conditional CV_PaletteIndex
082 * @see #GRAY_INDEX
083 */
084 public static final ColorInterpretation PALETTE_INDEX = new ColorInterpretation( "PALETTE_INDEX", 2 );
085
086 /**
087 * Red Band for the {@linkplain PaletteInterpretation#RGB RGB} color model components.
088 *
089 * @UML conditional CV_RedBand
090 * @see #GREEN_BAND
091 * @see #BLUE_BAND
092 * @see #ALPHA_BAND
093 * @see PaletteInterpretation#RGB
094 */
095 public static final ColorInterpretation RED_BAND = new ColorInterpretation( "RED_BAND", 3 );
096
097 /**
098 * Greend Band for the {@linkplain PaletteInterpretation#RGB RGB} color model components.
099 *
100 * @UML conditional CV_GreenBand
101 * @see #RED_BAND
102 * @see #BLUE_BAND
103 * @see #ALPHA_BAND
104 * @see PaletteInterpretation#RGB
105 */
106 public static final ColorInterpretation GREEN_BAND = new ColorInterpretation( "GREEN_BAND", 4 );
107
108 /**
109 * Blue Band for the {@linkplain PaletteInterpretation#RGB RGB} color model components.
110 *
111 * @UML conditional CV_BlueBand
112 * @see #RED_BAND
113 * @see #GREEN_BAND
114 * @see #ALPHA_BAND
115 * @see PaletteInterpretation#RGB
116 */
117 public static final ColorInterpretation BLUE_BAND = new ColorInterpretation( "BLUE_BAND", 5 );
118
119 /**
120 * Alpha Band for the {@linkplain PaletteInterpretation#RGB RGB} color model components. Alpha
121 * band may or may not be present.
122 *
123 * @UML conditional CV_AlphaBand
124 * @see #RED_BAND
125 * @see #GREEN_BAND
126 * @see #BLUE_BAND
127 * @see PaletteInterpretation#RGB
128 */
129 public static final ColorInterpretation ALPHA_BAND = new ColorInterpretation( "ALPHA_BAND", 6 );
130
131 /**
132 * Hue Band for the {@linkplain PaletteInterpretation#HLS HLS} color model.
133 *
134 * @UML conditional CV_HueBand
135 * @see #SATURATION_BAND
136 * @see #LIGHTNESS_BAND
137 * @see PaletteInterpretation#HLS
138 */
139 public static final ColorInterpretation HUE_BAND = new ColorInterpretation( "HUE_BAND", 7 );
140
141 /**
142 * Saturation Band for the {@linkplain PaletteInterpretation#HLS HLS} color model.
143 *
144 * @UML conditional CV_SaturationBand
145 * @see #HUE_BAND
146 * @see #LIGHTNESS_BAND
147 * @see PaletteInterpretation#HLS
148 */
149 public static final ColorInterpretation SATURATION_BAND = new ColorInterpretation( "SATURATION_BAND", 8 );
150
151 /**
152 * Lightness Band for the {@linkplain PaletteInterpretation#HLS HLS} color model.
153 *
154 * @UML conditional CV_LightnessBand
155 * @see #HUE_BAND
156 * @see #SATURATION_BAND
157 * @see PaletteInterpretation#HLS
158 */
159 public static final ColorInterpretation LIGHTNESS_BAND = new ColorInterpretation( "LIGHTNESS_BAND", 9 );
160
161 /**
162 * Cyan Band for the {@linkplain PaletteInterpretation#CMYK CMYK} color model.
163 *
164 * @UML conditional CV_CyanBand
165 * @see #MAGENTA_BAND
166 * @see #YELLOW_BAND
167 * @see #BLACK_BAND
168 * @see PaletteInterpretation#CMYK
169 */
170 public static final ColorInterpretation CYAN_BAND = new ColorInterpretation( "CYAN_BAND", 10 );
171
172 /**
173 * Magenta Band for the {@linkplain PaletteInterpretation#CMYK CMYK} color model.
174 *
175 * @UML conditional CV_MagentaBand
176 * @see #CYAN_BAND
177 * @see #YELLOW_BAND
178 * @see #BLACK_BAND
179 * @see PaletteInterpretation#CMYK
180 */
181 public static final ColorInterpretation MAGENTA_BAND = new ColorInterpretation( "MAGENTA_BAND", 11 );
182
183 /**
184 * Yellow Band for the {@linkplain PaletteInterpretation#CMYK CMYK} color model.
185 *
186 * @UML conditional CV_YellowBand
187 * @see #CYAN_BAND
188 * @see #MAGENTA_BAND
189 * @see #BLACK_BAND
190 * @see PaletteInterpretation#CMYK
191 */
192 public static final ColorInterpretation YELLOW_BAND = new ColorInterpretation( "YELLOW_BAND", 12 );
193
194 /**
195 * Black Band for the {@linkplain PaletteInterpretation#CMYK CMYK} color model.
196 *
197 * @UML conditional CV_BlackBand
198 * @see #CYAN_BAND
199 * @see #MAGENTA_BAND
200 * @see #YELLOW_BAND
201 * @see PaletteInterpretation#CMYK
202 */
203 public static final ColorInterpretation BLACK_BAND = new ColorInterpretation( "BLACK_BAND", 13 );
204
205 /**
206 * List of all enumerations of this type.
207 */
208 private static final ColorInterpretation[] VALUES = new ColorInterpretation[] { UNDEFINED, GRAY_INDEX,
209 PALETTE_INDEX, RED_BAND, GREEN_BAND,
210 BLUE_BAND, ALPHA_BAND, HUE_BAND,
211 SATURATION_BAND, LIGHTNESS_BAND,
212 CYAN_BAND, MAGENTA_BAND,
213 YELLOW_BAND, BLACK_BAND };
214
215 /**
216 * Constructs an enum with the given name.
217 */
218 private ColorInterpretation( final String name, final int ordinal ) {
219 super( name, ordinal );
220 }
221
222 /**
223 * Returns the list of <code>ColorInterpretation</code>s.
224 */
225 public static ColorInterpretation[] values() {
226 return VALUES.clone();
227 }
228
229 /**
230 * Returns the list of enumerations of the same kind than this enum.
231 */
232 public CodeList[] family() {
233 return values();
234 }
235 }