Revision 9774
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.raster.cache.tile.TileCacheLibrary |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/Buffer.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer; |
|
2 |
|
|
3 |
import java.awt.geom.Rectangle2D; |
|
4 |
import java.awt.image.DataBuffer; |
|
5 |
import java.io.IOException; |
|
6 |
import java.util.ArrayList; |
|
7 |
|
|
8 |
import org.gvsig.raster.cache.buffer.exception.BandNotCompatibleException; |
|
9 |
import org.gvsig.raster.cache.buffer.exception.OperationNotSupportedException; |
|
10 |
import org.gvsig.raster.cache.buffer.exception.ProcessInterruptedException; |
|
11 |
import org.gvsig.raster.cache.buffer.exception.WrongParameterException; |
|
12 |
import org.gvsig.raster.cache.buffer.histogram.Histogramable; |
|
13 |
|
|
14 |
/** |
|
15 |
* Interfaz que contiene las operaciones que debe soportar un buffer de datos. |
|
16 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
17 |
* |
|
18 |
*/ |
|
19 |
public interface Buffer extends Histogramable { |
|
20 |
public static boolean noDataValueEnable = false; |
|
21 |
public static double defaultNoDataValue = -99999.0; |
|
22 |
|
|
23 |
public final static int TYPE_UNDEFINED = DataBuffer.TYPE_UNDEFINED; |
|
24 |
public final static int TYPE_BYTE = DataBuffer.TYPE_BYTE; |
|
25 |
public final static int TYPE_SHORT = DataBuffer.TYPE_SHORT; |
|
26 |
public final static int TYPE_USHORT = DataBuffer.TYPE_USHORT; |
|
27 |
public final static int TYPE_INT = DataBuffer.TYPE_INT; |
|
28 |
public final static int TYPE_FLOAT = DataBuffer.TYPE_FLOAT; |
|
29 |
public final static int TYPE_DOUBLE = DataBuffer.TYPE_DOUBLE; |
|
30 |
|
|
31 |
//Read type constants |
|
32 |
public static final int READ_ONLY = 0; |
|
33 |
public static final int READ_WRITE = 1; |
|
34 |
//If the returned buffer is a cache buffer then it will have vertical stripes |
|
35 |
public static final int READ_WRITE_CVERT = 2; |
|
36 |
|
|
37 |
//************************************** |
|
38 |
//************GETTING INFO************** |
|
39 |
//************************************** |
|
40 |
|
|
41 |
/** |
|
42 |
* Ancho del raster |
|
43 |
* @return Entero con el ancho del raster |
|
44 |
*/ |
|
45 |
public int getWidth(); |
|
46 |
|
|
47 |
/** |
|
48 |
* Alto del raster |
|
49 |
* @return Entero con el alto del raster |
|
50 |
*/ |
|
51 |
public int getHeight(); |
|
52 |
|
|
53 |
/** |
|
54 |
* N?mero de bandas |
|
55 |
* @return Entero con el n?mero de bandas |
|
56 |
*/ |
|
57 |
public int getBandCount(); |
|
58 |
|
|
59 |
/** |
|
60 |
* Obtiene el tipo de dato. Los tipos de dato posibles est?n definidos en IRaster. |
|
61 |
* @return tipo de datos |
|
62 |
*/ |
|
63 |
public int getDataType(); |
|
64 |
|
|
65 |
/** |
|
66 |
* Asigna el tipo de dato. Los tipos de dato posibles est?n definidos en IRaster. |
|
67 |
* @param dataType Tipo de dato del buffer |
|
68 |
*/ |
|
69 |
public void setDataType(int dataType); |
|
70 |
|
|
71 |
/** |
|
72 |
* Get no data value |
|
73 |
* @return double |
|
74 |
*/ |
|
75 |
public BufferNoData getNoDataValue(); |
|
76 |
|
|
77 |
/** |
|
78 |
* Sets no data value |
|
79 |
* @return double |
|
80 |
*/ |
|
81 |
public void setNoDataValue(BufferNoData noDataValue); |
|
82 |
|
|
83 |
/** |
|
84 |
* Get true if current buffer is writable and false if is not. |
|
85 |
* @return true or false |
|
86 |
*/ |
|
87 |
public boolean isWritable(); |
|
88 |
|
|
89 |
/** |
|
90 |
* Obtiene true si el pixel pasado por par?metro cae dentro de los l?mites |
|
91 |
* del rater y false si cae fuera. |
|
92 |
* @param x Posici?n X del pixel a averiguar |
|
93 |
* @param y Posici?n Y del pixel a averiguar |
|
94 |
* @return true si est? dentro y false si cae fuera. |
|
95 |
*/ |
|
96 |
public boolean isInside(int x, int y); |
|
97 |
|
|
98 |
/** |
|
99 |
* Gets a bouding box of this buffer |
|
100 |
* @return |
|
101 |
*/ |
|
102 |
public Rectangle2D getDataExtent(); |
|
103 |
|
|
104 |
/** |
|
105 |
* Sets the bounding box of this buffer |
|
106 |
* @param extent |
|
107 |
*/ |
|
108 |
public void setDataExtent(Rectangle2D extent); |
|
109 |
|
|
110 |
/** |
|
111 |
* Libera el buffer de memoria |
|
112 |
* @throws IOException |
|
113 |
*/ |
|
114 |
public void free() throws IOException; |
|
115 |
|
|
116 |
/** |
|
117 |
* Sets the RasterDataStore reference |
|
118 |
* @param store |
|
119 |
*/ |
|
120 |
public void setStore(Object store); |
|
121 |
|
|
122 |
/** |
|
123 |
* Gets the RasterDataStore reference |
|
124 |
* @return |
|
125 |
*/ |
|
126 |
public Object getStore(); |
|
127 |
|
|
128 |
//************************************** |
|
129 |
//************GETTING DATA************** |
|
130 |
//************************************** |
|
131 |
|
|
132 |
//*********************************************** |
|
133 |
//Obtiene una linea de datos de todas las bandas |
|
134 |
|
|
135 |
/** |
|
136 |
* Obtiene una l?nea de datos con todas las bandas para buffers con tipo |
|
137 |
* de dato byte. |
|
138 |
* @param line N?mero de l?nea del buffer a recuperar |
|
139 |
* @return Array bidimensional conteniendo la l?nea de datos donde la primera |
|
140 |
* dimensi?n representa las bandas y la segunda la posici?n en la l?nea |
|
141 |
*/ |
|
142 |
public byte[][] getLineByte(int line) throws OperationNotSupportedException; |
|
143 |
|
|
144 |
/** |
|
145 |
* Obtiene una l?nea de datos con todas las bandas para buffers con tipo |
|
146 |
* de dato short. |
|
147 |
* @param line N?mero de l?nea del buffer a recuperar |
|
148 |
* @return Array bidimensional conteniendo la l?nea de datos donde la primera |
|
149 |
* dimensi?n representa las bandas y la segunda la posici?n en la l?nea |
|
150 |
*/ |
|
151 |
public short[][] getLineShort(int line) throws OperationNotSupportedException; |
|
152 |
|
|
153 |
/** |
|
154 |
* Obtiene una l?nea de datos con todas las bandas para buffers con tipo |
|
155 |
* de dato int. |
|
156 |
* @param line N?mero de l?nea del buffer a recuperar |
|
157 |
* @return Array bidimensional conteniendo la l?nea de datos donde la primera |
|
158 |
* dimensi?n representa las bandas y la segunda la posici?n en la l?nea |
|
159 |
*/ |
|
160 |
public int[][] getLineInt(int line) throws OperationNotSupportedException; |
|
161 |
|
|
162 |
/** |
|
163 |
* Obtiene una l?nea de datos con todas las bandas para buffers con tipo |
|
164 |
* de dato float. |
|
165 |
* @param line N?mero de l?nea del buffer a recuperar |
|
166 |
* @return Array bidimensional conteniendo la l?nea de datos donde la primera |
|
167 |
* dimensi?n representa las bandas y la segunda la posici?n en la l?nea |
|
168 |
*/ |
|
169 |
public float[][] getLineFloat(int line) throws OperationNotSupportedException; |
|
170 |
|
|
171 |
/** |
|
172 |
* Obtiene una l?nea de datos con todas las bandas para buffers con tipo |
|
173 |
* de dato double. |
|
174 |
* @param line N?mero de l?nea del buffer a recuperar |
|
175 |
* @return Array bidimensional conteniendo la l?nea de datos donde la primera |
|
176 |
* dimensi?n representa las bandas y la segunda la posici?n en la l?nea |
|
177 |
*/ |
|
178 |
public double[][] getLineDouble(int line) throws OperationNotSupportedException; |
|
179 |
|
|
180 |
//*********************************************** |
|
181 |
//Obtiene una linea de datos de una banda |
|
182 |
|
|
183 |
/** |
|
184 |
* Obtiene una l?nea de datos de la banda solicitada para buffers con tipo |
|
185 |
* de dato byte. |
|
186 |
* @param line N?mero de l?nea del buffer a recuperar |
|
187 |
* @param band N?mero de banda a recuperar |
|
188 |
* @return Array unidimensional que representa la l?nea de datos. |
|
189 |
*/ |
|
190 |
public byte[] getLineFromBandByte(int line, int band) throws OperationNotSupportedException; |
|
191 |
|
|
192 |
/** |
|
193 |
* Obtiene una l?nea de datos de la banda solicitada para buffers con tipo |
|
194 |
* de dato short. |
|
195 |
* @param line N?mero de l?nea del buffer a recuperar |
|
196 |
* @param band N?mero de banda a recuperar |
|
197 |
* @return Array unidimensional que representa la l?nea de datos. |
|
198 |
*/ |
|
199 |
public short[] getLineFromBandShort(int line, int band) throws OperationNotSupportedException; |
|
200 |
|
|
201 |
/** |
|
202 |
* Obtiene una l?nea de datos de la banda solicitada para buffers con tipo |
|
203 |
* de dato int. |
|
204 |
* @param line N?mero de l?nea del buffer a recuperar |
|
205 |
* @param band N?mero de banda a recuperar |
|
206 |
* @return Array unidimensional que representa la l?nea de datos. |
|
207 |
*/ |
|
208 |
public int[] getLineFromBandInt(int line, int band) throws OperationNotSupportedException; |
|
209 |
|
|
210 |
/** |
|
211 |
* Obtiene una l?nea de datos de la banda solicitada para buffers con tipo |
|
212 |
* de dato float. |
|
213 |
* @param line N?mero de l?nea del buffer a recuperar |
|
214 |
* @param band N?mero de banda a recuperar |
|
215 |
* @return Array unidimensional que representa la l?nea de datos. |
|
216 |
*/ |
|
217 |
public float[] getLineFromBandFloat(int line, int band) throws OperationNotSupportedException; |
|
218 |
|
|
219 |
/** |
|
220 |
* Obtiene una l?nea de datos de la banda solicitada para buffers con tipo |
|
221 |
* de dato double. |
|
222 |
* @param line N?mero de l?nea del buffer a recuperar |
|
223 |
* @param band N?mero de banda a recuperar |
|
224 |
* @return Array unidimensional que representa la l?nea de datos. |
|
225 |
*/ |
|
226 |
public double[] getLineFromBandDouble(int line, int band) throws OperationNotSupportedException; |
|
227 |
|
|
228 |
//*********************************************** |
|
229 |
//Obtiene un elemento de la matriz |
|
230 |
|
|
231 |
/** |
|
232 |
* Gets one element from the array if this is byte datatype |
|
233 |
* @param line Y position |
|
234 |
* @param col X position |
|
235 |
* @param band Number of band to read |
|
236 |
* @return Readed element |
|
237 |
*/ |
|
238 |
public byte getElemByte(int line, int col, int band); |
|
239 |
|
|
240 |
/** |
|
241 |
* Gets one element from the array if this is short datatype |
|
242 |
* @param line Y position |
|
243 |
* @param col X position |
|
244 |
* @param band Number of band to read |
|
245 |
* @return Readed element |
|
246 |
*/ |
|
247 |
public short getElemShort(int line, int col, int band); |
|
248 |
|
|
249 |
/** |
|
250 |
* Gets one element from the array if this is int datatype |
|
251 |
* @param line Y position |
|
252 |
* @param col X position |
|
253 |
* @param band Number of band to read |
|
254 |
* @return Readed element |
|
255 |
*/ |
|
256 |
public int getElemInt(int line, int col, int band); |
|
257 |
|
|
258 |
/** |
|
259 |
* Gets one element from the array if this is float datatype |
|
260 |
* @param line Y position |
|
261 |
* @param col X position |
|
262 |
* @param band Number of band to read |
|
263 |
* @return Readed element |
|
264 |
*/ |
|
265 |
public float getElemFloat(int line, int col, int band); |
|
266 |
|
|
267 |
/** |
|
268 |
* Gets one element from the array if this is double datatype |
|
269 |
* @param line Y position |
|
270 |
* @param col X position |
|
271 |
* @param band Number of band to read |
|
272 |
* @return Readed element |
|
273 |
*/ |
|
274 |
public double getElemDouble(int line, int col, int band); |
|
275 |
|
|
276 |
//*********************************************** |
|
277 |
//Copia un elemento de todas la bandas en el buffer pasado por par?metro |
|
278 |
|
|
279 |
/** |
|
280 |
* Gets one element of each band from the array if this is byte datatype |
|
281 |
* @param line Y position |
|
282 |
* @param col X position |
|
283 |
* @param data Each element of this array is a diferent band of the position line, col |
|
284 |
*/ |
|
285 |
public void getElemByte(int line, int col, byte[] data); |
|
286 |
|
|
287 |
/** |
|
288 |
* Gets one element of each band from the array if this is short datatype |
|
289 |
* @param line Y position |
|
290 |
* @param col X position |
|
291 |
* @param data Each element of this array is a diferent band of the position line, col |
|
292 |
*/ |
|
293 |
public void getElemShort(int line, int col, short[] data); |
|
294 |
|
|
295 |
/** |
|
296 |
* Gets one element of each band from the array if this is int datatype |
|
297 |
* @param line Y position |
|
298 |
* @param col X position |
|
299 |
* @param data Each element of this array is a diferent band of the position line, col |
|
300 |
*/ |
|
301 |
public void getElemInt(int line, int col, int[] data); |
|
302 |
|
|
303 |
/** |
|
304 |
* Gets one element of each band from the array if this is float datatype |
|
305 |
* @param line Y position |
|
306 |
* @param col X position |
|
307 |
* @param data Each element of this array is a diferent band of the position line, col |
|
308 |
*/ |
|
309 |
public void getElemFloat(int line, int col, float[] data); |
|
310 |
|
|
311 |
/** |
|
312 |
* Gets one element of each band from the array if this is double datatype |
|
313 |
* @param line Y position |
|
314 |
* @param col X position |
|
315 |
* @param data Each element of this array is a diferent band of the position line, col |
|
316 |
*/ |
|
317 |
public void getElemDouble(int line, int col, double[] data); |
|
318 |
|
|
319 |
//************************************** |
|
320 |
//************SETTING DATA************** |
|
321 |
//************************************** |
|
322 |
|
|
323 |
//*********************************************** |
|
324 |
//Asigna una linea de datos a una banda |
|
325 |
|
|
326 |
/** |
|
327 |
* Sets a line of byte data |
|
328 |
* @param data Array of data |
|
329 |
* @param line Y position |
|
330 |
* @param band N?mber of band |
|
331 |
* @throws OperationNotSupportedException |
|
332 |
*/ |
|
333 |
public void setLineInBandByte(byte[] data, int line, int band) throws OperationNotSupportedException; |
|
334 |
|
|
335 |
/** |
|
336 |
* Sets a line of short data |
|
337 |
* @param data Array of data |
|
338 |
* @param line Y position |
|
339 |
* @param band N?mber of band |
|
340 |
*/ |
|
341 |
public void setLineInBandShort(short[] data, int line, int band) throws OperationNotSupportedException; |
|
342 |
|
|
343 |
/** |
|
344 |
* Sets a line of int data |
|
345 |
* @param data Array of data |
|
346 |
* @param line Y position |
|
347 |
* @param band N?mber of band |
|
348 |
*/ |
|
349 |
public void setLineInBandInt(int[] data, int line, int band) throws OperationNotSupportedException; |
|
350 |
|
|
351 |
/** |
|
352 |
* Sets a line of float data |
|
353 |
* @param data Array of data |
|
354 |
* @param line Y position |
|
355 |
* @param band N?mber of band |
|
356 |
*/ |
|
357 |
public void setLineInBandFloat(float[] data, int line, int band) throws OperationNotSupportedException; |
|
358 |
|
|
359 |
/** |
|
360 |
* Sets a line of double data |
|
361 |
* @param data Array of data |
|
362 |
* @param line Y position |
|
363 |
* @param band N?mber of band |
|
364 |
*/ |
|
365 |
public void setLineInBandDouble(double[] data, int line, int band) throws OperationNotSupportedException; |
|
366 |
|
|
367 |
//*********************************************** |
|
368 |
//Asigna una linea de datos a todas las bandas |
|
369 |
|
|
370 |
public void setLineByte(byte[][] data, int line) throws OperationNotSupportedException; |
|
371 |
|
|
372 |
public void setLineShort(short[][] data, int line) throws OperationNotSupportedException; |
|
373 |
|
|
374 |
public void setLineInt(int[][] data, int line) throws OperationNotSupportedException; |
|
375 |
|
|
376 |
public void setLineFloat(float[][] data, int line) throws OperationNotSupportedException; |
|
377 |
|
|
378 |
public void setLineDouble(double[][] data, int line) throws OperationNotSupportedException; |
|
379 |
|
|
380 |
//********************************************** |
|
381 |
//Asigna un elemento de la matriz |
|
382 |
|
|
383 |
public void setElem(int line, int col, int band, byte data) throws OperationNotSupportedException; |
|
384 |
|
|
385 |
public void setElem(int line, int col, int band, short data) throws OperationNotSupportedException; |
|
386 |
|
|
387 |
public void setElem(int line, int col, int band, int data) throws OperationNotSupportedException; |
|
388 |
|
|
389 |
public void setElem(int line, int col, int band, float data) throws OperationNotSupportedException; |
|
390 |
|
|
391 |
public void setElem(int line, int col, int band, double data) throws OperationNotSupportedException; |
|
392 |
|
|
393 |
//*********************************************** |
|
394 |
//Asigna un elemento a todas la bandas en el buffer pasado por par?metro |
|
395 |
|
|
396 |
public void setElemByte(int line, int col, byte[] data) throws OperationNotSupportedException; |
|
397 |
|
|
398 |
public void setElemShort(int line, int col, short[] data) throws OperationNotSupportedException; |
|
399 |
|
|
400 |
public void setElemInt(int line, int col, int[] data) throws OperationNotSupportedException; |
|
401 |
|
|
402 |
public void setElemFloat(int line, int col, float[] data) throws OperationNotSupportedException; |
|
403 |
|
|
404 |
public void setElemDouble(int line, int col, double[] data) throws OperationNotSupportedException; |
|
405 |
|
|
406 |
//*********************************************** |
|
407 |
//Inicializa una banda a un valor pasado por par?metro |
|
408 |
|
|
409 |
public void assign(int band, byte value) throws OperationNotSupportedException; |
|
410 |
|
|
411 |
public void assign(int band, short value) throws OperationNotSupportedException; |
|
412 |
|
|
413 |
public void assign(int band, int value) throws OperationNotSupportedException; |
|
414 |
|
|
415 |
public void assign(int band, float value) throws OperationNotSupportedException; |
|
416 |
|
|
417 |
public void assign(int band, double value) throws OperationNotSupportedException; |
|
418 |
|
|
419 |
//************************************** |
|
420 |
//**********BANDS OPERATIONS************ |
|
421 |
//************************************** |
|
422 |
|
|
423 |
/** |
|
424 |
* Removes a band from memory buffer |
|
425 |
* @param band Number of band |
|
426 |
*/ |
|
427 |
public void removeBand(int pos) throws IOException ; |
|
428 |
|
|
429 |
/** |
|
430 |
* Makes an empty band without initial value in the selected position |
|
431 |
* @return IRasterBand New band |
|
432 |
* @throws IOException |
|
433 |
*/ |
|
434 |
public Band addBand(int pos) throws IOException; |
|
435 |
|
|
436 |
/** |
|
437 |
* Sustituye una banda completa copiando los datos de la que se pasa por par?metro |
|
438 |
* @param nBand N?mero de banda a sustituir |
|
439 |
* @param banda a copiar |
|
440 |
* @throws OperationNotSupportedException |
|
441 |
*/ |
|
442 |
public void copyBand(int nBand, Band band) throws BandNotCompatibleException, OperationNotSupportedException; |
|
443 |
|
|
444 |
/** |
|
445 |
* Creates a new band assigning other by reference. Owing to this fact, the band |
|
446 |
* assigned must be the same kind of buffer. |
|
447 |
* @param nBand |
|
448 |
* band number to be assigned |
|
449 |
* @param banda |
|
450 |
* Assigned band |
|
451 |
* @throws IOException |
|
452 |
*/ |
|
453 |
public void assignBand(int nBand, Band band) throws IOException, BandNotCompatibleException; |
|
454 |
|
|
455 |
/** |
|
456 |
* Gets a band from raster by reference. |
|
457 |
* @param nBand |
|
458 |
* Band number |
|
459 |
*/ |
|
460 |
public Band getBand(int nBand); |
|
461 |
|
|
462 |
/** |
|
463 |
* Gets a copy of one band from ra. |
|
464 |
* @param nBand |
|
465 |
* Band number |
|
466 |
*/ |
|
467 |
public Band getBandCopy(int nBand); |
|
468 |
|
|
469 |
/** |
|
470 |
* Gets all bands in an IRasterBand array by reference. |
|
471 |
* @return Array of IRasterBand |
|
472 |
*/ |
|
473 |
public Band[] getBands(); |
|
474 |
|
|
475 |
/** |
|
476 |
* Gets all bands in an IRasterBand array by reference. |
|
477 |
* @return ArrayList of IRasterBand |
|
478 |
*/ |
|
479 |
public ArrayList<Band> getBandList(); |
|
480 |
|
|
481 |
/** |
|
482 |
* Gets a buffer with only one band. The number of this band is specified with the parameter. |
|
483 |
* @param nBand |
|
484 |
* Band number |
|
485 |
* @throws IOException |
|
486 |
* @throws OperationNotSupportedException |
|
487 |
*/ |
|
488 |
public Buffer getBufferWithOneBand(int nBand) throws IOException, OperationNotSupportedException; |
|
489 |
|
|
490 |
/** |
|
491 |
* This method create a new band with the value in selected in |
|
492 |
* the parameter. Settings in the new band are readed from the existing |
|
493 |
* buffer. |
|
494 |
* @param defaultValue |
|
495 |
* Default value in new band |
|
496 |
* @throws OperationNotSupportedException |
|
497 |
*/ |
|
498 |
public Band createBand(double defaultValue) throws OperationNotSupportedException; |
|
499 |
|
|
500 |
/** |
|
501 |
* Replica la banda de una posici?n sobre otra. Si la banda de destino no existe |
|
502 |
* se crea nueva. Si la posici?n de la banda de destino est? intercalada entre bandas |
|
503 |
* que ya existen las otras se desplazan hacia abajo, NO se machacan los datos de ninguna. |
|
504 |
* Los datos se replican por referencia por lo que al modificar la banda original las |
|
505 |
* del resto quedar?n afectadas. |
|
506 |
* @param orig. Posici?n de la banda de origen. |
|
507 |
* @param dest. Posici?n de la banda destino |
|
508 |
* @throws IOException |
|
509 |
*/ |
|
510 |
public void replicateBand(int orig, int dest) throws IOException; |
|
511 |
|
|
512 |
/** |
|
513 |
* Clona el buffer actual y devuelve el clone |
|
514 |
* @return Buffer clonado |
|
515 |
*/ |
|
516 |
public Buffer cloneBuffer(); |
|
517 |
|
|
518 |
/** |
|
519 |
* Swap two bands. |
|
520 |
* @param band1 |
|
521 |
* band to swap with band2 |
|
522 |
* @param band2 |
|
523 |
* band to swap with band1 |
|
524 |
* @throws IOException |
|
525 |
* @throws WrongParameterException |
|
526 |
*/ |
|
527 |
public void swapBands(int band1, int band2) throws WrongParameterException, IOException; |
|
528 |
|
|
529 |
/** |
|
530 |
* Intercambia la posici?n de las bandas. La nueva posici?n viene dada por el vector |
|
531 |
* pasado por par?metro. Cada posici?n del vector es una banda del buffer y el contenido de |
|
532 |
* esa posici?n es la banda que se dibujar? sobre ese buffer. |
|
533 |
* <P> |
|
534 |
* Por ejemplo un array con los valores: |
|
535 |
* [2, 0, 1] significa que la banda que ocupa ahora la posici?n 2 pasar? a ocupar la 0, la que |
|
536 |
* tiene la posici?n 0 pasa a ocupar la 1 y la que tiene la posici?n 1 pasa a ocupar la 2. |
|
537 |
* </P> |
|
538 |
* @param bands Array con la nueva distribuci?n de bandas |
|
539 |
* @throws WrongParameterException |
|
540 |
* @throws IOException |
|
541 |
*/ |
|
542 |
public void swapBands(int[] bands) throws WrongParameterException, IOException; |
|
543 |
|
|
544 |
/** |
|
545 |
* Asigna el valor de no valido. |
|
546 |
* @param value |
|
547 |
*/ |
|
548 |
public void setNotValidValue(double value); |
|
549 |
|
|
550 |
/** |
|
551 |
* Obtiene el valor de no valido. |
|
552 |
* @return value |
|
553 |
*/ |
|
554 |
public double getNotValidValue(); |
|
555 |
|
|
556 |
/** |
|
557 |
* Asigna una banda al valor especificado como no valido. Esta banda es com?n para todas las bandas |
|
558 |
* del buffer, es decir se asigna por referencia. No tiene el mismo resultado que asignar una banda |
|
559 |
* a un valor fijo. |
|
560 |
* @param iBand N?mero de banda |
|
561 |
* @throws OperationNotSupportedException |
|
562 |
*/ |
|
563 |
public void assignBandToNotValid(int iBand) throws OperationNotSupportedException; |
|
564 |
|
|
565 |
/** |
|
566 |
* Gets the statistics object |
|
567 |
* @return BufferStats |
|
568 |
*/ |
|
569 |
public BufferStats getStatistics(); |
|
570 |
|
|
571 |
/** |
|
572 |
* Ajusta el ?rea del grid a un ancho y un alto dado en pixeles. Este ajuste se har? |
|
573 |
* en relaci?n a un m?todo de interpolaci?n definido en el par?metro. |
|
574 |
* @param w Ancho de la nueva imagen. |
|
575 |
* @param h Alto de la nueva imagen. |
|
576 |
* @param interpolation M?todo de interpolaci?n que se usar? en el ajuste. |
|
577 |
*/ |
|
578 |
public Buffer getAdjustedWindow(int w, int h, int interpolationMethod) throws ProcessInterruptedException; |
|
579 |
|
|
580 |
/** |
|
581 |
* Selects bands for read-only buffers which referencing a image in disk |
|
582 |
* @param bands |
|
583 |
*/ |
|
584 |
public void addDrawableBands(int[] bands); |
|
585 |
} |
|
0 | 586 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/histogram/HistogramComputer.java | ||
---|---|---|
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.raster.cache.buffer.histogram; |
|
23 |
|
|
24 |
import org.gvsig.raster.cache.buffer.exception.HistogramException; |
|
25 |
import org.gvsig.raster.cache.buffer.exception.ProcessInterruptedException; |
|
26 |
|
|
27 |
/** |
|
28 |
* |
|
29 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
30 |
*/ |
|
31 |
public interface HistogramComputer { |
|
32 |
|
|
33 |
/** |
|
34 |
* Obtiene el minimo valor de las estadisticas de un histograma. |
|
35 |
* @return double |
|
36 |
*/ |
|
37 |
public double getMinimum(); |
|
38 |
|
|
39 |
/** |
|
40 |
* Obtiene el maximo valor de las estadisticas de un histograma. |
|
41 |
* @return double |
|
42 |
*/ |
|
43 |
public double getMaximum(); |
|
44 |
|
|
45 |
/** |
|
46 |
* Obtiene el histograma. |
|
47 |
* @return histograma |
|
48 |
*/ |
|
49 |
public BufferHistogram getBufferHistogram(int numberOfClasses) throws HistogramException, ProcessInterruptedException; |
|
50 |
|
|
51 |
/** |
|
52 |
* Pone a cero el porcentaje de progreso del proceso de calculo de histograma |
|
53 |
*/ |
|
54 |
public void resetPercent(); |
|
55 |
|
|
56 |
/** |
|
57 |
* Obtiene el porcentaje de progreso del proceso de calculo de histograma |
|
58 |
* @return porcentaje de progreso |
|
59 |
*/ |
|
60 |
public int getPercent(); |
|
61 |
|
|
62 |
/** |
|
63 |
* Force to recalculate the histogram next time that the method getBufferHistogram |
|
64 |
* be called |
|
65 |
*/ |
|
66 |
public void refreshHistogram(); |
|
67 |
|
|
68 |
} |
|
0 | 69 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/histogram/package.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
4 |
<head> |
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
6 |
<title>org.gvsig.raster.cache.buffer.histogram package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>Classes to get a buffer histogram</p> |
|
11 |
|
|
12 |
<p> |
|
13 |
</p> |
|
14 |
|
|
15 |
</body> |
|
16 |
</html> |
|
0 | 17 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/histogram/Histogramable.java | ||
---|---|---|
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.raster.cache.buffer.histogram; |
|
23 |
|
|
24 |
import org.gvsig.raster.cache.buffer.exception.HistogramException; |
|
25 |
import org.gvsig.raster.cache.buffer.exception.ProcessInterruptedException; |
|
26 |
|
|
27 |
|
|
28 |
/** |
|
29 |
* This interface should be implemented for every class that is capable to |
|
30 |
* provide an object to compute its histogram. |
|
31 |
* |
|
32 |
* @version 27/03/2007 |
|
33 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
34 |
* |
|
35 |
*/ |
|
36 |
public interface Histogramable { |
|
37 |
|
|
38 |
/** |
|
39 |
* Gets the object which computes the histogram |
|
40 |
* @return Histograma |
|
41 |
*/ |
|
42 |
public HistogramComputer getHistogramComputer() throws HistogramException, ProcessInterruptedException; |
|
43 |
|
|
44 |
} |
|
0 | 45 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/histogram/HistogramClass.java | ||
---|---|---|
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.raster.cache.buffer.histogram; |
|
23 |
|
|
24 |
|
|
25 |
/** |
|
26 |
* Clase que define un intervalo de datos. Es util para cosas como el calculo de histogramas |
|
27 |
* con tipo de datos en coma flotante en el cual hay que dividir los intervalos en |
|
28 |
* clases. Las clases se tendr?n en cuenta como un intervalo el cual el menor es cerrado y el |
|
29 |
* mayor abierto, es decir |
|
30 |
* <PRE> |
|
31 |
* En las clases: |
|
32 |
* 0-1000 |
|
33 |
* 1000-2000 |
|
34 |
* los intervalos son |
|
35 |
* [0, 1000 [ de 0-999.9p |
|
36 |
* [1000, 2000[ de 1000-1999.9p |
|
37 |
* </PRE> |
|
38 |
* |
|
39 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
40 |
* |
|
41 |
*/ |
|
42 |
public interface HistogramClass { |
|
43 |
|
|
44 |
/** |
|
45 |
* Comprueba si el valor pasado por par?metro est? dentro del intervalo |
|
46 |
* @param value Valor a comprobar |
|
47 |
* @return true si est? dentro del intervalo y false si no lo est? |
|
48 |
*/ |
|
49 |
public boolean isIn(double value); |
|
50 |
|
|
51 |
/** |
|
52 |
* Obtiene el valor m?ximo de la clase |
|
53 |
* @return Entero que representa al valor m?ximo de la clase |
|
54 |
*/ |
|
55 |
public double getMax(); |
|
56 |
|
|
57 |
/** |
|
58 |
* Asigna el valor m?ximo de la clase |
|
59 |
* @param max Entero que representa al valor m?ximo de la clase |
|
60 |
*/ |
|
61 |
public void setMax(double max); |
|
62 |
|
|
63 |
/** |
|
64 |
* Obtiene el valor m?nimo de la clase |
|
65 |
* @return Entero que representa al valor m?nimo de la clase |
|
66 |
*/ |
|
67 |
public double getMin(); |
|
68 |
|
|
69 |
/** |
|
70 |
* ASigna el valor m?nimo de la clase |
|
71 |
* @param min Entero que representa al valor m?nimo de la clase |
|
72 |
*/ |
|
73 |
public void setMin(double min); |
|
74 |
|
|
75 |
/** |
|
76 |
* Obtiene el valor de la clase |
|
77 |
* @return double con el valor |
|
78 |
*/ |
|
79 |
public double getValue(); |
|
80 |
|
|
81 |
/** |
|
82 |
* Asigna el valor de la clase |
|
83 |
* @param double con el valor |
|
84 |
*/ |
|
85 |
public void setValue(double value); |
|
86 |
|
|
87 |
/** |
|
88 |
* Incrementa en n el valor especificado |
|
89 |
* @param double n |
|
90 |
*/ |
|
91 |
public void increment(double n); |
|
92 |
} |
|
0 | 93 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/histogram/BufferHistogram.java | ||
---|---|---|
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.raster.cache.buffer.histogram; |
|
23 |
|
|
24 |
import org.gvsig.raster.cache.buffer.BufferNoData; |
|
25 |
|
|
26 |
/** |
|
27 |
* Interfaz que representa un histograma. |
|
28 |
* |
|
29 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
30 |
*/ |
|
31 |
public interface BufferHistogram { |
|
32 |
/** |
|
33 |
* Obtiene el n?mero de bandas del histograma |
|
34 |
* @return entero que representa el n?mero de bandas |
|
35 |
*/ |
|
36 |
public int getNumBands(); |
|
37 |
|
|
38 |
/** |
|
39 |
* Obtiene la longitud (n?mero de valores) de una banda determinada |
|
40 |
* @param band Banda o obtener la longitud |
|
41 |
* @return entero con la longitud de la banda |
|
42 |
* rangos de valores y DataclassList. |
|
43 |
*/ |
|
44 |
public int getBandLenght(int band); |
|
45 |
|
|
46 |
/** |
|
47 |
* Obtiene el tipo de datos del histograma original |
|
48 |
* @return |
|
49 |
*/ |
|
50 |
public int getDataType(); |
|
51 |
|
|
52 |
/** |
|
53 |
* Asigna un valor para una posici?n del histograma segun la posicion en las |
|
54 |
* clases |
|
55 |
* @param band Valor del pixel o clase a asignar |
|
56 |
* @param pos Posicion dentro de la clase. Ejemplo 0..63 |
|
57 |
* @param value Valor a asignar |
|
58 |
*/ |
|
59 |
public void setHistogramValueByPos(int band, int pos, long value); |
|
60 |
|
|
61 |
/** |
|
62 |
* Obtiene un valor del histograma segun la posicion dentro de las clases |
|
63 |
* @param band N?mero de banda del valor a recuperar |
|
64 |
* @param px Pixel o valor de la clase del valor a recuperar |
|
65 |
* @return valor |
|
66 |
*/ |
|
67 |
public double getHistogramValueByPos(int band, int pos); |
|
68 |
|
|
69 |
/** |
|
70 |
* Obtiene un valor del histograma |
|
71 |
* @param band N?mero de banda del valor a recuperar |
|
72 |
* @param px Pixel o valor de la clase del valor a recuperar |
|
73 |
* @return valor |
|
74 |
*/ |
|
75 |
public double getHistogramValue(int band, double px); |
|
76 |
|
|
77 |
/** |
|
78 |
* Realiza la uni?n entre el histograma actual y el pasado |
|
79 |
* por par?metro. |
|
80 |
* @param hist |
|
81 |
*/ |
|
82 |
public boolean union(BufferHistogram hist); |
|
83 |
|
|
84 |
/** |
|
85 |
* Obtiene la tabla de valores |
|
86 |
* @return |
|
87 |
*/ |
|
88 |
public long[][] getTable(); |
|
89 |
|
|
90 |
/** |
|
91 |
* Asigna la tabla |
|
92 |
* @param t |
|
93 |
*/ |
|
94 |
public void setTable(long[][] t); |
|
95 |
|
|
96 |
/** |
|
97 |
* Obtiene el histograma sin modificar |
|
98 |
* @return array bidimensional donde el primer elemento es el valor del pixel |
|
99 |
* o rango y el segundo el n?mero de elementos que aparecen. |
|
100 |
*/ |
|
101 |
public HistogramClass[][] getHistogram(); |
|
102 |
|
|
103 |
/** |
|
104 |
* Obtiene el histograma de la imagen negativa. |
|
105 |
* @return long[][] |
|
106 |
*/ |
|
107 |
public long[][] getNegativeTable(); |
|
108 |
|
|
109 |
/** |
|
110 |
* Devuelve el minimo valor del histograma |
|
111 |
* @return |
|
112 |
*/ |
|
113 |
public double getMin(int band); |
|
114 |
|
|
115 |
/** |
|
116 |
* Devuelve el maximo valor del histograma |
|
117 |
* @return |
|
118 |
*/ |
|
119 |
public double getMax(int band); |
|
120 |
|
|
121 |
/** |
|
122 |
* Obtiene el n?mero de valores o clases del histograma |
|
123 |
* @return entero que representa el n?mero de valores o clases del histograma |
|
124 |
*/ |
|
125 |
public int getNumValues(); |
|
126 |
|
|
127 |
/** |
|
128 |
* Devuelve si un histograma esta en un rango RGB aceptable |
|
129 |
* @return |
|
130 |
*/ |
|
131 |
public boolean isInRangeRGB(); |
|
132 |
|
|
133 |
/** |
|
134 |
* Calculo de estad?sticas a partir de un histograma. El resultado de la funci?n es un array |
|
135 |
* bidimensional donde el primer ?ndice inndica la estadistica y el segundo el n?mero de banda. |
|
136 |
* |
|
137 |
* <UL> |
|
138 |
* <LI>m?nimo</LI> |
|
139 |
* <LI>m?ximo</LI> |
|
140 |
* <LI>media</LI> |
|
141 |
* <LI>mediana</LI> |
|
142 |
* <LI>N?mero de pixels</LI> |
|
143 |
* </UL> |
|
144 |
* @param histogram |
|
145 |
* @param beginPos Posici?n de inicio del histograma para contabilizar estadisticas |
|
146 |
* @param endPos Posici?n de fin del histograma para contabilizar estadisticas |
|
147 |
* @param bandas solicitadas. Cada elemento del vector representa una banda. Si est? a true se calcula la |
|
148 |
* estadistica para esa banda y si est? a false no se calcular?. |
|
149 |
* @return |
|
150 |
*/ |
|
151 |
public double[][] getBasicStats(double beginPos2, double endPos2, boolean[] bands); |
|
152 |
|
|
153 |
/** |
|
154 |
* Calculo de estad?sticas a partir de un histograma. El resultado de la funci?n es un array |
|
155 |
* bidimensional donde el primer ?ndice inndica la estadistica y el segundo el n?mero de banda. |
|
156 |
* |
|
157 |
* <UL> |
|
158 |
* <LI>m?nimo</LI> |
|
159 |
* <LI>m?ximo</LI> |
|
160 |
* <LI>media</LI> |
|
161 |
* <LI>mediana</LI> |
|
162 |
* <LI>N?mero de pixels</LI> |
|
163 |
* </UL> |
|
164 |
* @param histogram |
|
165 |
* @param bandas solicitadas. Cada elemento del vector representa una banda. Si est? a true se calcula la |
|
166 |
* estadistica para esa banda y si est? a false no se calcular?. |
|
167 |
* @return |
|
168 |
*/ |
|
169 |
public double[][] getBasicStats(boolean[] bands); |
|
170 |
|
|
171 |
/** |
|
172 |
* Adds a new table |
|
173 |
* @param table |
|
174 |
*/ |
|
175 |
public void addTable(long[][] table); |
|
176 |
|
|
177 |
/** |
|
178 |
* Incrementa un valor de una posici?n del histograma |
|
179 |
* @param band N?mero de banda |
|
180 |
* @param px Pixel o valor de la clase |
|
181 |
*/ |
|
182 |
public void incrementPxValue(int band, double px); |
|
183 |
|
|
184 |
/** |
|
185 |
* @param noDataValue the noDataValue to set |
|
186 |
*/ |
|
187 |
public void setNoDataValue(BufferNoData noDataValue); |
|
188 |
} |
|
0 | 189 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/StatsValues.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer; |
|
2 |
|
|
3 |
/** |
|
4 |
* Interface implemented by a raster band with statistics |
|
5 |
* capabilities. |
|
6 |
* |
|
7 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
8 |
* |
|
9 |
*/ |
|
10 |
public interface StatsValues { |
|
11 |
/** |
|
12 |
* Get the maximun value |
|
13 |
* @return double |
|
14 |
*/ |
|
15 |
public double getMax(); |
|
16 |
|
|
17 |
/** |
|
18 |
* Set the maximun value |
|
19 |
* @param max |
|
20 |
*/ |
|
21 |
public void setMax(double max); |
|
22 |
|
|
23 |
/** |
|
24 |
* Get the minimun value |
|
25 |
* @return double |
|
26 |
*/ |
|
27 |
public double getMin(); |
|
28 |
|
|
29 |
/** |
|
30 |
* Set the minimun value |
|
31 |
* @param max |
|
32 |
*/ |
|
33 |
public void setMin(double min); |
|
34 |
|
|
35 |
/** |
|
36 |
* Get the second maximun value |
|
37 |
* @return double |
|
38 |
*/ |
|
39 |
public double getSecondMax(); |
|
40 |
|
|
41 |
/** |
|
42 |
* Set the second maximun value |
|
43 |
* @param max |
|
44 |
*/ |
|
45 |
public void setSecondMax(double secondMax); |
|
46 |
|
|
47 |
/** |
|
48 |
* Get the second minimun value |
|
49 |
* @return double |
|
50 |
*/ |
|
51 |
public double getSecondMin(); |
|
52 |
|
|
53 |
/** |
|
54 |
* Set the second minimun value |
|
55 |
* @param max |
|
56 |
*/ |
|
57 |
public void setSecondMin(double secondMin); |
|
58 |
|
|
59 |
/** |
|
60 |
* Get the maximun value in a eight bits band. |
|
61 |
* A value of eight bits has a range betwen -127 and 128. |
|
62 |
* The maximun is readed in a range betwen 0 and 255. |
|
63 |
* @return |
|
64 |
*/ |
|
65 |
public double getMaxRGB(); |
|
66 |
|
|
67 |
/** |
|
68 |
* Set the maximun value in a eight bits band. |
|
69 |
* A value of eight bits has a range betwen -127 and 128. |
|
70 |
* The maximun is writed in a range betwen 0 and 255. |
|
71 |
* @return |
|
72 |
*/ |
|
73 |
public void setMaxRGB(double maxRGB); |
|
74 |
|
|
75 |
/** |
|
76 |
* Get the minimun value in a eight bits band. |
|
77 |
* A value of eight bits has a range betwen -127 and 128. |
|
78 |
* The minimun is readed in a range betwen 0 and 255. |
|
79 |
* @return |
|
80 |
*/ |
|
81 |
public double getMinRGB(); |
|
82 |
|
|
83 |
/** |
|
84 |
* Set the minimun value in a eight bits band. |
|
85 |
* A value of eight bits has a range betwen -127 and 128. |
|
86 |
* The minimun is readed in a range betwen 0 and 255. |
|
87 |
* @param minRGB |
|
88 |
*/ |
|
89 |
public void setMinRGB(double minRGB); |
|
90 |
|
|
91 |
/** |
|
92 |
* Get the second maximun value in a eight bits band. |
|
93 |
* A value of eight bits has a range betwen -127 and 128. |
|
94 |
* The second maximun is readed in a range betwen 0 and 255. |
|
95 |
* @return |
|
96 |
*/ |
|
97 |
public double getSecondMaxRGB(); |
|
98 |
|
|
99 |
/** |
|
100 |
* Set the second maximun value in a eight bits band. |
|
101 |
* A value of eight bits has a range betwen -127 and 128. |
|
102 |
* The second maximun is writed in a range betwen 0 and 255. |
|
103 |
* @return |
|
104 |
*/ |
|
105 |
public void setSecondMaxRGB(double secondMaxRGB); |
|
106 |
|
|
107 |
/** |
|
108 |
* Get the second minimun value in a eight bits band. |
|
109 |
* A value of eight bits has a range betwen -127 and 128. |
|
110 |
* The second minimun is readed in a range betwen 0 and 255. |
|
111 |
* @return |
|
112 |
*/ |
|
113 |
public double getSecondMinRGB(); |
|
114 |
|
|
115 |
/** |
|
116 |
* Set the second minimun value in a eight bits band. |
|
117 |
* A value of eight bits has a range betwen -127 and 128. |
|
118 |
* The second minimun is readed in a range betwen 0 and 255. |
|
119 |
* @param minRGB |
|
120 |
*/ |
|
121 |
public void setSecondMinRGB(double secondMinRGB); |
|
122 |
|
|
123 |
/** |
|
124 |
* Get the mean value in this band |
|
125 |
* @return |
|
126 |
*/ |
|
127 |
public double getMean(); |
|
128 |
|
|
129 |
/** |
|
130 |
* Get the mean value in this band |
|
131 |
* @param mean |
|
132 |
*/ |
|
133 |
public void setMean(double mean); |
|
134 |
|
|
135 |
} |
|
0 | 136 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/package.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
4 |
<head> |
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
6 |
<title>org.gvsig.raster.cache.buffer.exception package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>Exceptions which are thrown by a wrong buffer access</p> |
|
11 |
|
|
12 |
<p> |
|
13 |
</p> |
|
14 |
|
|
15 |
</body> |
|
16 |
</html> |
|
0 | 17 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/BufferInvalidException.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.exception; |
|
2 |
|
|
3 |
/** |
|
4 |
* Excepci?n lanzada cuando se detecta que un buffer de raster es incorrecto. |
|
5 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
6 |
* |
|
7 |
*/ |
|
8 |
public class BufferInvalidException extends Exception{ |
|
9 |
private static final long serialVersionUID = -1566113755637911586L; |
|
10 |
|
|
11 |
public BufferInvalidException(String msg){ |
|
12 |
super(msg); |
|
13 |
} |
|
14 |
} |
|
0 | 15 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/BufferInvalidAccessException.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.exception; |
|
2 |
|
|
3 |
/** |
|
4 |
* Excepci?n lanzada cuando se detecta un acceso a un tipo de datos incorrecto |
|
5 |
* en un RasterBuffer. |
|
6 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
7 |
* |
|
8 |
*/ |
|
9 |
public class BufferInvalidAccessException extends Exception{ |
|
10 |
|
|
11 |
private static final long serialVersionUID = -3065331336250589153L; |
|
12 |
|
|
13 |
public BufferInvalidAccessException(String msg){ |
|
14 |
super(msg); |
|
15 |
} |
|
16 |
} |
|
0 | 17 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/ProcessInterruptedException.java | ||
---|---|---|
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.raster.cache.buffer.exception; |
|
23 |
|
|
24 |
import org.gvsig.tools.exception.BaseException; |
|
25 |
|
|
26 |
/** |
|
27 |
* Excepci?n lanzada cuando se interrumpe un proceso |
|
28 |
* |
|
29 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
30 |
*/ |
|
31 |
public class ProcessInterruptedException extends BaseException { |
|
32 |
private static final long serialVersionUID = 666908550965442025L; |
|
33 |
|
|
34 |
public ProcessInterruptedException(Throwable e){ |
|
35 |
super(e.getMessage(), e, "", 0); |
|
36 |
} |
|
37 |
|
|
38 |
public ProcessInterruptedException(String msg){ |
|
39 |
super(msg, "", 0); |
|
40 |
} |
|
41 |
} |
|
0 | 42 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/BandNotCompatibleException.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.exception; |
|
2 |
|
|
3 |
/** |
|
4 |
* This exception is throwed when a selected band is not compatible with other or |
|
5 |
* with a databuffer. |
|
6 |
* |
|
7 |
* 24/10/2008 |
|
8 |
* @author Nacho Brodin nachobrodin@gmail.com |
|
9 |
*/ |
|
10 |
public class BandNotCompatibleException extends Exception { |
|
11 |
private static final long serialVersionUID = -4312548276663417111L; |
|
12 |
|
|
13 |
public BandNotCompatibleException(String msg) { |
|
14 |
super(msg); |
|
15 |
} |
|
16 |
} |
|
0 | 17 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/OperationNotSupportedException.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.exception; |
|
2 |
|
|
3 |
/** |
|
4 |
* This exception is throwed when a selected operation is not compatible with |
|
5 |
* the buffer |
|
6 |
* |
|
7 |
* 24/10/2008 |
|
8 |
* @author Nacho Brodin nachobrodin@gmail.com |
|
9 |
*/ |
|
10 |
public class OperationNotSupportedException extends Exception { |
|
11 |
private static final long serialVersionUID = -4312548276663417111L; |
|
12 |
|
|
13 |
public OperationNotSupportedException(String message, Throwable cause) { |
|
14 |
super(message, cause); |
|
15 |
} |
|
16 |
|
|
17 |
public OperationNotSupportedException(String msg) { |
|
18 |
super(msg); |
|
19 |
} |
|
20 |
} |
|
0 | 21 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/InvalidPageNumberException.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.exception; |
|
2 |
|
|
3 |
/** |
|
4 |
* Excepci?n lanzada cuando el n?mero de p?gina al que se intenta acceder no es valido. |
|
5 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
6 |
* |
|
7 |
*/ |
|
8 |
public class InvalidPageNumberException extends Exception { |
|
9 |
private static final long serialVersionUID = -4312548276663417111L; |
|
10 |
|
|
11 |
public InvalidPageNumberException(String msg){ |
|
12 |
super(msg); |
|
13 |
} |
|
14 |
} |
|
0 | 15 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/HistogramException.java | ||
---|---|---|
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.raster.cache.buffer.exception; |
|
23 |
/** |
|
24 |
* Excepci?n lanzada por errores en el calculo de histogramas. |
|
25 |
* |
|
26 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
27 |
*/ |
|
28 |
public class HistogramException extends Exception { |
|
29 |
private static final long serialVersionUID = 666908550965442025L; |
|
30 |
|
|
31 |
public HistogramException(String msg, Throwable e) { |
|
32 |
super(msg, e); |
|
33 |
} |
|
34 |
|
|
35 |
public HistogramException(String msg){ |
|
36 |
super(msg); |
|
37 |
} |
|
38 |
} |
|
0 | 39 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.34/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/WrongParameterException.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.exception; |
|
2 |
|
|
3 |
/** |
|
4 |
* This exception is throwed when a parameter of a function is wrong. |
|
5 |
* |
|
6 |
* 24/10/2008 |
|
7 |
* @author Nacho Brodin nachobrodin@gmail.com |
|
8 |
*/ |
|
9 |
public class WrongParameterException extends Exception { |
|
10 |
private static final long serialVersionUID = -4312548276663417111L; |
|
11 |
|
Also available in: Unified diff