gvsig-raster / org.gvsig.raster / branches / org.gvsig.raster.2.4 / org.gvsig.raster / org.gvsig.raster.lib / org.gvsig.raster.lib.buffer / org.gvsig.raster.lib.buffer.api / src / main / java / org / gvsig / raster / lib / buffer / api / Buffer.java @ 8781
History | View | Annotate | Download (6.94 KB)
1 | 5439 | fdiaz | /* gvSIG. Desktop Geographic Information System.
|
---|---|---|---|
2 | *
|
||
3 | * Copyright ? 2007-2016 gvSIG Association
|
||
4 | *
|
||
5 | * This program is free software; you can redistribute it and/or
|
||
6 | * modify it under the terms of the GNU General Public License
|
||
7 | * as published by the Free Software Foundation; either version 2
|
||
8 | * of the License, or (at your option) any later version.
|
||
9 | *
|
||
10 | * This program is distributed in the hope that it will be useful,
|
||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
13 | * GNU General Public License for more details.
|
||
14 | *
|
||
15 | * You should have received a copy of the GNU General Public License
|
||
16 | * along with this program; if not, write to the Free Software
|
||
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
18 | * MA 02110-1301, USA.
|
||
19 | *
|
||
20 | * For any additional information, do not hesitate to contact us
|
||
21 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
22 | */
|
||
23 | package org.gvsig.raster.lib.buffer.api; |
||
24 | |||
25 | 5441 | fdiaz | |
26 | 6527 | fdiaz | import java.awt.image.BufferedImage; |
27 | |||
28 | 5439 | fdiaz | import org.cresques.cts.ICoordTrans; |
29 | 5441 | fdiaz | import org.cresques.cts.IProjection; |
30 | 5538 | fdiaz | |
31 | 6547 | fdiaz | import org.gvsig.fmap.geom.exception.CreateEnvelopeException; |
32 | 5441 | fdiaz | import org.gvsig.fmap.geom.primitive.Envelope; |
33 | import org.gvsig.fmap.geom.primitive.Point; |
||
34 | import org.gvsig.raster.lib.buffer.api.Band.BandByte; |
||
35 | import org.gvsig.raster.lib.buffer.api.Band.BandDouble; |
||
36 | import org.gvsig.raster.lib.buffer.api.Band.BandFloat; |
||
37 | import org.gvsig.raster.lib.buffer.api.Band.BandInt; |
||
38 | import org.gvsig.raster.lib.buffer.api.Band.BandShort; |
||
39 | 5453 | fdiaz | import org.gvsig.raster.lib.buffer.api.exceptions.BandException; |
40 | 5525 | llmarques | import org.gvsig.raster.lib.buffer.api.exceptions.BufferException; |
41 | 5456 | dmartinezizquierdo | import org.gvsig.raster.lib.buffer.api.statistics.StatisticsCapable; |
42 | 6493 | fdiaz | import org.gvsig.tools.dispose.Disposable; |
43 | 5527 | fdiaz | import org.gvsig.tools.locator.LocatorException; |
44 | 5538 | fdiaz | import org.gvsig.tools.observer.Observer; |
45 | 5441 | fdiaz | import org.gvsig.tools.task.SimpleTaskStatus; |
46 | 5439 | fdiaz | |
47 | /**
|
||
48 | * @author fdiaz
|
||
49 | *
|
||
50 | */
|
||
51 | 6494 | fdiaz | public interface Buffer extends StatisticsCapable, Iterable<Band>, Observer , Disposable { |
52 | 5439 | fdiaz | |
53 | 5441 | fdiaz | public final static int INTERPOLATION_Undefined = 0; |
54 | public final static int INTERPOLATION_NearestNeighbour = 1; |
||
55 | public final static int INTERPOLATION_Bilinear = 2; |
||
56 | public final static int INTERPOLATION_InverseDistance = 3; |
||
57 | public final static int INTERPOLATION_BicubicSpline = 4; |
||
58 | public final static int INTERPOLATION_BSpline = 5; |
||
59 | 5439 | fdiaz | |
60 | 8425 | fdiaz | // /**
|
61 | // * Adds a filter list to buffer
|
||
62 | // *
|
||
63 | // * @param filterList
|
||
64 | // */
|
||
65 | // public void filter(FilterList filterList);
|
||
66 | 5439 | fdiaz | |
67 | /**
|
||
68 | 5441 | fdiaz | * @return Number of buffer bands
|
69 | 5439 | fdiaz | */
|
70 | 5441 | fdiaz | public int getBandCount(); |
71 | 5439 | fdiaz | |
72 | /**
|
||
73 | 5441 | fdiaz | * @return Bands of buffer
|
74 | 5439 | fdiaz | */
|
75 | 5441 | fdiaz | public Band[] getBands(); |
76 | 5439 | fdiaz | |
77 | 6701 | fdiaz | public BandInfo[] getBandsInfo(); |
78 | |||
79 | 5441 | fdiaz | /**
|
80 | 5446 | fdiaz | * @return the number of columns
|
81 | 5441 | fdiaz | */
|
82 | 5446 | fdiaz | public int getColumns(); |
83 | 5439 | fdiaz | |
84 | 5441 | fdiaz | /**
|
85 | 5446 | fdiaz | * @return the number of rows
|
86 | 5441 | fdiaz | */
|
87 | 5446 | fdiaz | public int getRows(); |
88 | 5439 | fdiaz | |
89 | 5441 | fdiaz | /**
|
90 | * @return Envelope of this buffer
|
||
91 | 6547 | fdiaz | * @throws CreateEnvelopeException
|
92 | * @throws LocatorException
|
||
93 | 5441 | fdiaz | */
|
94 | 6547 | fdiaz | public Envelope getEnvelope() throws LocatorException, CreateEnvelopeException; |
95 | 5439 | fdiaz | |
96 | 5441 | fdiaz | /**
|
97 | * @return Projection of buffer
|
||
98 | */
|
||
99 | public IProjection getProjection();
|
||
100 | 5439 | fdiaz | |
101 | 5441 | fdiaz | /**
|
102 | 5446 | fdiaz | * Returns true if passed as parameter cell is inside of the buffer, else returns false.
|
103 | *
|
||
104 | 5448 | dmartinezizquierdo | * @param cellX Cell's x position
|
105 | * @param cellY Cell's y position
|
||
106 | * @return true if cell is inside, false if it is outside
|
||
107 | 5441 | fdiaz | */
|
108 | public boolean isInside(int cellX, int cellY); |
||
109 | 5439 | fdiaz | |
110 | 5441 | fdiaz | /**
|
111 | 5446 | fdiaz | * Returns true if passed as parameter point is inside of the buffer, else returns false.
|
112 | *
|
||
113 | 5441 | fdiaz | * @param point
|
114 | 5446 | fdiaz | * @return true if point is inside of this
|
115 | 5441 | fdiaz | */
|
116 | public boolean isInside(Point point); |
||
117 | 5439 | fdiaz | |
118 | |||
119 | 5441 | fdiaz | /**
|
120 | 5446 | fdiaz | * Adds a band
|
121 | *
|
||
122 | 5441 | fdiaz | * @param band
|
123 | */
|
||
124 | public void addBand(Band band); |
||
125 | 5439 | fdiaz | |
126 | 5441 | fdiaz | /**
|
127 | 5446 | fdiaz | * Sets a band in the "pos" position
|
128 | *
|
||
129 | 5441 | fdiaz | * @param pos
|
130 | * @param band
|
||
131 | 5453 | fdiaz | * @throws BandException
|
132 | 5441 | fdiaz | */
|
133 | 5453 | fdiaz | public void setBand(int pos, Band band) throws BandException; |
134 | 5441 | fdiaz | |
135 | /**
|
||
136 | 5446 | fdiaz | * Removes the band in the "pos" position
|
137 | *
|
||
138 | 5441 | fdiaz | * @param pos
|
139 | */
|
||
140 | public void removeBand(int pos); |
||
141 | |||
142 | /**
|
||
143 | 5446 | fdiaz | * Gets the band in the "pos" position
|
144 | *
|
||
145 | 5441 | fdiaz | * @param pos
|
146 | 5446 | fdiaz | * @return return the band in the "pos" position
|
147 | 5441 | fdiaz | */
|
148 | public Band getBand(int pos); |
||
149 | |||
150 | /**
|
||
151 | 5446 | fdiaz | *
|
152 | 5441 | fdiaz | * @param pos
|
153 | 5446 | fdiaz | * @return return the band in the "pos" position if the band is of type byte
|
154 | 5441 | fdiaz | */
|
155 | public BandByte getBandByte(int pos); |
||
156 | |||
157 | /**
|
||
158 | * @param pos
|
||
159 | 5446 | fdiaz | * @return return the band in the "pos" position if the band is of type short
|
160 | 5441 | fdiaz | */
|
161 | public BandShort getBandShort(int pos); |
||
162 | |||
163 | /**
|
||
164 | * @param pos
|
||
165 | 5446 | fdiaz | * @return return the band in the"pos" position if the band is of type int
|
166 | 5441 | fdiaz | */
|
167 | public BandInt getBandInt(int pos); |
||
168 | |||
169 | /**
|
||
170 | * @param pos
|
||
171 | 5446 | fdiaz | * @return return the band in the "pos" position if the band is of type float
|
172 | 5441 | fdiaz | */
|
173 | public BandFloat getBandFloat(int pos); |
||
174 | |||
175 | /**
|
||
176 | * @param pos
|
||
177 | 5446 | fdiaz | * @return return the band in the "pos" position if the band is of type double
|
178 | 5441 | fdiaz | */
|
179 | public BandDouble getBandDouble(int pos); |
||
180 | |||
181 | /**
|
||
182 | 5446 | fdiaz | * Switches the bands as indicated by the parameter
|
183 | *
|
||
184 | 5441 | fdiaz | * @param positions
|
185 | */
|
||
186 | public void switchBands(int[] positions); |
||
187 | |||
188 | /**
|
||
189 | 5446 | fdiaz | * Switches two bands
|
190 | *
|
||
191 | 5441 | fdiaz | * @param pos1
|
192 | * @param pos2
|
||
193 | */
|
||
194 | public void switchBands(int pos1, int pos2); |
||
195 | |||
196 | /**
|
||
197 | 5446 | fdiaz | * Creates a interpolated buffer
|
198 | *
|
||
199 | * @param rows
|
||
200 | * @param columns
|
||
201 | 5441 | fdiaz | * @param interpolationMode
|
202 | * @param status
|
||
203 | 5446 | fdiaz | * @return a interpolated Buffer according the interpolation mode
|
204 | 5527 | fdiaz | * @throws BufferException
|
205 | * @throws LocatorException
|
||
206 | 5441 | fdiaz | */
|
207 | 5527 | fdiaz | public Buffer createInterpolated(int rows, int columns, int interpolationMode, SimpleTaskStatus status) throws LocatorException, BufferException; |
208 | 5441 | fdiaz | |
209 | /**
|
||
210 | * Converts buffer using specified coordinate transformation
|
||
211 | *
|
||
212 | * @param ct
|
||
213 | * Coordinate transformation to convert buffer
|
||
214 | * @param status
|
||
215 | * @return New converted buffer.
|
||
216 | 5525 | llmarques | * @throws BufferException If there are problems converting buffer
|
217 | 5441 | fdiaz | */
|
218 | 5525 | llmarques | public Buffer convert(ICoordTrans ct, SimpleTaskStatus status) throws BufferException; |
219 | 5538 | fdiaz | |
220 | 5529 | llmarques | /**
|
221 | * @return Gets band types of buffer bands
|
||
222 | */
|
||
223 | public int[] getBandTypes(); |
||
224 | 5538 | fdiaz | |
225 | 5529 | llmarques | /**
|
226 | * @return Gets NoData object from buffer bands
|
||
227 | */
|
||
228 | public NoData[] getBandNoData(); |
||
229 | 5441 | fdiaz | |
230 | 5540 | fdiaz | /**
|
231 | * @param envelope
|
||
232 | * @return A clip of buffer
|
||
233 | 5541 | fdiaz | * @throws BufferException
|
234 | 5540 | fdiaz | */
|
235 | 5541 | fdiaz | public Buffer clip(Envelope envelope) throws BufferException; |
236 | 5540 | fdiaz | |
237 | 5541 | fdiaz | /**
|
238 | 5640 | llmarques | * @return Returns X pixel of this buffer.
|
239 | 6677 | fdiaz | * @deprecated use getDimensions().getPixelSizeX()
|
240 | 5541 | fdiaz | */
|
241 | public double getPixelSizeX(); |
||
242 | |||
243 | /**
|
||
244 | 5640 | llmarques | * @return Returns Y pixel of this buffer.
|
245 | 6677 | fdiaz | * @deprecated use getDimensions().getPixelSizeY()
|
246 | 5541 | fdiaz | */
|
247 | public double getPixelSizeY(); |
||
248 | |||
249 | 6527 | fdiaz | /**
|
250 | * @return
|
||
251 | */
|
||
252 | BufferedImage getBufferedImage();
|
||
253 | 5541 | fdiaz | |
254 | 6677 | fdiaz | /**
|
255 | * @return
|
||
256 | */
|
||
257 | public BufferDimensions getDimensions();
|
||
258 | 6527 | fdiaz | |
259 | 6677 | fdiaz | |
260 | 5439 | fdiaz | } |