Statistics
| Revision:

gvsig-raster / org.gvsig.raster / trunk / org.gvsig.raster / org.gvsig.raster.lib / org.gvsig.raster.lib.api / src / main / java / org / gvsig / fmap / dal / coverage / store / props / ColorInterpretation.java @ 2438

History | View | Annotate | Download (5.6 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program 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
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.fmap.dal.coverage.store.props;
23

    
24
import org.gvsig.tools.persistence.Persistent;
25

    
26

    
27

    
28
/**
29
 * Interfaz que representa una interpretaci?n de color.
30
 * 
31
 * @author Nacho Brodin (nachobrodin@gmail.com)
32
 */
33
public interface ColorInterpretation extends Persistent {
34
        // Identificadores de color interpretation
35
        public static final String RED_BAND            = "Red";
36
        public static final String GREEN_BAND          = "Green";
37
        public static final String BLUE_BAND           = "Blue";
38
        public static final String ALPHA_BAND          = "Alpha";
39
        public static final String GRAY_BAND           = "Gray";
40
        public static final String PAL_BAND            = "Palette";
41
        public static final String UNDEF_BAND          = "Undefined";
42
        
43
        public static final String RED_GREEN_BAND      = "Red_Green";
44
        public static final String RED_BLUE_BAND       = "Red_Blue";
45
        public static final String GREEN_BLUE_BAND     = "Green_Blue";
46
        
47
        //Constants to initialize the color interpretation
48
        public static final String RGB                 = "RGB";
49
        public static final String BGR                 = "BGR";
50
        public static final String ARGB                = "ARGB";
51
        public static final String GRAYSCALE           = "GRAYSCALE";
52
        public static final String PALETTE             = "PALETTE";
53
        
54
        /**
55
         * Asigna un valor para la interpretaci?n de color de una banda
56
         * @param band Banda 
57
         * @param value valor
58
         */
59
        public void setColorInterpValue(int band, String value);
60
        
61
        /**
62
         * Obtiene el n?mero de entradas de interpretaci?n de color por
63
         * banda en la lista.
64
         * @return
65
         */
66
        public int length();
67
        
68
        /**
69
         * Returns true if the values Red, Green and Blue are
70
         * assigned to any band of the image or the values Gray or Palette are
71
         * assigned.
72
         * @return
73
         */
74
        public boolean hasInterpretation();
75
        
76
        /**
77
         * Returns true if the color interpretation is BGR, that is, the 
78
         * three first bands of the image are Blue, Green and Red.
79
         * @return
80
         */
81
        public boolean isBGR();
82
        
83
        /**
84
         * Returns true if the color interpretation is RGB, that is, the 
85
         * three first bands of the image are Red, Green and Blue.
86
         * @return
87
         */
88
        public boolean isRGB();
89
        
90
        /**
91
         * Returns true if the color interpretation is ARGB, that is, the 
92
         * four first bands of the image are Red, Green, Blue and Alpha.
93
         * @return
94
         */
95
        public boolean isRGBA();
96
        
97
        /**
98
         * Returns true if the color interpretation is Palette
99
         * @return
100
         */
101
        public boolean isPalette();
102
        
103
        /**
104
         * Returns true if the selected band has red, green or blue interpretation and false otherwise
105
         * @param band
106
         * @return
107
         */
108
        public boolean isColorInterpretation(int band);
109
        
110
        /**
111
         * Returns true if the selected band has gray interpretation and false otherwise
112
         * @param band
113
         * @return
114
         */
115
        public boolean isGrayInterpretation(int band);
116
        
117
        /**
118
         * Returns true if the selected band has alpha interpretation and false otherwise
119
         * @param band
120
         * @return
121
         */
122
        public boolean isAlphaInterpretation(int band);
123
        
124
        /**
125
         * Obtiene el valor de interpretaci?n de color de la entrada i. 
126
         * @param i N?mero de entrada
127
         * @return interpretaci?n de color para la entrada solicitada
128
         */
129
        public String get(int i);
130
        
131
        /**
132
         * Obtiene la posici?n de la banda que contiene el identificador pasado por par?metro 
133
         * o -1 si no tiene dicho identificador.
134
         * @return Posici?n de la banda que contiene el identificador o -1 si no lo tiene.
135
         */
136
        public int getBand(String id);
137
        
138
        /**
139
         * Consulta si la interpretaci?n de color est? por definir en la imagen.
140
         * @return true si no hay interpretaci?n de color definida y false si la hay
141
         */
142
        public boolean isUndefined();
143
        
144
        /**
145
         * Inicializa el vector de cadenas que contendr?n el nombre de la interpretaci?n 
146
         * de color asignada a cada banda. Este valor es el devuelto por la imagen.
147
         * @param values N?mero de valores
148
         */
149
        public void initColorInterpretation(int values);
150
        
151
        /**
152
         * Obtiene los valores de la interpretaci?n de color
153
         * @return String[]
154
         */
155
        public String[] getValues();
156
        
157
        /**
158
         * Returns true if one band has the "Alpha" label
159
         * @return
160
         */
161
        public boolean hasAlphaBand();
162
        
163
        /**
164
         * Returns the number of band with the label "Alpha"
165
         * @return
166
         */
167
        public int getAlphaBand();
168
        
169
        /**
170
         * A?ade un objeto DatasetColorInterpretation al actual. El resultado es la suma 
171
         * de ambos.
172
         * @param ci
173
         */
174
        public void addColorInterpretation(ColorInterpretation ci);
175
        
176
        /**
177
         * Returns an array with bands to render reading values of this color
178
         * interpretation object. Each element in the array represents band in the destination buffer
179
         * . The value in this position represents the source band which will be write 
180
         * in the destination buffer 
181
         * @return
182
         */
183
        public int[] buildRenderBands();
184
        
185
        /**
186
         * Clones this object
187
         * @return
188
         */
189
        public ColorInterpretation cloneColorInterpretation();
190
}