Statistics
| Revision:

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 @ 5453

History | View | Annotate | Download (5.5 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.tools.task.SimpleTaskStatus;
38

    
39
/**
40
 * @author fdiaz
41
 *
42
 */
43
public interface Buffer extends HistogramCapable, StatisticsCapable, Iterable<Band> {
44

    
45
    public final static int INTERPOLATION_Undefined        = 0;
46
    public final static int INTERPOLATION_NearestNeighbour = 1;
47
    public final static int INTERPOLATION_Bilinear         = 2;
48
    public final static int INTERPOLATION_InverseDistance  = 3;
49
    public final static int INTERPOLATION_BicubicSpline    = 4;
50
    public final static int INTERPOLATION_BSpline          = 5;
51

    
52
    /**
53
     * Adds a filter list to buffer
54
     *
55
     * @param filterList
56
     */
57
    public void filter(FilterList filterList);
58

    
59
    /**
60
     * @return Number of buffer bands
61
     */
62
    public int getBandCount();
63

    
64
    /**
65
     * @return Bands of buffer
66
     */
67
    public Band[] getBands();
68

    
69
    /**
70
     * @return the number of columns
71
     */
72
    public int getColumns();
73

    
74
    /**
75
     * @return the number of rows
76
     */
77
    public int getRows();
78

    
79
    /**
80
     * @return Envelope of this buffer
81
     */
82
    public Envelope getEnvelope();
83

    
84
    /**
85
     * @return Projection of buffer
86
     */
87
    public IProjection getProjection();
88

    
89
    /**
90
     * Returns true if passed as parameter cell is inside of the buffer, else returns false.
91
     *
92
     * @param cellX Cell's x position
93
     * @param cellY Cell's y position
94
     * @return true if cell is inside, false if it is outside
95
     */
96
    public boolean isInside(int cellX, int cellY);
97

    
98
    /**
99
     * Returns true if passed as parameter point is inside of the buffer, else returns false.
100
     *
101
     * @param point
102
     * @return true if point is inside of this
103
     */
104
    public boolean isInside(Point point);
105

    
106

    
107
    /**
108
     * Adds a band
109
     *
110
     * @param band
111
     */
112
    public void addBand(Band band);
113

    
114
    /**
115
     * Sets a band in the "pos" position
116
     *
117
     * @param pos
118
     * @param band
119
     * @throws BandException
120
     */
121
    public void setBand(int pos, Band band) throws BandException;
122

    
123
    /**
124
     * Removes the band in the "pos" position
125
     *
126
     * @param pos
127
     */
128
    public void removeBand(int pos);
129

    
130
    /**
131
     * Gets the band in the "pos" position
132
     *
133
     * @param pos
134
     * @return return the band in the "pos" position
135
     */
136
    public Band getBand(int pos);
137

    
138
    /**
139
     *
140
     * @param pos
141
     * @return return the band in the "pos" position if the band is of type byte
142
     */
143
    public BandByte getBandByte(int pos);
144

    
145
    /**
146
     * @param pos
147
     * @return return the band in the "pos" position if the band is of type short
148
     */
149
    public BandShort getBandShort(int pos);
150

    
151
    /**
152
     * @param pos
153
     * @return return the band in the"pos" position if the band is of type int
154
     */
155
    public BandInt getBandInt(int pos);
156

    
157
    /**
158
     * @param pos
159
     * @return return the band in the "pos" position if the band is of type float
160
     */
161
    public BandFloat getBandFloat(int pos);
162

    
163
    /**
164
     * @param pos
165
     * @return return the band in the "pos" position if the band is of type double
166
     */
167
    public BandDouble getBandDouble(int pos);
168

    
169
    /**
170
     * Switches the bands as indicated by the parameter
171
     *
172
     * @param positions
173
     */
174
    public void switchBands(int[] positions);
175

    
176
    /**
177
     * Switches two bands
178
     *
179
     * @param pos1
180
     * @param pos2
181
     */
182
    public void switchBands(int pos1, int pos2);
183

    
184
    /**
185
     * Creates a interpolated buffer
186
     *
187
     * @param rows
188
     * @param columns
189
     * @param interpolationMode
190
     * @param status
191
     * @return a interpolated Buffer according the interpolation mode
192
     */
193
    public Buffer createInterpolated(int rows, int columns, int interpolationMode, SimpleTaskStatus status);
194

    
195
    /**
196
     * Converts buffer using specified coordinate transformation
197
     *
198
     * @param ct
199
     *            Coordinate transformation to convert buffer
200
     * @param status
201
     * @return New converted buffer.
202
     */
203
    public Buffer convert(ICoordTrans ct, SimpleTaskStatus status);
204

    
205
    /**
206
     *
207
     * @return true if is paginated
208
     */
209
    public boolean isPaginated();
210

    
211
}