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 @ 6494
History | View | Annotate | Download (6.42 KB)
1 |
/* 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 |
|
26 |
import org.cresques.cts.ICoordTrans; |
27 |
import org.cresques.cts.IProjection; |
28 |
|
29 |
import org.gvsig.fmap.geom.primitive.Envelope; |
30 |
import org.gvsig.fmap.geom.primitive.Point; |
31 |
import org.gvsig.raster.lib.buffer.api.Band.BandByte; |
32 |
import org.gvsig.raster.lib.buffer.api.Band.BandDouble; |
33 |
import org.gvsig.raster.lib.buffer.api.Band.BandFloat; |
34 |
import org.gvsig.raster.lib.buffer.api.Band.BandInt; |
35 |
import org.gvsig.raster.lib.buffer.api.Band.BandShort; |
36 |
import org.gvsig.raster.lib.buffer.api.exceptions.BandException; |
37 |
import org.gvsig.raster.lib.buffer.api.exceptions.BufferException; |
38 |
import org.gvsig.raster.lib.buffer.api.statistics.StatisticsCapable; |
39 |
import org.gvsig.tools.dispose.Disposable; |
40 |
import org.gvsig.tools.locator.LocatorException; |
41 |
import org.gvsig.tools.observer.Observer; |
42 |
import org.gvsig.tools.task.SimpleTaskStatus; |
43 |
|
44 |
/**
|
45 |
* @author fdiaz
|
46 |
*
|
47 |
*/
|
48 |
public interface Buffer extends StatisticsCapable, Iterable<Band>, Observer , Disposable { |
49 |
|
50 |
public final static int INTERPOLATION_Undefined = 0; |
51 |
public final static int INTERPOLATION_NearestNeighbour = 1; |
52 |
public final static int INTERPOLATION_Bilinear = 2; |
53 |
public final static int INTERPOLATION_InverseDistance = 3; |
54 |
public final static int INTERPOLATION_BicubicSpline = 4; |
55 |
public final static int INTERPOLATION_BSpline = 5; |
56 |
|
57 |
/**
|
58 |
* Adds a filter list to buffer
|
59 |
*
|
60 |
* @param filterList
|
61 |
*/
|
62 |
public void filter(FilterList filterList); |
63 |
|
64 |
/**
|
65 |
* @return Number of buffer bands
|
66 |
*/
|
67 |
public int getBandCount(); |
68 |
|
69 |
/**
|
70 |
* @return Bands of buffer
|
71 |
*/
|
72 |
public Band[] getBands(); |
73 |
|
74 |
/**
|
75 |
* @return the number of columns
|
76 |
*/
|
77 |
public int getColumns(); |
78 |
|
79 |
/**
|
80 |
* @return the number of rows
|
81 |
*/
|
82 |
public int getRows(); |
83 |
|
84 |
/**
|
85 |
* @return Envelope of this buffer
|
86 |
*/
|
87 |
public Envelope getEnvelope();
|
88 |
|
89 |
/**
|
90 |
* @return Projection of buffer
|
91 |
*/
|
92 |
public IProjection getProjection();
|
93 |
|
94 |
/**
|
95 |
* Returns true if passed as parameter cell is inside of the buffer, else returns false.
|
96 |
*
|
97 |
* @param cellX Cell's x position
|
98 |
* @param cellY Cell's y position
|
99 |
* @return true if cell is inside, false if it is outside
|
100 |
*/
|
101 |
public boolean isInside(int cellX, int cellY); |
102 |
|
103 |
/**
|
104 |
* Returns true if passed as parameter point is inside of the buffer, else returns false.
|
105 |
*
|
106 |
* @param point
|
107 |
* @return true if point is inside of this
|
108 |
*/
|
109 |
public boolean isInside(Point point); |
110 |
|
111 |
|
112 |
/**
|
113 |
* Adds a band
|
114 |
*
|
115 |
* @param band
|
116 |
*/
|
117 |
public void addBand(Band band); |
118 |
|
119 |
/**
|
120 |
* Sets a band in the "pos" position
|
121 |
*
|
122 |
* @param pos
|
123 |
* @param band
|
124 |
* @throws BandException
|
125 |
*/
|
126 |
public void setBand(int pos, Band band) throws BandException; |
127 |
|
128 |
/**
|
129 |
* Removes the band in the "pos" position
|
130 |
*
|
131 |
* @param pos
|
132 |
*/
|
133 |
public void removeBand(int pos); |
134 |
|
135 |
/**
|
136 |
* Gets the band in the "pos" position
|
137 |
*
|
138 |
* @param pos
|
139 |
* @return return the band in the "pos" position
|
140 |
*/
|
141 |
public Band getBand(int pos); |
142 |
|
143 |
/**
|
144 |
*
|
145 |
* @param pos
|
146 |
* @return return the band in the "pos" position if the band is of type byte
|
147 |
*/
|
148 |
public BandByte getBandByte(int pos); |
149 |
|
150 |
/**
|
151 |
* @param pos
|
152 |
* @return return the band in the "pos" position if the band is of type short
|
153 |
*/
|
154 |
public BandShort getBandShort(int pos); |
155 |
|
156 |
/**
|
157 |
* @param pos
|
158 |
* @return return the band in the"pos" position if the band is of type int
|
159 |
*/
|
160 |
public BandInt getBandInt(int pos); |
161 |
|
162 |
/**
|
163 |
* @param pos
|
164 |
* @return return the band in the "pos" position if the band is of type float
|
165 |
*/
|
166 |
public BandFloat getBandFloat(int pos); |
167 |
|
168 |
/**
|
169 |
* @param pos
|
170 |
* @return return the band in the "pos" position if the band is of type double
|
171 |
*/
|
172 |
public BandDouble getBandDouble(int pos); |
173 |
|
174 |
/**
|
175 |
* Switches the bands as indicated by the parameter
|
176 |
*
|
177 |
* @param positions
|
178 |
*/
|
179 |
public void switchBands(int[] positions); |
180 |
|
181 |
/**
|
182 |
* Switches two bands
|
183 |
*
|
184 |
* @param pos1
|
185 |
* @param pos2
|
186 |
*/
|
187 |
public void switchBands(int pos1, int pos2); |
188 |
|
189 |
/**
|
190 |
* Creates a interpolated buffer
|
191 |
*
|
192 |
* @param rows
|
193 |
* @param columns
|
194 |
* @param interpolationMode
|
195 |
* @param status
|
196 |
* @return a interpolated Buffer according the interpolation mode
|
197 |
* @throws BufferException
|
198 |
* @throws LocatorException
|
199 |
*/
|
200 |
public Buffer createInterpolated(int rows, int columns, int interpolationMode, SimpleTaskStatus status) throws LocatorException, BufferException; |
201 |
|
202 |
/**
|
203 |
* Converts buffer using specified coordinate transformation
|
204 |
*
|
205 |
* @param ct
|
206 |
* Coordinate transformation to convert buffer
|
207 |
* @param status
|
208 |
* @return New converted buffer.
|
209 |
* @throws BufferException If there are problems converting buffer
|
210 |
*/
|
211 |
public Buffer convert(ICoordTrans ct, SimpleTaskStatus status) throws BufferException; |
212 |
|
213 |
/**
|
214 |
* @return Gets band types of buffer bands
|
215 |
*/
|
216 |
public int[] getBandTypes(); |
217 |
|
218 |
/**
|
219 |
* @return Gets NoData object from buffer bands
|
220 |
*/
|
221 |
public NoData[] getBandNoData(); |
222 |
|
223 |
/**
|
224 |
* @param envelope
|
225 |
* @return A clip of buffer
|
226 |
* @throws BufferException
|
227 |
*/
|
228 |
public Buffer clip(Envelope envelope) throws BufferException; |
229 |
|
230 |
/**
|
231 |
* @return Returns X pixel of this buffer.
|
232 |
*/
|
233 |
public double getPixelSizeX(); |
234 |
|
235 |
/**
|
236 |
* @return Returns Y pixel of this buffer.
|
237 |
*/
|
238 |
public double getPixelSizeY(); |
239 |
|
240 |
|
241 |
} |