001    //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/model/coverage/ColorInterpretation.java $
002    /*----------------------------------------------------------------------------
003     This file originated as a part of GeoAPI.
004    
005     GeoAPI is free software. GeoAPI may be used, modified and
006     redistributed by anyone for any purpose requring only maintaining the
007     copyright and license terms on the source code and derivative files.
008     See the OGC legal page for details.
009    
010     The copyright to the GeoAPI interfaces is held by the Open Geospatial
011     Consortium, see http://www.opengeospatial.org/ogc/legal
012    ----------------------------------------------------------------------------*/
013    package org.deegree.model.coverage;
014    
015    /**
016     * Specifies the mapping of a band to a color model component.
017     *
018     * @UML codelist CV_ColorInterpretation
019     * @author <A HREF="http://www.opengis.org">OpenGIS&reg; consortium</A>
020     * @version <A HREF="http://www.opengis.org/docs/01-004.pdf">Grid Coverage specification 1.0</A>
021     *
022     * @see PaletteInterpretation
023     * @see SampleDimension
024     */
025    final class ColorInterpretation extends CodeList {
026        /**
027         * Serial number for compatibility with different versions.
028         */
029        private static final long serialVersionUID = 6947933527594223350L;
030    
031        /**
032         * Band is not associated with a color model component.
033         *
034         * @UML conditional CV_Undefined
035         */
036        public static final ColorInterpretation UNDEFINED = new ColorInterpretation( "UNDEFINED", 0 );
037    
038        /**
039         * Band is an index into a lookup table.
040         *
041         * @UML conditional CV_GrayIndex
042         * @see #PALETTE_INDEX
043         * @see PaletteInterpretation#GRAY
044         */
045        public static final ColorInterpretation GRAY_INDEX = new ColorInterpretation( "GRAY_INDEX", 1 );
046    
047        /**
048         * Band is a color index into a color table.
049         *
050         * @UML conditional CV_PaletteIndex
051         * @see #GRAY_INDEX
052         */
053        public static final ColorInterpretation PALETTE_INDEX = new ColorInterpretation( "PALETTE_INDEX", 2 );
054    
055        /**
056         * Red Band for the {@linkplain PaletteInterpretation#RGB RGB} color model components.
057         *
058         * @UML conditional CV_RedBand
059         * @see #GREEN_BAND
060         * @see #BLUE_BAND
061         * @see #ALPHA_BAND
062         * @see PaletteInterpretation#RGB
063         */
064        public static final ColorInterpretation RED_BAND = new ColorInterpretation( "RED_BAND", 3 );
065    
066        /**
067         * Greend Band for the {@linkplain PaletteInterpretation#RGB RGB} color model components.
068         *
069         * @UML conditional CV_GreenBand
070         * @see #RED_BAND
071         * @see #BLUE_BAND
072         * @see #ALPHA_BAND
073         * @see PaletteInterpretation#RGB
074         */
075        public static final ColorInterpretation GREEN_BAND = new ColorInterpretation( "GREEN_BAND", 4 );
076    
077        /**
078         * Blue Band for the {@linkplain PaletteInterpretation#RGB RGB} color model components.
079         *
080         * @UML conditional CV_BlueBand
081         * @see #RED_BAND
082         * @see #GREEN_BAND
083         * @see #ALPHA_BAND
084         * @see PaletteInterpretation#RGB
085         */
086        public static final ColorInterpretation BLUE_BAND = new ColorInterpretation( "BLUE_BAND", 5 );
087    
088        /**
089         * Alpha Band for the {@linkplain PaletteInterpretation#RGB RGB} color model components. Alpha
090         * band may or may not be present.
091         *
092         * @UML conditional CV_AlphaBand
093         * @see #RED_BAND
094         * @see #GREEN_BAND
095         * @see #BLUE_BAND
096         * @see PaletteInterpretation#RGB
097         */
098        public static final ColorInterpretation ALPHA_BAND = new ColorInterpretation( "ALPHA_BAND", 6 );
099    
100        /**
101         * Hue Band for the {@linkplain PaletteInterpretation#HLS HLS} color model.
102         *
103         * @UML conditional CV_HueBand
104         * @see #SATURATION_BAND
105         * @see #LIGHTNESS_BAND
106         * @see PaletteInterpretation#HLS
107         */
108        public static final ColorInterpretation HUE_BAND = new ColorInterpretation( "HUE_BAND", 7 );
109    
110        /**
111         * Saturation Band for the {@linkplain PaletteInterpretation#HLS HLS} color model.
112         *
113         * @UML conditional CV_SaturationBand
114         * @see #HUE_BAND
115         * @see #LIGHTNESS_BAND
116         * @see PaletteInterpretation#HLS
117         */
118        public static final ColorInterpretation SATURATION_BAND = new ColorInterpretation( "SATURATION_BAND", 8 );
119    
120        /**
121         * Lightness Band for the {@linkplain PaletteInterpretation#HLS HLS} color model.
122         *
123         * @UML conditional CV_LightnessBand
124         * @see #HUE_BAND
125         * @see #SATURATION_BAND
126         * @see PaletteInterpretation#HLS
127         */
128        public static final ColorInterpretation LIGHTNESS_BAND = new ColorInterpretation( "LIGHTNESS_BAND", 9 );
129    
130        /**
131         * Cyan Band for the {@linkplain PaletteInterpretation#CMYK CMYK} color model.
132         *
133         * @UML conditional CV_CyanBand
134         * @see #MAGENTA_BAND
135         * @see #YELLOW_BAND
136         * @see #BLACK_BAND
137         * @see PaletteInterpretation#CMYK
138         */
139        public static final ColorInterpretation CYAN_BAND = new ColorInterpretation( "CYAN_BAND", 10 );
140    
141        /**
142         * Magenta Band for the {@linkplain PaletteInterpretation#CMYK CMYK} color model.
143         *
144         * @UML conditional CV_MagentaBand
145         * @see #CYAN_BAND
146         * @see #YELLOW_BAND
147         * @see #BLACK_BAND
148         * @see PaletteInterpretation#CMYK
149         */
150        public static final ColorInterpretation MAGENTA_BAND = new ColorInterpretation( "MAGENTA_BAND", 11 );
151    
152        /**
153         * Yellow Band for the {@linkplain PaletteInterpretation#CMYK CMYK} color model.
154         *
155         * @UML conditional CV_YellowBand
156         * @see #CYAN_BAND
157         * @see #MAGENTA_BAND
158         * @see #BLACK_BAND
159         * @see PaletteInterpretation#CMYK
160         */
161        public static final ColorInterpretation YELLOW_BAND = new ColorInterpretation( "YELLOW_BAND", 12 );
162    
163        /**
164         * Black Band for the {@linkplain PaletteInterpretation#CMYK CMYK} color model.
165         *
166         * @UML conditional CV_BlackBand
167         * @see #CYAN_BAND
168         * @see #MAGENTA_BAND
169         * @see #YELLOW_BAND
170         * @see PaletteInterpretation#CMYK
171         */
172        public static final ColorInterpretation BLACK_BAND = new ColorInterpretation( "BLACK_BAND", 13 );
173    
174        /**
175         * List of all enumerations of this type.
176         */
177        private static final ColorInterpretation[] VALUES = new ColorInterpretation[] { UNDEFINED, GRAY_INDEX,
178                                                                                       PALETTE_INDEX, RED_BAND, GREEN_BAND,
179                                                                                       BLUE_BAND, ALPHA_BAND, HUE_BAND,
180                                                                                       SATURATION_BAND, LIGHTNESS_BAND,
181                                                                                       CYAN_BAND, MAGENTA_BAND,
182                                                                                       YELLOW_BAND, BLACK_BAND };
183    
184        /**
185         * Constructs an enum with the given name.
186         */
187        private ColorInterpretation( final String name, final int ordinal ) {
188            super( name, ordinal );
189        }
190    
191        /**
192         * Returns the list of <code>ColorInterpretation</code>s.
193         *
194         * @return the list of <code>ColorInterpretation</code>s.
195         */
196        public static ColorInterpretation[] values() {
197            return VALUES.clone();
198        }
199    
200        /**
201         * Returns the list of enumerations of the same kind than this enum.
202         */
203        @Override
204        public CodeList[] family() {
205            return values();
206        }
207    }