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