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 / grid / render / ImageDrawer.java @ 1315
History | View | Annotate | Download (3.51 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.grid.render; |
23 |
|
24 |
import java.awt.Image; |
25 |
|
26 |
import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
27 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
28 |
import org.gvsig.fmap.dal.coverage.store.props.Statistics; |
29 |
import org.gvsig.fmap.dal.coverage.store.props.Transparency; |
30 |
|
31 |
/**
|
32 |
* Writes data from a buffer on a Image object. At this level neither bounding box nor
|
33 |
* rotations nor world coordinates are managed.
|
34 |
*
|
35 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
36 |
*/
|
37 |
public interface ImageDrawer { |
38 |
|
39 |
/**
|
40 |
* Sets the buffer to render
|
41 |
*/
|
42 |
public void setBuffer(Buffer b); |
43 |
|
44 |
/**
|
45 |
* Assigns the buffer transparency
|
46 |
* @param t
|
47 |
*/
|
48 |
public void setLastTransparency(Transparency t); |
49 |
|
50 |
/**
|
51 |
* Sets the shift in pixels from the upper left corner. It is useful when we need supersampling to render
|
52 |
* the image. If the step is null then the supersampling is deactivated else the size of the output
|
53 |
* buffer will be width X height pixels. This size should be set with setOutPutSize method.
|
54 |
*
|
55 |
* Exists supersampling when the zoom to draw is greater than 1:1. To draw a pixel will be necessary
|
56 |
* more than one pixel in the output buffer.
|
57 |
*
|
58 |
* @param step Desplazamiento
|
59 |
*/
|
60 |
public void setSupersamplingOn(double[] step); |
61 |
|
62 |
/**
|
63 |
* Sets the size of the output buffer. This is useful to reescale the output buffer
|
64 |
* @param width Ancho
|
65 |
* @param h Alto
|
66 |
*/
|
67 |
public void setOutputSize(int width, int height); |
68 |
|
69 |
/**
|
70 |
* Releases the link to the buffer.
|
71 |
*/
|
72 |
public void dispose(); |
73 |
|
74 |
/**
|
75 |
* Adds a enhanced filter to the buffer
|
76 |
* @param stats
|
77 |
* @return
|
78 |
*/
|
79 |
public Buffer addEnhanced(Statistics stats); |
80 |
|
81 |
/**
|
82 |
* Adds a enhanced filter to the buffer
|
83 |
* @param stats
|
84 |
* @return
|
85 |
*/
|
86 |
public Buffer addEnhanced(Statistics stats, boolean tailTrim, double tailTrimValue); |
87 |
|
88 |
/**
|
89 |
* Dibuja el buffer sobre un objeto Image de java.awt y devuelve el resultado.
|
90 |
*
|
91 |
* @param replicateBand Flag de comportamiento del renderizado. Al renderizar el buffer
|
92 |
* este obtiene la primera banda del buffer y la asigna al R, la segunda al G y la tercera
|
93 |
* al B. Este flag no es tomado en cuenta en caso de que existan 3 bandas en el buffer.
|
94 |
* Si no hay tres bandas, por ejemplo una y el flag es true esta ser? replicada
|
95 |
* en R, G y B, en caso de ser false la banda ser? dibujada en su posici?n (R, G o B)
|
96 |
* y en las otras bandas se rellenar? con 0.
|
97 |
*
|
98 |
* @param transparentBand. Si es true la banda 4 es alpha y si es false no lo es.
|
99 |
*
|
100 |
* @return java.awt.Image con el buffer dibujado.
|
101 |
* @throws ProcessInterruptedException
|
102 |
*/
|
103 |
public Image drawBufferOverImageObject() throws ProcessInterruptedException; |
104 |
} |