gvsig-raster / org.gvsig.raster / branches / org.gvsig.raster.2.4 / org.gvsig.raster / org.gvsig.raster.lib / org.gvsig.raster.lib.legend / org.gvsig.raster.lib.legend.api / src / main / java / org / gvsig / raster / lib / legend / api / ColorInterpretation.java @ 6317
History | View | Annotate | Download (5.73 KB)
1 |
package org.gvsig.raster.lib.legend.api; |
---|---|
2 |
|
3 |
import org.gvsig.tools.persistence.Persistent; |
4 |
|
5 |
/**
|
6 |
* @author fdiaz
|
7 |
*
|
8 |
*/
|
9 |
public interface ColorInterpretation extends Persistent, Cloneable { |
10 |
|
11 |
// Color interpretation identifiers
|
12 |
public static final String RED_BAND = "Red"; |
13 |
public static final String GREEN_BAND = "Green"; |
14 |
public static final String BLUE_BAND = "Blue"; |
15 |
public static final String ALPHA_BAND = "Alpha"; |
16 |
public static final String GRAY_BAND = "Gray"; |
17 |
|
18 |
// public static final String RED_GREEN_BAND = "Red_Green"; // YELLOW_BAND?
|
19 |
// public static final String RED_BLUE_BAND = "Red_Blue"; // MAGENTA_BAND?
|
20 |
// public static final String GREEN_BLUE_BAND = "Green_Blue"; // CYAN_BAND?
|
21 |
|
22 |
public static final String HUE_BAND = "Hue"; |
23 |
public static final String SATURATION_BAND = "Saturation"; |
24 |
public static final String LIGHTNESS_BAND = "Lightness"; |
25 |
|
26 |
public static final String CYAN_BAND = "Cyan"; |
27 |
public static final String MAGENTA_BAND = "Magenta"; |
28 |
public static final String YELLOW_BAND = "Yellow"; |
29 |
public static final String BLACK_BAND = "Black"; |
30 |
|
31 |
public static final String YCBCR_Y_BAND = "YCbCr_Y"; |
32 |
public static final String YCBCR_CB_BAND = "YCbCr_Cb"; |
33 |
public static final String YCBCR_CR_BAND = "YCbCr_Cr"; |
34 |
|
35 |
public static final String PALETTE_BAND = "Palette"; |
36 |
|
37 |
public static final String UNDEFINED_BAND = "Undefined"; |
38 |
|
39 |
// Constants to initialize the color interpretation
|
40 |
public static final String RGB = "RGB"; |
41 |
public static final String BGR = "BGR"; |
42 |
public static final String ARGB = "ARGB"; |
43 |
public static final String GRAYSCALE = "GRAYSCALE"; |
44 |
public static final String PALETTE = "PALETTE"; |
45 |
public static final String HSL = "HSL"; |
46 |
public static final String CMYK = "CMYK"; |
47 |
public static final String YCBCR = "YCBCR"; |
48 |
|
49 |
/**
|
50 |
* Set color interpretation value to band
|
51 |
*
|
52 |
* @param band
|
53 |
* Band
|
54 |
* @param value
|
55 |
* Color interpretation value
|
56 |
*/
|
57 |
public void setColorInterpValue(int band, String value); |
58 |
|
59 |
/**
|
60 |
* @return Returns the number of assigned color interpretation values
|
61 |
*/
|
62 |
public int length(); |
63 |
|
64 |
/**
|
65 |
* @return Returns true if the color values are
|
66 |
* assigned to any band of the image or the values Gray or Palette
|
67 |
* are
|
68 |
* assigned.
|
69 |
*/
|
70 |
public boolean hasInterpretation(); |
71 |
|
72 |
/**
|
73 |
* @return Returns true if the color interpretation is BGR, that is, the
|
74 |
* three first bands of the image are Blue, Green and Red.
|
75 |
*
|
76 |
*/
|
77 |
public boolean isBGR(); |
78 |
|
79 |
/**
|
80 |
* @return Returns true if the color interpretation is RGB, that is, the
|
81 |
* three first bands of the image are Red, Green and Blue.
|
82 |
*/
|
83 |
public boolean isRGB(); |
84 |
|
85 |
/**
|
86 |
* @return Returns true if the color interpretation is ARGB, that is, the
|
87 |
* four first bands of the image are Red, Green, Blue and Alpha.
|
88 |
*/
|
89 |
public boolean isRGBA(); |
90 |
|
91 |
/**
|
92 |
* @return Returns true if the color interpretation is Gray
|
93 |
*/
|
94 |
public boolean isGray(); |
95 |
|
96 |
/**
|
97 |
* @return Returns true if the color interpretation is Palette
|
98 |
*/
|
99 |
public boolean isPalette(); |
100 |
|
101 |
/**
|
102 |
* @return Returns true if the color interpretation is HSL
|
103 |
*/
|
104 |
public boolean isHSL(); |
105 |
|
106 |
/**
|
107 |
* @return Returns true if the color interpretation is CMYK
|
108 |
*/
|
109 |
public boolean isCMYK(); |
110 |
|
111 |
/**
|
112 |
* @return Returns true if the color interpretation YCBCR
|
113 |
*/
|
114 |
public boolean isYCBCR(); |
115 |
|
116 |
/**
|
117 |
* @param band
|
118 |
* @return Returns true if the selected band has color
|
119 |
* interpretation
|
120 |
* and false otherwise
|
121 |
*/
|
122 |
public boolean isColorInterpretation(int band); |
123 |
|
124 |
/**
|
125 |
* @param band
|
126 |
* @return Returns true if the selected band has gray interpretation and
|
127 |
* false
|
128 |
* otherwise
|
129 |
*/
|
130 |
public boolean isGrayInterpretation(int band); |
131 |
|
132 |
/**
|
133 |
* @param band
|
134 |
* @return Returns true if the selected band has palette interpretation and
|
135 |
* false
|
136 |
* otherwise
|
137 |
*/
|
138 |
public boolean isPaletteInterpretation(int band); |
139 |
|
140 |
/**
|
141 |
*
|
142 |
*
|
143 |
* @param band
|
144 |
* @return Returns true if the selected band has alpha interpretation and
|
145 |
* false
|
146 |
* otherwise
|
147 |
*/
|
148 |
public boolean isAlphaInterpretation(int band); |
149 |
|
150 |
/**
|
151 |
* Get color interpretation of band.
|
152 |
*
|
153 |
* @param i
|
154 |
* Number of band
|
155 |
* @return Color interpretation defined of band
|
156 |
*/
|
157 |
public String get(int i); |
158 |
|
159 |
/**
|
160 |
* Gets the band position defined with color interpretation received as
|
161 |
* parameter.
|
162 |
*
|
163 |
* @param id
|
164 |
* Color interpretation definition
|
165 |
* @return Index of band
|
166 |
*/
|
167 |
public int getBand(String id); |
168 |
|
169 |
/**
|
170 |
* Gets if color interpretation is defined
|
171 |
*
|
172 |
* @return True if color interpretation is defined, false if it is undefined
|
173 |
*/
|
174 |
public boolean isUndefined(); |
175 |
|
176 |
/**
|
177 |
* Gets color interpretation of all bands
|
178 |
*
|
179 |
* @return Array with color interpretation
|
180 |
*/
|
181 |
public String[] getValues(); |
182 |
|
183 |
/**
|
184 |
* @return Returns true if one band has the "Alpha" label
|
185 |
*/
|
186 |
public boolean hasAlphaBand(); |
187 |
|
188 |
/**
|
189 |
* @return Returns the number of band with the label "Alpha"
|
190 |
*/
|
191 |
public int getAlphaBand(); |
192 |
|
193 |
/**
|
194 |
* Adds a color interpretation to this color interpretation. The result is
|
195 |
* the addition of color interpretations.
|
196 |
*
|
197 |
* @param ci
|
198 |
*/
|
199 |
public void addColorInterpretation(ColorInterpretation ci); |
200 |
|
201 |
/**
|
202 |
* Copy from the color interpretation received as parameter
|
203 |
*
|
204 |
* @param colorInterpretation
|
205 |
*/
|
206 |
public void copyFrom(ColorInterpretation colorInterpretation); |
207 |
} |