Revision 2014
org.gvsig.raster.cache/tags/tagdate_28082013/org.gvsig.raster.cache/org.gvsig.raster.cache.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.raster.cache.tile.TileCacheLibrary |
org.gvsig.raster.cache/tags/tagdate_28082013/org.gvsig.raster.cache/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/BufferParam.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer; |
|
2 |
|
|
3 |
import java.awt.geom.Rectangle2D; |
|
4 |
|
|
5 |
import org.gvsig.raster.cache.buffer.BufferDataSource; |
|
6 |
|
|
7 |
/** |
|
8 |
* Buffer parameters. This class contains generic parameters. |
|
9 |
* Basic information to fill: x, y, w, h, datatype and bandcount. If |
|
10 |
* the buffer is RasterReadOnlyBuffer is necessary a IBufferDataSource too. |
|
11 |
* 02/11/2008 |
|
12 |
* @author Nacho Brodin nachobrodin@gmail.com |
|
13 |
*/ |
|
14 |
public interface BufferParam { |
|
15 |
/** |
|
16 |
* Get a interest area |
|
17 |
* @return Rectangle2D |
|
18 |
*/ |
|
19 |
public Rectangle2D getAreaOfInterest(); |
|
20 |
|
|
21 |
/** |
|
22 |
* Set a interest area |
|
23 |
* @param selection |
|
24 |
*/ |
|
25 |
public void setAreaOfInterest(Rectangle2D selection); |
|
26 |
|
|
27 |
/** |
|
28 |
* Get the file reference |
|
29 |
* @return |
|
30 |
*/ |
|
31 |
public String getReference(); |
|
32 |
|
|
33 |
/** |
|
34 |
* Set the file reference |
|
35 |
* @param ref |
|
36 |
*/ |
|
37 |
public void setReference(String ref); |
|
38 |
|
|
39 |
/** |
|
40 |
* Set the data source |
|
41 |
* @param dataSource |
|
42 |
*/ |
|
43 |
public void setDataSource(BufferDataSource dataSource); |
|
44 |
|
|
45 |
/** |
|
46 |
* Get the data source |
|
47 |
* @return |
|
48 |
*/ |
|
49 |
public BufferDataSource getDataSource(); |
|
50 |
|
|
51 |
/** |
|
52 |
* Returns the width in pixels |
|
53 |
* @return Width in pixels of this raster |
|
54 |
*/ |
|
55 |
public int getWidth(); |
|
56 |
|
|
57 |
/** |
|
58 |
* Sets the width in pixels |
|
59 |
* @param width |
|
60 |
* Width in pixels of this raster |
|
61 |
*/ |
|
62 |
public void setWidth(int width); |
|
63 |
|
|
64 |
/** |
|
65 |
* Returns the height in pixels |
|
66 |
* @return Height in pixels of this raster |
|
67 |
*/ |
|
68 |
public int getHeight(); |
|
69 |
|
|
70 |
/** |
|
71 |
* Sets the height in pixels |
|
72 |
* @param height |
|
73 |
* Height in pixels of this raster |
|
74 |
*/ |
|
75 |
public void setHeight(int height); |
|
76 |
|
|
77 |
/** |
|
78 |
* Returns the X upper left coordinate |
|
79 |
* @return X upper left coordinate in pixels |
|
80 |
*/ |
|
81 |
public int getX(); |
|
82 |
|
|
83 |
/** |
|
84 |
* Sets the X upper left coordinate |
|
85 |
* @params x |
|
86 |
* X upper left coordinate in pixels |
|
87 |
*/ |
|
88 |
public void setX(int x); |
|
89 |
|
|
90 |
/** |
|
91 |
* Returns the Y upper left coordinate |
|
92 |
* @return Y upper left coordinate in pixels |
|
93 |
*/ |
|
94 |
public int getY(); |
|
95 |
|
|
96 |
/** |
|
97 |
* Sets the Y upper left coordinate |
|
98 |
* @params y |
|
99 |
* Y upper left coordinate in pixels |
|
100 |
*/ |
|
101 |
public void setY(int y); |
|
102 |
|
|
103 |
/** |
|
104 |
* Gets the data type |
|
105 |
* @return |
|
106 |
*/ |
|
107 |
public int getDataType(); |
|
108 |
|
|
109 |
/** |
|
110 |
* Sets the data type |
|
111 |
* @param dataType |
|
112 |
*/ |
|
113 |
public void setDataType(int dataType); |
|
114 |
|
|
115 |
/** |
|
116 |
* Gets number of bands |
|
117 |
* @return |
|
118 |
*/ |
|
119 |
public int getBandCount(); |
|
120 |
|
|
121 |
/** |
|
122 |
* Sets number of bands |
|
123 |
* @param bandCount |
|
124 |
*/ |
|
125 |
public void setBandCount(int bandCount); |
|
126 |
|
|
127 |
/** |
|
128 |
* Adds one to the band counter |
|
129 |
*/ |
|
130 |
public void bandPlusPlus(); |
|
131 |
|
|
132 |
/** |
|
133 |
* Substracts one to the band counter |
|
134 |
*/ |
|
135 |
public void bandLessLess(); |
|
136 |
|
|
137 |
/** |
|
138 |
* Gets no data value |
|
139 |
* @return double |
|
140 |
*/ |
|
141 |
public double getNoDataValue(); |
|
142 |
|
|
143 |
/** |
|
144 |
* Sets no data value |
|
145 |
* @return double |
|
146 |
*/ |
|
147 |
public void setNoDataValue(double noDataValue); |
|
148 |
|
|
149 |
/** |
|
150 |
* Gets the size of the data type in bytes |
|
151 |
* @return Size of the data type that is used |
|
152 |
*/ |
|
153 |
public int getDataSize(); |
|
154 |
|
|
155 |
/** |
|
156 |
* Gets the buffer size |
|
157 |
* @return buffer size |
|
158 |
*/ |
|
159 |
public long sizeof(); |
|
160 |
|
|
161 |
/** |
|
162 |
* Sets the type of access defined as constant in Buffer interface |
|
163 |
*/ |
|
164 |
public void setAccessType(int accessType); |
|
165 |
|
|
166 |
/** |
|
167 |
* Gets the type of access defined as constant in Buffer interface |
|
168 |
*/ |
|
169 |
public int getAccessType(); |
|
170 |
|
|
171 |
/** |
|
172 |
* Sets the band list |
|
173 |
* @param file |
|
174 |
*/ |
|
175 |
public void setBandList(int[] bands); |
|
176 |
|
|
177 |
/** |
|
178 |
* Gets the band list |
|
179 |
* @return |
|
180 |
*/ |
|
181 |
public int[] getBandList(); |
|
182 |
} |
|
0 | 183 |
org.gvsig.raster.cache/tags/tagdate_28082013/org.gvsig.raster.cache/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/RasterBase.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer; |
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
/** |
|
6 |
* Base class for raster elements. This class contains methos for |
|
7 |
* reading width, height, number of bands and other raster parameters |
|
8 |
* |
|
9 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
10 |
*/ |
|
11 |
public abstract class RasterBase { |
|
12 |
private static final long serialVersionUID = 1L; |
|
13 |
private int dataType = Buffer.TYPE_UNDEFINED; |
|
14 |
private int bandCount = 0; |
|
15 |
private int width = 0; |
|
16 |
private int height = 0; |
|
17 |
private int x = 0; |
|
18 |
private int y = 0; |
|
19 |
public double noDataValue = -99999.0; |
|
20 |
|
|
21 |
/** |
|
22 |
* Sets size and position values |
|
23 |
* @param x |
|
24 |
* Upper left X position |
|
25 |
* @param y |
|
26 |
* Upper left X position |
|
27 |
* @param w |
|
28 |
* Width |
|
29 |
* @param h |
|
30 |
* Height |
|
31 |
*/ |
|
32 |
public RasterBase(int x, int y, int w, int h) { |
|
33 |
this.x = x; |
|
34 |
this.y = y; |
|
35 |
this.width = w; |
|
36 |
this.height = h; |
|
37 |
} |
|
38 |
|
|
39 |
/** |
|
40 |
* Sets size and position values |
|
41 |
* @param x |
|
42 |
* Upper left X position |
|
43 |
* @param y |
|
44 |
* Upper left X position |
|
45 |
* @param w |
|
46 |
* Width |
|
47 |
* @param h |
|
48 |
* Height |
|
49 |
* @param datatype |
|
50 |
* Data type of this raster |
|
51 |
* @param nBands |
|
52 |
* Number of bands of this raster |
|
53 |
*/ |
|
54 |
public RasterBase(int x, int y, int w, int h, int dataType, int nBands) { |
|
55 |
this.x = x; |
|
56 |
this.y = y; |
|
57 |
this.width = w; |
|
58 |
this.height = h; |
|
59 |
this.dataType = dataType; |
|
60 |
this.bandCount = nBands; |
|
61 |
} |
|
62 |
|
|
63 |
/** |
|
64 |
* Returns the width in pixels |
|
65 |
* @return Width in pixels of this raster |
|
66 |
*/ |
|
67 |
public int getWidth() { |
|
68 |
return width; |
|
69 |
} |
|
70 |
|
|
71 |
/** |
|
72 |
* Sets the width in pixels |
|
73 |
* @param width |
|
74 |
* Width in pixels of this raster |
|
75 |
*/ |
|
76 |
public void setWidth(int width) { |
|
77 |
this.width = width; |
|
78 |
} |
|
79 |
|
|
80 |
/** |
|
81 |
* Returns the height in pixels |
|
82 |
* @return Height in pixels of this raster |
|
83 |
*/ |
|
84 |
public int getHeight() { |
|
85 |
return height; |
|
86 |
} |
|
87 |
|
|
88 |
/** |
|
89 |
* Sets the height in pixels |
|
90 |
* @param height |
|
91 |
* Height in pixels of this raster |
|
92 |
*/ |
|
93 |
public void setHeight(int height) { |
|
94 |
this.height = height; |
|
95 |
} |
|
96 |
|
|
97 |
/** |
|
98 |
* Returns the X upper left coordinate |
|
99 |
* @return X upper left coordinate in pixels |
|
100 |
*/ |
|
101 |
public int getX() { |
|
102 |
return x; |
|
103 |
} |
|
104 |
|
|
105 |
/** |
|
106 |
* Sets the X upper left coordinate |
|
107 |
* @params x |
|
108 |
* X upper left coordinate in pixels |
|
109 |
*/ |
|
110 |
public void setX(int x) { |
|
111 |
this.x = x; |
|
112 |
} |
|
113 |
|
|
114 |
/** |
|
115 |
* Returns the Y upper left coordinate |
|
116 |
* @return Y upper left coordinate in pixels |
|
117 |
*/ |
|
118 |
public int getY() { |
|
119 |
return y; |
|
120 |
} |
|
121 |
|
|
122 |
/** |
|
123 |
* Sets the Y upper left coordinate |
|
124 |
* @params y |
|
125 |
* Y upper left coordinate in pixels |
|
126 |
*/ |
|
127 |
public void setY(int y) { |
|
128 |
this.y = y; |
|
129 |
} |
|
130 |
|
|
131 |
/** |
|
132 |
* Gets the data type |
|
133 |
* @return |
|
134 |
*/ |
|
135 |
public int getDataType() { |
|
136 |
return dataType; |
|
137 |
} |
|
138 |
|
|
139 |
/** |
|
140 |
* Sets the data type |
|
141 |
* @param dataType |
|
142 |
*/ |
|
143 |
public void setDataType(int dataType) { |
|
144 |
this.dataType = dataType; |
|
145 |
} |
|
146 |
|
|
147 |
/** |
|
148 |
* Gets number of bands |
|
149 |
* @return |
|
150 |
*/ |
|
151 |
public int getBandCount() { |
|
152 |
return bandCount; |
|
153 |
} |
|
154 |
|
|
155 |
/** |
|
156 |
* Sets number of bands |
|
157 |
* @param bandCount |
|
158 |
*/ |
|
159 |
public void setBandCount(int bandCount) { |
|
160 |
this.bandCount = bandCount; |
|
161 |
} |
|
162 |
|
|
163 |
/** |
|
164 |
* Adds one to the band counter |
|
165 |
*/ |
|
166 |
public void bandPlusPlus() { |
|
167 |
this.bandCount ++; |
|
168 |
} |
|
169 |
|
|
170 |
/** |
|
171 |
* Substracts one to the band counter |
|
172 |
*/ |
|
173 |
public void bandLessLess() { |
|
174 |
this.bandCount --; |
|
175 |
} |
|
176 |
|
|
177 |
/** |
|
178 |
* Gets no data value |
|
179 |
* @return double |
|
180 |
*/ |
|
181 |
public double getNoDataValue() { |
|
182 |
return noDataValue; |
|
183 |
} |
|
184 |
|
|
185 |
/** |
|
186 |
* Sets no data value |
|
187 |
* @return double |
|
188 |
*/ |
|
189 |
public void setNoDataValue(double noDataValue) { |
|
190 |
this.noDataValue = noDataValue; |
|
191 |
} |
|
192 |
|
|
193 |
/** |
|
194 |
* Gets the size of the data type in bytes |
|
195 |
* @return Size of the data type that is used |
|
196 |
*/ |
|
197 |
public int getDataSize() { |
|
198 |
if (getDataType() == Buffer.TYPE_BYTE) { |
|
199 |
return 1; |
|
200 |
} else if ((getDataType() == Buffer.TYPE_SHORT) | (getDataType() == Buffer.TYPE_USHORT)) { |
|
201 |
return 2; |
|
202 |
} else if (getDataType() == Buffer.TYPE_INT) { |
|
203 |
return 4; |
|
204 |
}else if (getDataType() == Buffer.TYPE_FLOAT) { |
|
205 |
return 8; |
|
206 |
}else if (getDataType() == Buffer.TYPE_DOUBLE) { |
|
207 |
return 16; |
|
208 |
} |
|
209 |
|
|
210 |
return 0; |
|
211 |
} |
|
212 |
|
|
213 |
/** |
|
214 |
* Gets the buffer size |
|
215 |
* @return buffer size |
|
216 |
*/ |
|
217 |
public long sizeof() { |
|
218 |
return (long)(getDataSize() * getWidth() * getHeight() * getBandCount()); |
|
219 |
} |
|
220 |
|
|
221 |
} |
|
0 | 222 |
org.gvsig.raster.cache/tags/tagdate_28082013/org.gvsig.raster.cache/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/BufferNoData.java | ||
---|---|---|
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.raster.cache.buffer; |
|
23 |
|
|
24 |
/** |
|
25 |
* This class represents the nodata value. |
|
26 |
* |
|
27 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
28 |
*/ |
|
29 |
public interface BufferNoData { |
|
30 |
public static byte defaultByteNoDataValue = -128; |
|
31 |
public static short defaultShortNoDataValue = -32768; |
|
32 |
public static int defaultIntegerNoDataValue = -99999; |
|
33 |
public static float defaultFloatNoDataValue = -99999F; |
|
34 |
public static double defaultDoubleNoDataValue = -99999D; |
|
35 |
|
|
36 |
/** |
|
37 |
* Gets a unique value for nodata. It doesn't take into account if the raster has |
|
38 |
* several bands. Returns the same value for all of them. |
|
39 |
* @return the noData |
|
40 |
*/ |
|
41 |
public Number getValue(); |
|
42 |
|
|
43 |
/** |
|
44 |
* Sets a unique value for nodata. It doesn't take into account if the raster has |
|
45 |
* several bands. Assigns the same value for all of them. |
|
46 |
* @param noData the noData to set |
|
47 |
*/ |
|
48 |
public void setValue(Number noData); |
|
49 |
|
|
50 |
/** |
|
51 |
* Returns true if getValue is defined and false if is null |
|
52 |
* @return |
|
53 |
*/ |
|
54 |
public boolean isDefined(); |
|
55 |
|
|
56 |
/** |
|
57 |
* Deletes the nodata value. |
|
58 |
*/ |
|
59 |
public void delete(); |
|
60 |
|
|
61 |
/** |
|
62 |
* Restores native value. The native is the original value |
|
63 |
* saved in the head of the file or its metadata. This value |
|
64 |
* has to be assign when NoData object is initialize. |
|
65 |
*/ |
|
66 |
public void restore(); |
|
67 |
|
|
68 |
/** |
|
69 |
* The native is the original value |
|
70 |
* saved in the head of the file or its metadata. This value |
|
71 |
* has to be assign when NoData object is initialize |
|
72 |
* @return the noData |
|
73 |
*/ |
|
74 |
public Number getNativeValue(); |
|
75 |
|
|
76 |
/** |
|
77 |
* The native is the original value |
|
78 |
* saved in the head of the file or its metadata. This value |
|
79 |
* has to be assign when NoData object is initialize. |
|
80 |
* @param nativeNoDataValue |
|
81 |
*/ |
|
82 |
public void setNativeValue(Number nativeNoDataValue); |
|
83 |
|
|
84 |
/** |
|
85 |
* Sets the file name |
|
86 |
* @param bandCount |
|
87 |
*/ |
|
88 |
public void setFileName(String fileName); |
|
89 |
|
|
90 |
/** |
|
91 |
* Gets the file name |
|
92 |
* @return |
|
93 |
*/ |
|
94 |
public String getFileName(); |
|
95 |
|
|
96 |
/** |
|
97 |
* Flag to renderize nodata values as transparent |
|
98 |
* @return |
|
99 |
*/ |
|
100 |
public boolean isNoDataTransparent(); |
|
101 |
|
|
102 |
/** |
|
103 |
* Flag to renderize nodata values as transparent |
|
104 |
* @param noDataAsTransparent |
|
105 |
*/ |
|
106 |
public void setNoDataTransparent(boolean noDataAsTransparent); |
|
107 |
|
|
108 |
/** |
|
109 |
* Gets the NoData data type |
|
110 |
* @return |
|
111 |
*/ |
|
112 |
public int getDataType(); |
|
113 |
|
|
114 |
/** |
|
115 |
* Sets the datatype |
|
116 |
*/ |
|
117 |
public void setDataType(int datatype); |
|
118 |
|
|
119 |
/** |
|
120 |
* Compares two NoData objects an returns true if contains the same values |
|
121 |
* @param noData |
|
122 |
* @return |
|
123 |
*/ |
|
124 |
public boolean compare(BufferNoData noData); |
|
125 |
|
|
126 |
/** |
|
127 |
* Creates and returns a copy of this object. |
|
128 |
* @return |
|
129 |
*/ |
|
130 |
public Object clone(); |
|
131 |
|
|
132 |
//*********************************************** |
|
133 |
//Only for file with more than one band |
|
134 |
|
|
135 |
/** |
|
136 |
* Gets the nodata value by band |
|
137 |
* @param nBand |
|
138 |
* @return |
|
139 |
*/ |
|
140 |
public Number getValueByBand(int nBand); |
|
141 |
|
|
142 |
/** |
|
143 |
* Gets the number of bands |
|
144 |
* @return |
|
145 |
*/ |
|
146 |
public int getBandCount(); |
|
147 |
|
|
148 |
/** |
|
149 |
* Sets the number of bands |
|
150 |
* @param bandCount |
|
151 |
*/ |
|
152 |
public void setBandCount(int bandCount); |
|
153 |
|
|
154 |
/** |
|
155 |
* Assigns one value in a band |
|
156 |
* @param noDataValue |
|
157 |
*/ |
|
158 |
public void setValueByBand(Number noDataValue, int nBand); |
|
159 |
|
|
160 |
} |
|
0 | 161 |
org.gvsig.raster.cache/tags/tagdate_28082013/org.gvsig.raster.cache/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/Band.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer; |
|
2 |
|
|
3 |
import org.gvsig.raster.cache.buffer.exception.OperationNotSupportedException; |
|
4 |
|
|
5 |
|
|
6 |
/** |
|
7 |
* Interface implemented by a raster band |
|
8 |
* |
|
9 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
10 |
* |
|
11 |
*/ |
|
12 |
public interface Band extends StatsValues { |
|
13 |
public final static int TYPE_UNDEFINED = Buffer.TYPE_UNDEFINED; |
|
14 |
public final static int TYPE_BYTE = Buffer.TYPE_BYTE; |
|
15 |
public final static int TYPE_SHORT = Buffer.TYPE_SHORT; |
|
16 |
public final static int TYPE_USHORT = Buffer.TYPE_USHORT; |
|
17 |
public final static int TYPE_INT = Buffer.TYPE_INT; |
|
18 |
public final static int TYPE_FLOAT = Buffer.TYPE_FLOAT; |
|
19 |
public final static int TYPE_DOUBLE = Buffer.TYPE_DOUBLE; |
|
20 |
public final static int TYPE_IMAGE = -1; |
|
21 |
|
|
22 |
/** |
|
23 |
* Ancho de la banda |
|
24 |
* @return Entero con el ancho de la banda |
|
25 |
*/ |
|
26 |
public int getWidth(); |
|
27 |
|
|
28 |
/** |
|
29 |
* Alto de la banda |
|
30 |
* @return Entero con el alto de la banda |
|
31 |
*/ |
|
32 |
public int getHeight(); |
|
33 |
|
|
34 |
/** |
|
35 |
* Obtiene el tipo de dato. Los tipos de dato posibles est?n definidos en IRaster. |
|
36 |
* @return tipo de datos |
|
37 |
*/ |
|
38 |
public int getDataType(); |
|
39 |
|
|
40 |
/** |
|
41 |
* Gets the height of each minimum data block. For instance, when you're using |
|
42 |
* a cache the BlockSize is the height of one piece of cache. If it is a vertical |
|
43 |
* cache the BlockSize is the width of each block. |
|
44 |
* @return size of minimum data block |
|
45 |
*/ |
|
46 |
public int getBlockSize(); |
|
47 |
|
|
48 |
/** |
|
49 |
* Gets the number of blocks |
|
50 |
* @return integer that represents the number of blocks |
|
51 |
*/ |
|
52 |
public int getNumberOfBlocks(); |
|
53 |
|
|
54 |
/** |
|
55 |
* Returns true if the block is horizontal and false if is not |
|
56 |
* @return integer that represents the number of blocks |
|
57 |
*/ |
|
58 |
public boolean isHorizontalBlock(); |
|
59 |
|
|
60 |
/** |
|
61 |
* Assigns a new band number |
|
62 |
* @param band New band number |
|
63 |
*/ |
|
64 |
public void setBandNumber(int band); |
|
65 |
|
|
66 |
/** |
|
67 |
* Gets the band number |
|
68 |
* @return band number |
|
69 |
*/ |
|
70 |
public int getBandNumber(); |
|
71 |
|
|
72 |
//*********************************************** |
|
73 |
//Getting a block of data |
|
74 |
|
|
75 |
/** |
|
76 |
* Gets a minimum block of data. The height of this data block is getBlockHeight |
|
77 |
* pixels. |
|
78 |
* @return Data buffer in memory. This is an array of two dimensions (width x heigth). |
|
79 |
*/ |
|
80 |
public byte[][] getByteBlock(int block); |
|
81 |
|
|
82 |
/** |
|
83 |
* Gets a minimum block of data. The height of this data block is getBlockHeight |
|
84 |
* pixels. |
|
85 |
* @return Data buffer in memory. This is an array of two dimensions (width x heigth). |
|
86 |
*/ |
|
87 |
public short[][] getShortBlock(int block); |
|
88 |
|
|
89 |
/** |
|
90 |
* Gets a minimum block of data. The height of this data block is getBlockHeight |
|
91 |
* pixels. |
|
92 |
* @return Data buffer in memory. This is an array of two dimensions (width x heigth). |
|
93 |
*/ |
|
94 |
public int[][] getIntBlock(int block); |
|
95 |
|
|
96 |
/** |
|
97 |
* Gets a minimum block of data. The height of this data block is getBlockHeight |
|
98 |
* pixels. |
|
99 |
* @return Data buffer in memory. This is an array of two dimensions (width x heigth). |
|
100 |
*/ |
|
101 |
public float[][] getFloatBlock(int block); |
|
102 |
|
|
103 |
/** |
|
104 |
* Gets a minimum block of data. The height of this data block is getBlockHeight |
|
105 |
* pixels. |
|
106 |
* @return Data buffer in memory. This is an array of two dimensions (width x heigth). |
|
107 |
*/ |
|
108 |
public double[][] getDoubleBlock(int block); |
|
109 |
|
|
110 |
//*********************************************** |
|
111 |
//Obtiene una linea de datos |
|
112 |
|
|
113 |
/** |
|
114 |
* Obtiene una l?nea de datos de esta banda para buffers con tipo |
|
115 |
* de dato byte. |
|
116 |
* @param line |
|
117 |
* N?mero de l?nea del buffer a recuperar |
|
118 |
* @return Array unidimensional que representa la l?nea de datos. |
|
119 |
*/ |
|
120 |
public byte[] getByteLine(int line) throws OperationNotSupportedException; |
|
121 |
|
|
122 |
/** |
|
123 |
* Obtiene una l?nea de datos de esta banda para buffers con tipo |
|
124 |
* de dato short. |
|
125 |
* @param line |
|
126 |
* N?mero de l?nea del buffer a recuperar |
|
127 |
* @return Array unidimensional que representa la l?nea de datos. |
|
128 |
*/ |
|
129 |
public short[] getShortLine(int line) throws OperationNotSupportedException; |
|
130 |
|
|
131 |
/** |
|
132 |
* Obtiene una l?nea de datos de esta banda para buffers con tipo |
|
133 |
* de dato int. |
|
134 |
* @param line |
|
135 |
* N?mero de l?nea del buffer a recuperar |
|
136 |
* @return Array unidimensional que representa la l?nea de datos. |
|
137 |
*/ |
|
138 |
public int[] getIntLine(int line) throws OperationNotSupportedException; |
|
139 |
|
|
140 |
/** |
|
141 |
* Obtiene una l?nea de datos de esta banda para buffers con tipo |
|
142 |
* de dato float. |
|
143 |
* @param line |
|
144 |
* N?mero de l?nea del buffer a recuperar |
|
145 |
* @return Array unidimensional que representa la l?nea de datos. |
|
146 |
*/ |
|
147 |
public float[] getFloatLine(int line) throws OperationNotSupportedException; |
|
148 |
|
|
149 |
/** |
|
150 |
* Obtiene una l?nea de datos de esta banda para buffers con tipo |
|
151 |
* de dato double. |
|
152 |
* @param line |
|
153 |
* N?mero de l?nea del buffer a recuperar |
|
154 |
* @return Array unidimensional que representa la l?nea de datos. |
|
155 |
*/ |
|
156 |
public double[] getDoubleLine(int line) throws OperationNotSupportedException; |
|
157 |
|
|
158 |
//*********************************************** |
|
159 |
//Obtiene un elemento de la matriz |
|
160 |
|
|
161 |
/** |
|
162 |
* Gets one element from the array if this is byte datatype |
|
163 |
* @param line |
|
164 |
* Y position |
|
165 |
* @param col |
|
166 |
* X position |
|
167 |
* @param band Number of band to read |
|
168 |
* @return Readed element |
|
169 |
*/ |
|
170 |
public byte getElemByte(int line, int col); |
|
171 |
|
|
172 |
/** |
|
173 |
* Gets one element from the array if this is short datatype |
|
174 |
* @param line |
|
175 |
* Y position |
|
176 |
* @param col |
|
177 |
* X position |
|
178 |
* @param band Number of band to read |
|
179 |
* @return Readed element |
|
180 |
*/ |
|
181 |
public short getElemShort(int line, int col); |
|
182 |
|
|
183 |
/** |
|
184 |
* Gets one element from the array if this is int datatype |
|
185 |
* @param line |
|
186 |
* Y position |
|
187 |
* @param col |
|
188 |
* X position |
|
189 |
* @param band |
|
190 |
* Number of band to read |
|
191 |
* @return Readed element |
|
192 |
*/ |
|
193 |
public int getElemInt(int line, int col); |
|
194 |
|
|
195 |
/** |
|
196 |
* Gets one element from the array if this is float datatype |
|
197 |
* @param line |
|
198 |
* Y position |
|
199 |
* @param col |
|
200 |
* X position |
|
201 |
* @param band |
|
202 |
* Number of band to read |
|
203 |
* @return Readed element |
|
204 |
*/ |
|
205 |
public float getElemFloat(int line, int col); |
|
206 |
|
|
207 |
/** |
|
208 |
* Gets one element from the array if this is double datatype |
|
209 |
* @param line |
|
210 |
* Y position |
|
211 |
* @param col |
|
212 |
* X position |
|
213 |
* @param band |
|
214 |
* Number of band to read |
|
215 |
* @return Readed element |
|
216 |
*/ |
|
217 |
public double getElemDouble(int line, int col); |
|
218 |
|
|
219 |
//*********************************************** |
|
220 |
//Asigna una linea de datos a una banda |
|
221 |
|
|
222 |
/** |
|
223 |
* Sets one line of byte data |
|
224 |
* @param data |
|
225 |
* line of data |
|
226 |
* @param line |
|
227 |
* Number of line to set |
|
228 |
* @throws OperationNotSupportedException |
|
229 |
*/ |
|
230 |
public void setByteLine(byte[] data, int line) throws OperationNotSupportedException; |
|
231 |
|
|
232 |
/** |
|
233 |
* Sets one line of short data |
|
234 |
* @param data |
|
235 |
* line of data |
|
236 |
* @param line |
|
237 |
* Number of line to set |
|
238 |
* @throws OperationNotSupportedException |
|
239 |
*/ |
|
240 |
public void setShortLine(short[] data, int line) throws OperationNotSupportedException; |
|
241 |
|
|
242 |
/** |
|
243 |
* Sets one line of int data |
|
244 |
* @param data |
|
245 |
* line of data |
|
246 |
* @param line |
|
247 |
* Number of line to set |
|
248 |
* @throws OperationNotSupportedException |
|
249 |
*/ |
|
250 |
public void setIntLine(int[] data, int line) throws OperationNotSupportedException; |
|
251 |
|
|
252 |
/** |
|
253 |
* Sets one line of float data |
|
254 |
* @param data |
|
255 |
* line of data |
|
256 |
* @param line |
|
257 |
* Number of line to set |
|
258 |
* @throws OperationNotSupportedException |
|
259 |
*/ |
|
260 |
public void setFloatLine(float[] data, int line) throws OperationNotSupportedException; |
|
261 |
|
|
262 |
/** |
|
263 |
* Sets one line of double data |
|
264 |
* @param data |
|
265 |
* line of data |
|
266 |
* @param line |
|
267 |
* Number of line to set |
|
268 |
* @throws OperationNotSupportedException |
|
269 |
*/ |
|
270 |
public void setDoubleLine(double[] data, int line) throws OperationNotSupportedException; |
|
271 |
|
|
272 |
//********************************************** |
|
273 |
//Asigna un elemento de la matriz |
|
274 |
|
|
275 |
/** |
|
276 |
* Sets one byte element |
|
277 |
* @param line |
|
278 |
* Y position |
|
279 |
* @param col |
|
280 |
* X position |
|
281 |
* @param data |
|
282 |
* data value to set |
|
283 |
* @throws OperationNotSupportedException |
|
284 |
*/ |
|
285 |
public void setElem(int line, int col, byte data) throws OperationNotSupportedException; |
|
286 |
|
|
287 |
/** |
|
288 |
* Sets one short element |
|
289 |
* @param line |
|
290 |
* Y position |
|
291 |
* @param col |
|
292 |
* X position |
|
293 |
* @param data |
|
294 |
* data value to set |
|
295 |
* @throws OperationNotSupportedException |
|
296 |
*/ |
|
297 |
public void setElem(int line, int col, short data) throws OperationNotSupportedException; |
|
298 |
|
|
299 |
/** |
|
300 |
* Sets one int element |
|
301 |
* @param line |
|
302 |
* Y position |
|
303 |
* @param col |
|
304 |
* X position |
|
305 |
* @param data |
|
306 |
* data value to set |
|
307 |
* @throws OperationNotSupportedException |
|
308 |
*/ |
|
309 |
public void setElem(int line, int col, int data) throws OperationNotSupportedException; |
|
310 |
|
|
311 |
/** |
|
312 |
* Sets one float element |
|
313 |
* @param line |
|
314 |
* Y position |
|
315 |
* @param col |
|
316 |
* X position |
|
317 |
* @param data |
|
318 |
* data value to set |
|
319 |
* @throws OperationNotSupportedException |
|
320 |
*/ |
|
321 |
public void setElem(int line, int col, float data) throws OperationNotSupportedException; |
|
322 |
|
|
323 |
/** |
|
324 |
* Sets one double element |
|
325 |
* @param line |
|
326 |
* Y position |
|
327 |
* @param col |
|
328 |
* X position |
|
329 |
* @param data |
|
330 |
* data value to set |
|
331 |
* @throws OperationNotSupportedException |
|
332 |
*/ |
|
333 |
public void setElem(int line, int col, double data) throws OperationNotSupportedException; |
|
334 |
|
|
335 |
//*********************************************** |
|
336 |
//Inicializa la banda al valor pasado por par?metro |
|
337 |
|
|
338 |
/** |
|
339 |
* Sets all elements in this band to the parameter value |
|
340 |
* @param value |
|
341 |
* Value to set |
|
342 |
* @throws OperationNotSupportedException |
|
343 |
*/ |
|
344 |
public void assign(byte value) throws OperationNotSupportedException; |
|
345 |
|
|
346 |
/** |
|
347 |
* Sets all elements in this band to the parameter value |
|
348 |
* @param value |
|
349 |
* Value to set |
|
350 |
* @throws OperationNotSupportedException |
|
351 |
*/ |
|
352 |
public void assign(short value) throws OperationNotSupportedException; |
|
353 |
|
|
354 |
/** |
|
355 |
* Sets all elements in this band to the parameter value |
|
356 |
* @param value |
|
357 |
* Value to set |
|
358 |
* @throws OperationNotSupportedException |
|
359 |
*/ |
|
360 |
public void assign(int value) throws OperationNotSupportedException; |
|
361 |
|
|
362 |
/** |
|
363 |
* Sets all elements in this band to the parameter value |
|
364 |
* @param value |
|
365 |
* Value to set |
|
366 |
* @throws OperationNotSupportedException |
|
367 |
*/ |
|
368 |
public void assign(float value) throws OperationNotSupportedException; |
|
369 |
|
|
370 |
/** |
|
371 |
* Sets all elements in this band to the parameter value |
|
372 |
* @param value |
|
373 |
* Value to set |
|
374 |
* @throws OperationNotSupportedException |
|
375 |
*/ |
|
376 |
public void assign(double value) throws OperationNotSupportedException; |
|
377 |
|
|
378 |
//*********************************************** |
|
379 |
//Getting a block of data |
|
380 |
|
|
381 |
/** |
|
382 |
* Sets a minimum byte block. The height of this data block is getBlockHeight |
|
383 |
* pixels. |
|
384 |
* @param data |
|
385 |
* Data buffer in memory. This is an array of two dimensions (width x heigth). |
|
386 |
* @param block |
|
387 |
* Number of block to assign |
|
388 |
* @throws OperationNotSupportedException |
|
389 |
*/ |
|
390 |
public void setByteBlock(byte[][] data, int block) throws OperationNotSupportedException; |
|
391 |
|
|
392 |
/** |
|
393 |
* Sets a minimum short block. The height of this data block is getBlockHeight |
|
394 |
* pixels. |
|
395 |
* @param data |
|
396 |
* Data buffer in memory. This is an array of two dimensions (width x heigth). |
|
397 |
* @param block |
|
398 |
* Number of block to assign |
|
399 |
* @throws OperationNotSupportedException |
|
400 |
*/ |
|
401 |
public void setShortBlock(short[][] data, int block) throws OperationNotSupportedException; |
|
402 |
|
|
403 |
/** |
|
404 |
* Sets a minimum int block. The height of this data block is getBlockHeight |
|
405 |
* pixels. |
|
406 |
* @param data |
|
407 |
* Data buffer in memory. This is an array of two dimensions (width x heigth). |
|
408 |
* @param block |
|
409 |
* Number of block to assign |
|
410 |
* @throws OperationNotSupportedException |
|
411 |
*/ |
|
412 |
public void setIntBlock(int[][] data, int block) throws OperationNotSupportedException; |
|
413 |
|
|
414 |
/** |
|
415 |
* Sets a minimum float block. The height of this data block is getBlockHeight |
|
416 |
* pixels. |
|
417 |
* @param data |
|
418 |
* Data buffer in memory. This is an array of two dimensions (width x heigth). |
|
419 |
* @param block |
|
420 |
* Number of block to assign |
|
421 |
* @throws OperationNotSupportedException |
|
422 |
*/ |
|
423 |
public void setFloatBlock(float[][] data, int block) throws OperationNotSupportedException; |
|
424 |
|
|
425 |
/** |
|
426 |
* Sets a minimum double block. The height of this data block is getBlockHeight |
|
427 |
* pixels. |
|
428 |
* @param data |
|
429 |
* Data buffer in memory. This is an array of two dimensions (width x heigth). |
|
430 |
* @param block |
|
431 |
* Number of block to assign |
|
432 |
* @throws OperationNotSupportedException |
|
433 |
*/ |
|
434 |
public void setDoubleBlock(double[][] data, int block) throws OperationNotSupportedException; |
|
435 |
} |
|
0 | 436 |
org.gvsig.raster.cache/tags/tagdate_28082013/org.gvsig.raster.cache/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/PxTile.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer; |
|
2 |
|
|
3 |
|
|
4 |
public abstract class PxTile extends RasterBase { |
|
5 |
/** |
|
6 |
* Set size and position values |
|
7 |
* @param x |
|
8 |
* Upper left X position |
|
9 |
* @param y |
|
10 |
* Upper left X position |
|
11 |
* @param w |
|
12 |
* Width |
|
13 |
* @param h |
|
14 |
* Height |
|
15 |
*/ |
|
16 |
public PxTile(int x, int y, int w, int h) { |
|
17 |
super(x, y, w, h); |
|
18 |
} |
|
19 |
|
|
20 |
/** |
|
21 |
* Set size, position values and a file reference |
|
22 |
* @param x |
|
23 |
* Upper left X position |
|
24 |
* @param y |
|
25 |
* Upper left X position |
|
26 |
* @param w |
|
27 |
* Width |
|
28 |
* @param h |
|
29 |
* Height |
|
30 |
* @param ref |
|
31 |
* file reference |
|
32 |
*/ |
|
33 |
public PxTile(int x, int y, int w, int h, String ref) { |
|
34 |
super(x, y, w, h); |
|
35 |
} |
|
36 |
} |
|
0 | 37 |
org.gvsig.raster.cache/tags/tagdate_28082013/org.gvsig.raster.cache/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/Buffer.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer; |
|
2 |
|
|
3 |
import java.awt.geom.Rectangle2D; |
|
4 |
import java.awt.image.DataBuffer; |
|
5 |
import java.io.IOException; |
|
6 |
import java.util.ArrayList; |
|
7 |
|
|
8 |
import org.gvsig.raster.cache.buffer.exception.BandNotCompatibleException; |
|
9 |
import org.gvsig.raster.cache.buffer.exception.OperationNotSupportedException; |
|
10 |
import org.gvsig.raster.cache.buffer.exception.ProcessInterruptedException; |
|
11 |
import org.gvsig.raster.cache.buffer.exception.WrongParameterException; |
|
12 |
import org.gvsig.raster.cache.buffer.histogram.Histogramable; |
|
13 |
|
|
14 |
/** |
|
15 |
* Interfaz que contiene las operaciones que debe soportar un buffer de datos. |
|
16 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
17 |
* |
|
18 |
*/ |
|
19 |
public interface Buffer extends Histogramable { |
|
20 |
public static boolean noDataValueEnable = false; |
|
21 |
public static double defaultNoDataValue = -99999.0; |
|
22 |
|
|
23 |
public final static int TYPE_UNDEFINED = DataBuffer.TYPE_UNDEFINED; |
|
24 |
public final static int TYPE_BYTE = DataBuffer.TYPE_BYTE; |
|
25 |
public final static int TYPE_SHORT = DataBuffer.TYPE_SHORT; |
|
26 |
public final static int TYPE_USHORT = DataBuffer.TYPE_USHORT; |
|
27 |
public final static int TYPE_INT = DataBuffer.TYPE_INT; |
|
28 |
public final static int TYPE_FLOAT = DataBuffer.TYPE_FLOAT; |
|
29 |
public final static int TYPE_DOUBLE = DataBuffer.TYPE_DOUBLE; |
|
30 |
|
|
31 |
//Read type constants |
|
32 |
public static final int READ_ONLY = 0; |
|
33 |
public static final int READ_WRITE = 1; |
|
34 |
//If the returned buffer is a cache buffer then it will have vertical stripes |
|
35 |
public static final int READ_WRITE_CVERT = 2; |
|
36 |
|
|
37 |
//************************************** |
|
38 |
//************GETTING INFO************** |
|
39 |
//************************************** |
|
40 |
|
|
41 |
/** |
|
42 |
* Ancho del raster |
|
43 |
* @return Entero con el ancho del raster |
|
44 |
*/ |
|
45 |
public int getWidth(); |
|
46 |
|
|
47 |
/** |
|
48 |
* Alto del raster |
|
49 |
* @return Entero con el alto del raster |
|
50 |
*/ |
|
51 |
public int getHeight(); |
|
52 |
|
|
53 |
/** |
|
54 |
* N?mero de bandas |
|
55 |
* @return Entero con el n?mero de bandas |
|
56 |
*/ |
|
57 |
public int getBandCount(); |
|
58 |
|
|
59 |
/** |
|
60 |
* Obtiene el tipo de dato. Los tipos de dato posibles est?n definidos en IRaster. |
|
61 |
* @return tipo de datos |
|
62 |
*/ |
|
63 |
public int getDataType(); |
|
64 |
|
|
65 |
/** |
|
66 |
* Asigna el tipo de dato. Los tipos de dato posibles est?n definidos en IRaster. |
|
67 |
* @param dataType Tipo de dato del buffer |
|
68 |
*/ |
|
69 |
public void setDataType(int dataType); |
|
70 |
|
|
71 |
/** |
|
72 |
* Get no data value |
|
73 |
* @return double |
|
74 |
*/ |
|
75 |
public BufferNoData getNoDataValue(); |
|
76 |
|
|
77 |
/** |
|
78 |
* Sets no data value |
|
79 |
* @return double |
|
80 |
*/ |
|
81 |
public void setNoDataValue(BufferNoData noDataValue); |
|
82 |
|
|
83 |
/** |
|
84 |
* Get true if current buffer is writable and false if is not. |
|
85 |
* @return true or false |
|
86 |
*/ |
|
87 |
public boolean isWritable(); |
|
88 |
|
|
89 |
/** |
|
90 |
* Obtiene true si el pixel pasado por par?metro cae dentro de los l?mites |
|
91 |
* del rater y false si cae fuera. |
|
92 |
* @param x Posici?n X del pixel a averiguar |
|
93 |
* @param y Posici?n Y del pixel a averiguar |
|
94 |
* @return true si est? dentro y false si cae fuera. |
|
95 |
*/ |
|
96 |
public boolean isInside(int x, int y); |
|
97 |
|
|
98 |
/** |
|
99 |
* Gets a bouding box of this buffer |
|
100 |
* @return |
|
101 |
*/ |
|
102 |
public Rectangle2D getDataExtent(); |
|
103 |
|
|
104 |
/** |
|
105 |
* Sets the bounding box of this buffer |
|
106 |
* @param extent |
|
107 |
*/ |
|
108 |
public void setDataExtent(Rectangle2D extent); |
|
109 |
|
|
110 |
/** |
|
111 |
* Libera el buffer de memoria |
|
112 |
* @throws IOException |
|
113 |
*/ |
|
114 |
public void free() throws IOException; |
|
115 |
|
|
116 |
/** |
|
117 |
* Sets the RasterDataStore reference |
|
118 |
* @param store |
|
119 |
*/ |
|
120 |
public void setStore(Object store); |
|
121 |
|
|
122 |
/** |
|
123 |
* Gets the RasterDataStore reference |
|
124 |
* @return |
|
125 |
*/ |
|
126 |
public Object getStore(); |
|
127 |
|
|
128 |
//************************************** |
|
129 |
//************GETTING DATA************** |
|
130 |
//************************************** |
|
131 |
|
|
132 |
//*********************************************** |
|
133 |
//Obtiene una linea de datos de todas las bandas |
|
134 |
|
|
135 |
/** |
|
136 |
* Obtiene una l?nea de datos con todas las bandas para buffers con tipo |
|
137 |
* de dato byte. |
|
138 |
* @param line N?mero de l?nea del buffer a recuperar |
|
139 |
* @return Array bidimensional conteniendo la l?nea de datos donde la primera |
|
140 |
* dimensi?n representa las bandas y la segunda la posici?n en la l?nea |
|
141 |
*/ |
|
142 |
public byte[][] getLineByte(int line) throws OperationNotSupportedException; |
|
143 |
|
|
144 |
/** |
|
145 |
* Obtiene una l?nea de datos con todas las bandas para buffers con tipo |
|
146 |
* de dato short. |
|
147 |
* @param line N?mero de l?nea del buffer a recuperar |
|
148 |
* @return Array bidimensional conteniendo la l?nea de datos donde la primera |
|
149 |
* dimensi?n representa las bandas y la segunda la posici?n en la l?nea |
|
150 |
*/ |
|
151 |
public short[][] getLineShort(int line) throws OperationNotSupportedException; |
|
152 |
|
|
153 |
/** |
|
154 |
* Obtiene una l?nea de datos con todas las bandas para buffers con tipo |
|
155 |
* de dato int. |
|
156 |
* @param line N?mero de l?nea del buffer a recuperar |
|
157 |
* @return Array bidimensional conteniendo la l?nea de datos donde la primera |
|
158 |
* dimensi?n representa las bandas y la segunda la posici?n en la l?nea |
|
159 |
*/ |
|
160 |
public int[][] getLineInt(int line) throws OperationNotSupportedException; |
|
161 |
|
|
162 |
/** |
|
163 |
* Obtiene una l?nea de datos con todas las bandas para buffers con tipo |
|
164 |
* de dato float. |
|
165 |
* @param line N?mero de l?nea del buffer a recuperar |
|
166 |
* @return Array bidimensional conteniendo la l?nea de datos donde la primera |
|
167 |
* dimensi?n representa las bandas y la segunda la posici?n en la l?nea |
|
168 |
*/ |
|
169 |
public float[][] getLineFloat(int line) throws OperationNotSupportedException; |
|
170 |
|
|
171 |
/** |
|
172 |
* Obtiene una l?nea de datos con todas las bandas para buffers con tipo |
|
173 |
* de dato double. |
|
174 |
* @param line N?mero de l?nea del buffer a recuperar |
|
175 |
* @return Array bidimensional conteniendo la l?nea de datos donde la primera |
|
176 |
* dimensi?n representa las bandas y la segunda la posici?n en la l?nea |
|
177 |
*/ |
|
178 |
public double[][] getLineDouble(int line) throws OperationNotSupportedException; |
|
179 |
|
|
180 |
//*********************************************** |
|
181 |
//Obtiene una linea de datos de una banda |
|
182 |
|
|
183 |
/** |
|
184 |
* Obtiene una l?nea de datos de la banda solicitada para buffers con tipo |
|
185 |
* de dato byte. |
|
186 |
* @param line N?mero de l?nea del buffer a recuperar |
|
187 |
* @param band N?mero de banda a recuperar |
|
188 |
* @return Array unidimensional que representa la l?nea de datos. |
|
189 |
*/ |
|
190 |
public byte[] getLineFromBandByte(int line, int band) throws OperationNotSupportedException; |
|
191 |
|
|
192 |
/** |
|
193 |
* Obtiene una l?nea de datos de la banda solicitada para buffers con tipo |
|
194 |
* de dato short. |
|
195 |
* @param line N?mero de l?nea del buffer a recuperar |
|
196 |
* @param band N?mero de banda a recuperar |
|
197 |
* @return Array unidimensional que representa la l?nea de datos. |
|
198 |
*/ |
|
199 |
public short[] getLineFromBandShort(int line, int band) throws OperationNotSupportedException; |
|
200 |
|
|
201 |
/** |
|
202 |
* Obtiene una l?nea de datos de la banda solicitada para buffers con tipo |
|
203 |
* de dato int. |
|
204 |
* @param line N?mero de l?nea del buffer a recuperar |
|
205 |
* @param band N?mero de banda a recuperar |
|
206 |
* @return Array unidimensional que representa la l?nea de datos. |
|
207 |
*/ |
|
208 |
public int[] getLineFromBandInt(int line, int band) throws OperationNotSupportedException; |
|
209 |
|
|
210 |
/** |
|
211 |
* Obtiene una l?nea de datos de la banda solicitada para buffers con tipo |
|
212 |
* de dato float. |
|
213 |
* @param line N?mero de l?nea del buffer a recuperar |
|
214 |
* @param band N?mero de banda a recuperar |
|
215 |
* @return Array unidimensional que representa la l?nea de datos. |
|
216 |
*/ |
|
217 |
public float[] getLineFromBandFloat(int line, int band) throws OperationNotSupportedException; |
|
218 |
|
|
219 |
/** |
|
220 |
* Obtiene una l?nea de datos de la banda solicitada para buffers con tipo |
|
221 |
* de dato double. |
|
222 |
* @param line N?mero de l?nea del buffer a recuperar |
|
223 |
* @param band N?mero de banda a recuperar |
|
224 |
* @return Array unidimensional que representa la l?nea de datos. |
|
225 |
*/ |
|
226 |
public double[] getLineFromBandDouble(int line, int band) throws OperationNotSupportedException; |
|
227 |
|
|
228 |
//*********************************************** |
|
229 |
//Obtiene un elemento de la matriz |
|
230 |
|
|
231 |
/** |
|
232 |
* Gets one element from the array if this is byte datatype |
|
233 |
* @param line Y position |
|
234 |
* @param col X position |
|
235 |
* @param band Number of band to read |
|
236 |
* @return Readed element |
|
237 |
*/ |
|
238 |
public byte getElemByte(int line, int col, int band); |
|
239 |
|
|
240 |
/** |
|
241 |
* Gets one element from the array if this is short datatype |
|
242 |
* @param line Y position |
|
243 |
* @param col X position |
|
244 |
* @param band Number of band to read |
|
245 |
* @return Readed element |
|
246 |
*/ |
|
247 |
public short getElemShort(int line, int col, int band); |
|
248 |
|
|
249 |
/** |
|
250 |
* Gets one element from the array if this is int datatype |
|
251 |
* @param line Y position |
|
252 |
* @param col X position |
|
253 |
* @param band Number of band to read |
|
254 |
* @return Readed element |
|
255 |
*/ |
|
256 |
public int getElemInt(int line, int col, int band); |
|
257 |
|
|
258 |
/** |
|
259 |
* Gets one element from the array if this is float datatype |
|
260 |
* @param line Y position |
|
261 |
* @param col X position |
|
262 |
* @param band Number of band to read |
|
263 |
* @return Readed element |
|
264 |
*/ |
|
265 |
public float getElemFloat(int line, int col, int band); |
|
266 |
|
|
267 |
/** |
|
268 |
* Gets one element from the array if this is double datatype |
|
269 |
* @param line Y position |
|
270 |
* @param col X position |
|
271 |
* @param band Number of band to read |
|
272 |
* @return Readed element |
|
273 |
*/ |
|
274 |
public double getElemDouble(int line, int col, int band); |
|
275 |
|
|
276 |
//*********************************************** |
|
277 |
//Copia un elemento de todas la bandas en el buffer pasado por par?metro |
|
278 |
|
|
279 |
/** |
|
280 |
* Gets one element of each band from the array if this is byte datatype |
|
281 |
* @param line Y position |
|
282 |
* @param col X position |
|
283 |
* @param data Each element of this array is a diferent band of the position line, col |
|
284 |
*/ |
|
285 |
public void getElemByte(int line, int col, byte[] data); |
|
286 |
|
|
287 |
/** |
|
288 |
* Gets one element of each band from the array if this is short datatype |
|
289 |
* @param line Y position |
|
290 |
* @param col X position |
|
291 |
* @param data Each element of this array is a diferent band of the position line, col |
|
292 |
*/ |
|
293 |
public void getElemShort(int line, int col, short[] data); |
|
294 |
|
|
295 |
/** |
|
296 |
* Gets one element of each band from the array if this is int datatype |
|
297 |
* @param line Y position |
|
298 |
* @param col X position |
|
299 |
* @param data Each element of this array is a diferent band of the position line, col |
|
300 |
*/ |
|
301 |
public void getElemInt(int line, int col, int[] data); |
|
302 |
|
|
303 |
/** |
|
304 |
* Gets one element of each band from the array if this is float datatype |
|
305 |
* @param line Y position |
|
306 |
* @param col X position |
|
307 |
* @param data Each element of this array is a diferent band of the position line, col |
|
308 |
*/ |
|
309 |
public void getElemFloat(int line, int col, float[] data); |
|
310 |
|
|
311 |
/** |
|
312 |
* Gets one element of each band from the array if this is double datatype |
|
313 |
* @param line Y position |
|
314 |
* @param col X position |
|
315 |
* @param data Each element of this array is a diferent band of the position line, col |
|
316 |
*/ |
|
317 |
public void getElemDouble(int line, int col, double[] data); |
|
318 |
|
|
319 |
//************************************** |
|
320 |
//************SETTING DATA************** |
|
321 |
//************************************** |
|
322 |
|
|
323 |
//*********************************************** |
|
324 |
//Asigna una linea de datos a una banda |
|
325 |
|
|
326 |
/** |
|
327 |
* Sets a line of byte data |
|
328 |
* @param data Array of data |
|
329 |
* @param line Y position |
|
330 |
* @param band N?mber of band |
|
331 |
* @throws OperationNotSupportedException |
|
332 |
*/ |
|
333 |
public void setLineInBandByte(byte[] data, int line, int band) throws OperationNotSupportedException; |
|
334 |
|
|
335 |
/** |
|
336 |
* Sets a line of short data |
|
337 |
* @param data Array of data |
|
338 |
* @param line Y position |
|
339 |
* @param band N?mber of band |
|
340 |
*/ |
|
341 |
public void setLineInBandShort(short[] data, int line, int band) throws OperationNotSupportedException; |
|
342 |
|
|
343 |
/** |
|
344 |
* Sets a line of int data |
|
345 |
* @param data Array of data |
|
346 |
* @param line Y position |
|
347 |
* @param band N?mber of band |
|
348 |
*/ |
|
349 |
public void setLineInBandInt(int[] data, int line, int band) throws OperationNotSupportedException; |
|
350 |
|
|
351 |
/** |
|
352 |
* Sets a line of float data |
|
353 |
* @param data Array of data |
|
354 |
* @param line Y position |
|
355 |
* @param band N?mber of band |
|
356 |
*/ |
|
357 |
public void setLineInBandFloat(float[] data, int line, int band) throws OperationNotSupportedException; |
|
358 |
|
|
359 |
/** |
|
360 |
* Sets a line of double data |
|
361 |
* @param data Array of data |
|
362 |
* @param line Y position |
|
363 |
* @param band N?mber of band |
|
364 |
*/ |
|
365 |
public void setLineInBandDouble(double[] data, int line, int band) throws OperationNotSupportedException; |
|
366 |
|
|
367 |
//*********************************************** |
|
368 |
//Asigna una linea de datos a todas las bandas |
|
369 |
|
|
370 |
public void setLineByte(byte[][] data, int line) throws OperationNotSupportedException; |
|
371 |
|
|
372 |
public void setLineShort(short[][] data, int line) throws OperationNotSupportedException; |
|
373 |
|
|
374 |
public void setLineInt(int[][] data, int line) throws OperationNotSupportedException; |
|
375 |
|
|
376 |
public void setLineFloat(float[][] data, int line) throws OperationNotSupportedException; |
|
377 |
|
|
378 |
public void setLineDouble(double[][] data, int line) throws OperationNotSupportedException; |
|
379 |
|
|
380 |
//********************************************** |
|
381 |
//Asigna un elemento de la matriz |
|
382 |
|
|
383 |
public void setElem(int line, int col, int band, byte data) throws OperationNotSupportedException; |
|
384 |
|
|
385 |
public void setElem(int line, int col, int band, short data) throws OperationNotSupportedException; |
|
386 |
|
|
387 |
public void setElem(int line, int col, int band, int data) throws OperationNotSupportedException; |
|
388 |
|
|
389 |
public void setElem(int line, int col, int band, float data) throws OperationNotSupportedException; |
|
390 |
|
|
391 |
public void setElem(int line, int col, int band, double data) throws OperationNotSupportedException; |
|
392 |
|
|
393 |
//*********************************************** |
|
394 |
//Asigna un elemento a todas la bandas en el buffer pasado por par?metro |
|
395 |
|
|
396 |
public void setElemByte(int line, int col, byte[] data) throws OperationNotSupportedException; |
|
397 |
|
|
398 |
public void setElemShort(int line, int col, short[] data) throws OperationNotSupportedException; |
Also available in: Unified diff