gvsig-raster / org.gvsig.raster / branches / org.gvsig.raster_dataaccess_refactoring / org.gvsig.raster.lib / org.gvsig.raster.lib.impl / src / main / java / org / gvsig / raster / impl / buffer / DefaultRasterQuery.java @ 2424
History | View | Annotate | Download (29.6 KB)
1 | 27 | nbrodin | package org.gvsig.raster.impl.buffer; |
---|---|---|---|
2 | |||
3 | 2231 | nbrodin | import java.awt.Rectangle; |
4 | 2232 | nbrodin | import java.awt.geom.AffineTransform; |
5 | import java.awt.geom.Point2D; |
||
6 | 2231 | nbrodin | |
7 | 2232 | nbrodin | import org.gvsig.fmap.dal.coverage.RasterLocator; |
8 | 1047 | nbrodin | import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
9 | import org.gvsig.fmap.dal.coverage.datastruct.BandList; |
||
10 | 642 | nbrodin | import org.gvsig.fmap.dal.coverage.datastruct.Extent; |
11 | 859 | nbrodin | import org.gvsig.fmap.dal.coverage.datastruct.NoData; |
12 | 2234 | nbrodin | import org.gvsig.fmap.dal.coverage.exception.FileNotExistsException; |
13 | import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException; |
||
14 | import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException; |
||
15 | 2232 | nbrodin | import org.gvsig.fmap.dal.coverage.exception.QueryException; |
16 | import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
||
17 | 55 | nbrodin | import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
18 | 2232 | nbrodin | import org.gvsig.fmap.dal.coverage.util.RasterUtils; |
19 | 880 | nbrodin | import org.gvsig.raster.cache.tile.TileCacheLibrary; |
20 | 642 | nbrodin | import org.gvsig.raster.cache.tile.provider.CacheStruct; |
21 | 296 | nbrodin | import org.gvsig.raster.cache.tile.provider.TileListener; |
22 | 2234 | nbrodin | import org.gvsig.raster.impl.DefaultRasterManager; |
23 | import org.gvsig.raster.impl.buffer.cache.RasterReadOnlyBuffer; |
||
24 | 2232 | nbrodin | import org.gvsig.raster.impl.datastruct.ExtentImpl; |
25 | 2234 | nbrodin | import org.gvsig.raster.impl.store.QueryableRaster; |
26 | 621 | nbrodin | import org.gvsig.timesupport.Time; |
27 | 88 | nbrodin | import org.gvsig.tools.persistence.PersistentState; |
28 | import org.gvsig.tools.persistence.exception.PersistenceException; |
||
29 | 1040 | nbrodin | import org.gvsig.tools.task.TaskStatus; |
30 | 27 | nbrodin | |
31 | /**
|
||
32 | * Default implementation for RasterQuery
|
||
33 | *
|
||
34 | * @author Nacho Brodin (nachobrodin@gmail.com)
|
||
35 | */
|
||
36 | 2232 | nbrodin | public class DefaultRasterQuery implements RasterQuery, SpiRasterQuery { |
37 | 2236 | nbrodin | public static final int TYPE_UNDEFINED = -1; |
38 | 27 | nbrodin | public static final int TYPE_ENTIRE = 0; |
39 | 2231 | nbrodin | public static final int TYPE_WCOORDS = 1; |
40 | 2232 | nbrodin | public static final int TYPE_WCOORDS_RESCALED = 2; |
41 | public static final int TYPE_WCOORDS_SHIFT = 3; |
||
42 | public static final int TYPE_PX = 4; |
||
43 | public static final int TYPE_PX_RESCALED = 5; |
||
44 | public static final int TYPE_PX_SHIFT = 6; |
||
45 | public static final int TYPE_PX_RESCALED_SHIFT = 7; |
||
46 | public static final int TYPE_TILED = 8; |
||
47 | public static final int TYPE_ONE_TILE = 9; |
||
48 | |||
49 | 2241 | nbrodin | private int type = TYPE_ENTIRE; |
50 | 2232 | nbrodin | /*
|
51 | * Request in pixels
|
||
52 | */
|
||
53 | private Rectangle pixelWindow = null; |
||
54 | /*
|
||
55 | * Request in pixels adjusted to the source. The provider will use this parameter. If the type is with
|
||
56 | * shift then adjustedPixelWindow will be the same to the pixelWindow
|
||
57 | */
|
||
58 | private Rectangle adjustedPixelWindow = null; |
||
59 | /*
|
||
60 | * Request in world coordinates
|
||
61 | */
|
||
62 | private Extent requestBoundingBox = null; |
||
63 | /*
|
||
64 | * Request in world coordinates adjusted to the source. The provider will use this parameter. If the type is with
|
||
65 | * shift then adjustedBoundingBox will be the same to the requestBoundingBox
|
||
66 | */
|
||
67 | private Extent adjustedBoundingBox = null; |
||
68 | 2234 | nbrodin | |
69 | 2236 | nbrodin | private int widthForResampling = -1; |
70 | private int heightForResampling = -1; |
||
71 | 2232 | nbrodin | /*
|
72 | * If the request is adjusted to the input source this width is the same to widthForResampling else
|
||
73 | * the provider has to receive the right buffer size for the request, so this adjustedWidth will
|
||
74 | * contain a smaller buffer without frames.
|
||
75 | */
|
||
76 | private int adjustedBufferWidth = 0; |
||
77 | /*
|
||
78 | * If the request is adjusted to the input source this height is the same to heightForResampling else
|
||
79 | * the provider has to receive the right buffer size for the request, so this adjustedHeight will
|
||
80 | * contain a smaller buffer without frames.
|
||
81 | */
|
||
82 | private int adjustedBufferHeight = 0; |
||
83 | 2234 | nbrodin | |
84 | private double[] step = null; |
||
85 | |||
86 | 2231 | nbrodin | private int tileRow = 0; |
87 | private int tileCol = 0; |
||
88 | private int resolutionLevel = -1; |
||
89 | 2232 | nbrodin | private boolean adjustToSrcExtent = true; |
90 | 2234 | nbrodin | |
91 | 27 | nbrodin | private int[] drawableBands = new int[]{0}; |
92 | private boolean readOnly = false; |
||
93 | 28 | nbrodin | private boolean memoryBuffer = false; |
94 | private boolean storeLastBuffer = false; |
||
95 | 621 | nbrodin | private Time time = null; |
96 | 2234 | nbrodin | |
97 | 2236 | nbrodin | |
98 | private boolean supersamplingLoadingBuffer = false; |
||
99 | 27 | nbrodin | /**
|
100 | * Valor NoData con el que se rellenan las celdas cuando adjustToExtent es false
|
||
101 | */
|
||
102 | 859 | nbrodin | private NoData noDataValueToFill = null; |
103 | 2234 | nbrodin | |
104 | 210 | nbrodin | private TileListener listener = null; |
105 | 642 | nbrodin | private int alphaBandNumber = -1; |
106 | 2303 | nbrodin | private boolean dontBuildBuffer = false; |
107 | 642 | nbrodin | private CacheStruct cacheStruct = null; |
108 | 1040 | nbrodin | private TaskStatus taskStatus = null; |
109 | 2234 | nbrodin | |
110 | 1047 | nbrodin | //Parameters only for providers
|
111 | private BandList bandList = null; |
||
112 | 2234 | nbrodin | private Buffer bufferForProviders = null; |
113 | 2308 | nbrodin | private boolean forceARGBBuffer = false; |
114 | private boolean forceRGBBuffer = false; |
||
115 | 2236 | nbrodin | //private Buffer bufferWithoutAdjust = null;
|
116 | 2234 | nbrodin | |
117 | |||
118 | //****************************************************
|
||
119 | //*************Request of data windows****************
|
||
120 | //****************************************************
|
||
121 | 1047 | nbrodin | |
122 | 2231 | nbrodin | public void setAreaOfInterest() { |
123 | this.type = TYPE_ENTIRE;
|
||
124 | 27 | nbrodin | } |
125 | 2234 | nbrodin | |
126 | 2231 | nbrodin | public void setAreaOfInterest(Rectangle pixelWindow) { |
127 | this.pixelWindow = pixelWindow;
|
||
128 | 2236 | nbrodin | this.type = TYPE_PX;
|
129 | 1050 | nbrodin | } |
130 | 2234 | nbrodin | |
131 | 2231 | nbrodin | public void setAreaOfInterest(Rectangle pixelWindow, int bufWidth, int bufHeight) { |
132 | this.pixelWindow = pixelWindow;
|
||
133 | this.widthForResampling = bufWidth;
|
||
134 | this.heightForResampling = bufHeight;
|
||
135 | 2236 | nbrodin | this.type = TYPE_PX;
|
136 | 27 | nbrodin | } |
137 | 2234 | nbrodin | |
138 | 2232 | nbrodin | public void setAreaOfInterest(Extent requestBoundingBox, int bufWidth, int bufHeight) { |
139 | 2231 | nbrodin | this.widthForResampling = bufWidth;
|
140 | this.heightForResampling = bufHeight;
|
||
141 | 2232 | nbrodin | this.requestBoundingBox = requestBoundingBox;
|
142 | 2236 | nbrodin | this.type = TYPE_WCOORDS;
|
143 | 2231 | nbrodin | } |
144 | 2234 | nbrodin | |
145 | 2232 | nbrodin | public void setAreaOfInterest(Extent boundingBox) { |
146 | this.requestBoundingBox = boundingBox;
|
||
147 | this.type = TYPE_WCOORDS;
|
||
148 | } |
||
149 | 2234 | nbrodin | |
150 | 2231 | nbrodin | public void setAreaOfInterest(Extent requestBoundingBox, |
151 | 234 | nbrodin | int bufWidth, int bufHeight, TileListener listener) { |
152 | 2231 | nbrodin | this.requestBoundingBox = requestBoundingBox;
|
153 | this.widthForResampling = bufWidth;
|
||
154 | this.heightForResampling = bufHeight;
|
||
155 | this.type = TYPE_TILED;
|
||
156 | 210 | nbrodin | this.listener = listener;
|
157 | } |
||
158 | 2234 | nbrodin | |
159 | 2231 | nbrodin | public void setTileParameters(int level, int tileCol, int tileRow) { |
160 | this.type = TYPE_ONE_TILE;
|
||
161 | this.resolutionLevel = level;
|
||
162 | this.tileRow = tileRow;
|
||
163 | this.tileCol = tileCol;
|
||
164 | 27 | nbrodin | } |
165 | 2234 | nbrodin | |
166 | 2231 | nbrodin | /**
|
167 | * @deprecated Use setTileParameters(int level, int tileCol, int tileRow)
|
||
168 | */
|
||
169 | 642 | nbrodin | public void setTileParameters(int level, int tileCol, int tileRow, Extent bbox, CacheStruct cacheStruct) { |
170 | this.type = TYPE_ONE_TILE;
|
||
171 | 2231 | nbrodin | this.requestBoundingBox = bbox;
|
172 | 642 | nbrodin | this.resolutionLevel = level;
|
173 | this.tileRow = tileRow;
|
||
174 | this.tileCol = tileCol;
|
||
175 | 880 | nbrodin | int[] size = null; |
176 | if(cacheStruct != null) { |
||
177 | this.cacheStruct = cacheStruct;
|
||
178 | size = cacheStruct.getTileSizeByLevel(level); |
||
179 | } else {
|
||
180 | size = new int[]{TileCacheLibrary.DEFAULT_TILEWIDTH, TileCacheLibrary.DEFAULT_TILEHEIGHT}; |
||
181 | } |
||
182 | 2231 | nbrodin | this.widthForResampling = size[0]; |
183 | this.heightForResampling = size[1]; |
||
184 | 642 | nbrodin | } |
185 | 27 | nbrodin | |
186 | |||
187 | |||
188 | 2234 | nbrodin | //****************************************************
|
189 | //****************Internal Services*******************
|
||
190 | //****************************************************
|
||
191 | 2235 | nbrodin | |
192 | public boolean requestIsTiled() { |
||
193 | switch (type) {
|
||
194 | case TYPE_TILED:
|
||
195 | case TYPE_ONE_TILE:
|
||
196 | return true; |
||
197 | } |
||
198 | return false; |
||
199 | } |
||
200 | 27 | nbrodin | |
201 | 2232 | nbrodin | public boolean requestHasShift() { |
202 | switch (type) {
|
||
203 | case TYPE_PX_RESCALED_SHIFT:
|
||
204 | case TYPE_PX_SHIFT:
|
||
205 | case TYPE_WCOORDS_SHIFT:
|
||
206 | return true; |
||
207 | } |
||
208 | return false; |
||
209 | } |
||
210 | 2234 | nbrodin | |
211 | 2232 | nbrodin | public boolean requestIsPixelCoordinates() { |
212 | switch (type) {
|
||
213 | case TYPE_PX:
|
||
214 | case TYPE_PX_SHIFT:
|
||
215 | case TYPE_PX_RESCALED:
|
||
216 | case TYPE_PX_RESCALED_SHIFT:
|
||
217 | case TYPE_ENTIRE:
|
||
218 | return true; |
||
219 | } |
||
220 | return false; |
||
221 | } |
||
222 | 2234 | nbrodin | |
223 | 2232 | nbrodin | public boolean requestIsInWorldCoordinates() { |
224 | switch (type) {
|
||
225 | case TYPE_WCOORDS:
|
||
226 | case TYPE_WCOORDS_RESCALED:
|
||
227 | case TYPE_WCOORDS_SHIFT:
|
||
228 | 2236 | nbrodin | case TYPE_TILED:
|
229 | 2232 | nbrodin | return true; |
230 | } |
||
231 | return false; |
||
232 | } |
||
233 | 2234 | nbrodin | |
234 | 2232 | nbrodin | public boolean requestIsRescaled() { |
235 | switch (type) {
|
||
236 | case TYPE_PX_RESCALED:
|
||
237 | case TYPE_PX_RESCALED_SHIFT:
|
||
238 | case TYPE_WCOORDS_RESCALED:
|
||
239 | 2235 | nbrodin | case TYPE_TILED:
|
240 | 2232 | nbrodin | return true; |
241 | } |
||
242 | return false; |
||
243 | } |
||
244 | 2234 | nbrodin | |
245 | /**
|
||
246 | 2236 | nbrodin | * Returns true if the request is trying apply supersampling, that is, the size of the result is
|
247 | 2234 | nbrodin | * bigger that the window of maximum resolution of this source
|
248 | * @return
|
||
249 | */
|
||
250 | 2236 | nbrodin | public boolean isSupersamplingTheRequest() { |
251 | 2234 | nbrodin | if(!requestHasShift()) {
|
252 | return (getBufWidth() > getAdjustedWidth() || getBufHeight() > getAdjustedHeight());
|
||
253 | } |
||
254 | return (getAdjustedBufWidth() > getAdjustedWidth() || getAdjustedBufHeight() > getAdjustedHeight());
|
||
255 | } |
||
256 | |||
257 | |||
258 | 2231 | nbrodin | public RasterQuery clone() {
|
259 | DefaultRasterQuery q = new DefaultRasterQuery();
|
||
260 | q.type = type; |
||
261 | q.pixelWindow = (Rectangle)pixelWindow.clone();
|
||
262 | q.adjustToSrcExtent = adjustToSrcExtent; |
||
263 | q.widthForResampling = widthForResampling; |
||
264 | q.heightForResampling = heightForResampling; |
||
265 | q.requestBoundingBox = requestBoundingBox != null ? requestBoundingBox.clone() : null; |
||
266 | q.tileCol = tileCol; |
||
267 | q.tileRow = tileRow; |
||
268 | q.resolutionLevel = resolutionLevel; |
||
269 | q.readOnly = readOnly; |
||
270 | q.memoryBuffer = memoryBuffer; |
||
271 | q.storeLastBuffer = storeLastBuffer; |
||
272 | 2321 | nbrodin | if(drawableBands != null) { |
273 | q.drawableBands = new int[drawableBands.length]; |
||
274 | for (int i = 0; i < q.drawableBands.length; i++) { |
||
275 | q.drawableBands[i] = drawableBands[i]; |
||
276 | } |
||
277 | 2231 | nbrodin | } |
278 | q.supersamplingLoadingBuffer = supersamplingLoadingBuffer; |
||
279 | q.noDataValueToFill = noDataValueToFill != null ? (NoData)noDataValueToFill.clone() : null; |
||
280 | q.listener = listener; |
||
281 | q.alphaBandNumber = alphaBandNumber; |
||
282 | q.bandList = bandList != null ? (BandList)bandList.clone() : null; |
||
283 | 2232 | nbrodin | q.bufferForProviders = bufferForProviders; |
284 | 2231 | nbrodin | return q;
|
285 | } |
||
286 | 2234 | nbrodin | |
287 | 88 | nbrodin | //****************************************************
|
288 | 2234 | nbrodin | //*************Parameters calculation*****************
|
289 | 1047 | nbrodin | //****************************************************
|
290 | 2244 | nbrodin | |
291 | /**
|
||
292 | * Calculates the parameters using the base request. That is, bounding boxes, data windows,
|
||
293 | * output size, steps and parameters for supersampling, band lists and buffers. This parameters
|
||
294 | * are calculated adjusting to the source limits. For this reason, the request parameters are
|
||
295 | * saved in other variables, to allow calculate the displacement and resampling whether it was
|
||
296 | * necessary
|
||
297 | * @param store
|
||
298 | * @throws QueryException
|
||
299 | */
|
||
300 | public void calculateParameters(RasterDataStore store) throws QueryException { |
||
301 | calculateRequestType(store); |
||
302 | 1047 | nbrodin | |
303 | 2244 | nbrodin | //Parameters for requests in pixels
|
304 | if(requestIsPixelCoordinates()) {
|
||
305 | calculateAdjustedPxSizeFromPxSize((int)store.getWidth(), (int)store.getHeight()); |
||
306 | calculateBoundingBoxesFromPxRequest(store); |
||
307 | } |
||
308 | |||
309 | //Parameters for requests in world coordinates
|
||
310 | if(requestIsInWorldCoordinates()) {
|
||
311 | calculateAdjustedWCWindowFromWCWindow(store.getAffineTransform(), (int)store.getWidth(), (int)store.getHeight()); |
||
312 | calculatePxWindowsFromBoundingBoxes(store); |
||
313 | } |
||
314 | |||
315 | //Output
|
||
316 | calculateOutputSizeFromPxWindow(store); |
||
317 | |||
318 | //Supersampling parameters
|
||
319 | step = null;
|
||
320 | if(isSupersamplingTheRequest() && !store.isRasterEnclosed()) {
|
||
321 | calculateStep(store); |
||
322 | supersampledBuffers(store); |
||
323 | } |
||
324 | |||
325 | //Bands and buffers
|
||
326 | buildDrawableBandList(store.getBands()); |
||
327 | 2303 | nbrodin | if(!dontBuildBuffer)
|
328 | createBuffer(store); |
||
329 | 2244 | nbrodin | } |
330 | |||
331 | 2231 | nbrodin | /**
|
332 | * Adjust the request in world coordinates to the data size
|
||
333 | * @param q
|
||
334 | */
|
||
335 | 2232 | nbrodin | private void calculateAdjustedWCWindowFromWCWindow(AffineTransform at, int w, int h) { |
336 | if(requestHasShift()) {
|
||
337 | setAdjustedRequestBoundingBox(getRequestBoundingBox().clone()); |
||
338 | } |
||
339 | RasterUtils util = RasterLocator.getManager().getRasterUtils(); |
||
340 | Extent adjustedDataExtent = util.calculateAdjustedView(getRequestBoundingBox(), at, w, h); |
||
341 | setAdjustedRequestBoundingBox(adjustedDataExtent); |
||
342 | 2231 | nbrodin | } |
343 | 2234 | nbrodin | |
344 | 2231 | nbrodin | /**
|
345 | 2232 | nbrodin | * Adjust the request in pixel coordinates to the data size
|
346 | * @param q
|
||
347 | */
|
||
348 | private void calculateAdjustedPxSizeFromPxSize(int sourceWidth, int sourceHeight) { |
||
349 | adjustedPixelWindow = (Rectangle)pixelWindow.clone();
|
||
350 | 2234 | nbrodin | |
351 | 2232 | nbrodin | if(requestHasShift())
|
352 | return;
|
||
353 | 2234 | nbrodin | |
354 | 2232 | nbrodin | if(getAdjustedX() < 0) |
355 | setAdjustedX(0);
|
||
356 | if(getAdjustedY() < 0) |
||
357 | setAdjustedY(0);
|
||
358 | if((getAdjustedX() + getAdjustedWidth()) > sourceWidth)
|
||
359 | setAdjustedWidth(sourceWidth - getX()); |
||
360 | if((getAdjustedY() + getAdjustedHeight()) > sourceHeight)
|
||
361 | setAdjustedHeight(sourceHeight - getAdjustedY()); |
||
362 | } |
||
363 | |||
364 | 2234 | nbrodin | |
365 | 2232 | nbrodin | private void calculateBoundingBoxesFromPxRequest(RasterDataStore store) { |
366 | Extent extent = new ExtentImpl(
|
||
367 | store.rasterToWorld(new Point2D.Double(getX(), getY())), |
||
368 | store.rasterToWorld(new Point2D.Double(getX() + getWidth(), getY() + getHeight()))); |
||
369 | setRequestBoundingBox(extent); |
||
370 | 2234 | nbrodin | |
371 | 2232 | nbrodin | Extent adjustedExtent = new ExtentImpl(
|
372 | store.rasterToWorld(new Point2D.Double(getAdjustedX(), getAdjustedY())), |
||
373 | store.rasterToWorld(new Point2D.Double(getAdjustedX() + getAdjustedWidth(), getAdjustedY() + getAdjustedHeight()))); |
||
374 | setAdjustedRequestBoundingBox(adjustedExtent); |
||
375 | } |
||
376 | 2234 | nbrodin | |
377 | 2232 | nbrodin | private double round(double value) { |
378 | double a = (value - (int)value); |
||
379 | return (a > 0.95 || a < 0.05) ? Math.round(value) : value; |
||
380 | } |
||
381 | 2234 | nbrodin | |
382 | 2232 | nbrodin | private void calculateOutputSizeFromPxWindow(RasterDataStore store) { |
383 | if(!requestIsRescaled()) {
|
||
384 | setBufHeight(getHeight()); |
||
385 | setBufWidth(getWidth()); |
||
386 | 2233 | nbrodin | setAdjustedBufWidth(getAdjustedWidth()); |
387 | 2232 | nbrodin | setAdjustedBufHeight(getAdjustedHeight()); |
388 | } else {
|
||
389 | double scaleWidth = (double)getWidth() / getBufWidth(); |
||
390 | double scaleHeight = (double)getHeight() / getBufHeight(); |
||
391 | setAdjustedBufWidth((int)Math.ceil(round(getAdjustedWidth() / scaleWidth))); |
||
392 | setAdjustedBufHeight((int)Math.ceil(round(getAdjustedHeight() / scaleHeight))); |
||
393 | } |
||
394 | 2234 | nbrodin | } |
395 | 2233 | nbrodin | |
396 | 2232 | nbrodin | private void calculatePxWindowsFromBoundingBoxes(RasterDataStore store) { |
397 | Extent requestBBox = getRequestBoundingBox(); |
||
398 | Point2D ul = store.worldToRaster(requestBBox.getUL());
|
||
399 | Point2D lr = store.worldToRaster(requestBBox.getLR());
|
||
400 | 2259 | nbrodin | int w = (int)Math.ceil(Math.abs(round(ul.getX()) - round(lr.getX()))); |
401 | int h = (int)Math.ceil(Math.abs(round(ul.getY()) - round(lr.getY()))); |
||
402 | 2232 | nbrodin | Rectangle r = new Rectangle((int)ul.getX(), (int)ul.getY(), w, h); |
403 | pixelWindow = r; |
||
404 | 2234 | nbrodin | |
405 | 2232 | nbrodin | Extent adjustedBBox = getAdjustedRequestBoundingBox(); |
406 | ul = store.worldToRaster(adjustedBBox.getUL()); |
||
407 | lr = store.worldToRaster(adjustedBBox.getLR()); |
||
408 | 2259 | nbrodin | w = (int)Math.ceil(Math.abs(round(ul.getX()) - round(lr.getX()))); |
409 | h = (int)Math.ceil(Math.abs(round(ul.getY()) - round(lr.getY()))); |
||
410 | 2232 | nbrodin | r = new Rectangle((int)ul.getX(), (int)ul.getY(), w, h); |
411 | adjustedPixelWindow = r; |
||
412 | } |
||
413 | 2234 | nbrodin | |
414 | /**
|
||
415 | * <p>
|
||
416 | * If the request is being supersampled, then the buffer size will be bigger than the pixel window.
|
||
417 | * In this case the provider will receive a buffer in 1:1 scale. The supersampling function will be
|
||
418 | * in the client (supersampling deactivated) or in the store (supersampling activated).
|
||
419 | * </p><p>
|
||
420 | * The buffer will have one pixel more because the resampling cuts the first pixel by the beginning and
|
||
421 | * shows the last pixel by the end.
|
||
422 | * </p>
|
||
423 | * @param store
|
||
424 | */
|
||
425 | private void supersampledBuffers(RasterDataStore store) { |
||
426 | //Si se est? pidiendo supersampleo el provider tiene que recibir un buffer de tama?o igual al n?mero real de
|
||
427 | //pixels del ?rea, por ello habr? que cambiar el adjustedbufwidth y adjustedBufHeight. Adem?s habr? que variar
|
||
428 | //el extent del provider y la ventana en pixeles para que todo cuadre. El objetivo es que cuando el cliente (Render)
|
||
429 | //supersamplee no le queden huecos en blanco porque le falte el ?ltimo pixel.
|
||
430 | if((getAdjustedX() + getAdjustedWidth()) < store.getWidth())
|
||
431 | setAdjustedWidth(getAdjustedWidth() + 1);
|
||
432 | if((getAdjustedY() + getAdjustedHeight()) < store.getHeight())
|
||
433 | setAdjustedHeight(getAdjustedHeight() + 1);
|
||
434 | setAdjustedBufWidth(getAdjustedWidth()); |
||
435 | setAdjustedBufHeight(getAdjustedHeight()); |
||
436 | Point2D ul = store.rasterToWorld(new Point2D.Double(adjustedPixelWindow.getX(), adjustedPixelWindow.getY())); |
||
437 | Point2D lr = store.rasterToWorld(new Point2D.Double( |
||
438 | adjustedPixelWindow.getX() + adjustedPixelWindow.getWidth(), |
||
439 | adjustedPixelWindow.getY() + adjustedPixelWindow.getHeight())); |
||
440 | setAdjustedRequestBoundingBox(new ExtentImpl(ul, lr));
|
||
441 | 2232 | nbrodin | } |
442 | 2234 | nbrodin | |
443 | /**
|
||
444 | * Giving a world coordinates, a buffer size and a original raster size. If the
|
||
445 | * buffer is bigger than the window requested in the source raster (supersampling),
|
||
446 | * then it means that each pixel of the raster will be written several times in
|
||
447 | * the destination buffer.
|
||
448 | *
|
||
449 | * This function calculates the shift in pixels en X and Y coordinate that
|
||
450 | * correspond to the first pixel, due to this pixel won't be drawn entirely.
|
||
451 | *
|
||
452 | * This operation is needed when the client wants to apply suppersampling on the
|
||
453 | * result of a request.
|
||
454 | */
|
||
455 | private void calculateStep(RasterDataStore store) { |
||
456 | 2233 | nbrodin | Point2D tl = store.worldToRaster(getAdjustedRequestBoundingBox().getUL());
|
457 | Point2D br = store.worldToRaster(getAdjustedRequestBoundingBox().getLR());
|
||
458 | 2234 | nbrodin | |
459 | 2233 | nbrodin | //Se obtiene el tama?o de la petici?n original pero ajustada ya que adjustedBufferWidth y adjustedBufferHeight
|
460 | //habr?n sido modificados para que no excedan el tama?o de la ventana, ya que el provider no debe supersamplear
|
||
461 | double scaleWidth = (double)getWidth() / getBufWidth(); |
||
462 | double scaleHeight = (double)getHeight() / getBufHeight(); |
||
463 | 2234 | nbrodin | int srcOriginalAdjustedWidth = (int)Math.ceil(round(getAdjustedWidth() / scaleWidth)); |
464 | int srcOriginalAdjustedHeight = (int)Math.ceil(round(getAdjustedHeight() / scaleHeight)); |
||
465 | 2232 | nbrodin | |
466 | 2234 | nbrodin | double wPx = (srcOriginalAdjustedWidth / Math.abs(br.getX() - tl.getX())); |
467 | double hPx = (srcOriginalAdjustedHeight / Math.abs(br.getY() - tl.getY())); |
||
468 | 2232 | nbrodin | |
469 | int x = (int)((tl.getX() > br.getX()) ? Math.floor(br.getX()) : Math.floor(tl.getX())); |
||
470 | int y = (int)((tl.getY() > br.getY()) ? Math.floor(br.getY()) : Math.floor(tl.getY())); |
||
471 | |||
472 | double a = (tl.getX() > br.getX()) ? (Math.abs(br.getX() - x)) : (Math.abs(tl.getX() - x)); |
||
473 | double b = (tl.getY() > br.getY()) ? (Math.abs(br.getY() - y)) : (Math.abs(tl.getY() - y)); |
||
474 | |||
475 | 2234 | nbrodin | double stpX = (int)((a * srcOriginalAdjustedWidth) / Math.abs(br.getX() - tl.getX())); |
476 | double stpY = (int)((b * srcOriginalAdjustedHeight) / Math.abs(br.getY() - tl.getY())); |
||
477 | 2232 | nbrodin | |
478 | 2234 | nbrodin | step = new double[]{stpX, stpY, wPx, hPx}; |
479 | 2232 | nbrodin | } |
480 | |||
481 | 2424 | nbrodin | public Buffer createBuffer(RasterDataStore store) throws QueryException { |
482 | 2234 | nbrodin | if(isReadOnly()) {
|
483 | bufferForProviders = DefaultRasterManager.getInstance().createReadOnlyBuffer( |
||
484 | 2239 | nbrodin | store.getDataType()[0], getAdjustedBufWidth(), getAdjustedBufHeight(), store.getBandCount());
|
485 | 2234 | nbrodin | try {
|
486 | 2238 | nbrodin | ((RasterReadOnlyBuffer)bufferForProviders).setBufferParams((QueryableRaster)store, |
487 | 2234 | nbrodin | getAdjustedX(), |
488 | getAdjustedY(), |
||
489 | 2239 | nbrodin | getAdjustedX() + getAdjustedWidth() - 1,
|
490 | getAdjustedY() + getAdjustedHeight() - 1,
|
||
491 | 2234 | nbrodin | bandList); |
492 | } catch (FileNotExistsException e) {
|
||
493 | throw new QueryException("Error setting buffer params in a RO buffer", e); |
||
494 | } catch (NotSupportedExtensionException e) {
|
||
495 | throw new QueryException("Error setting buffer params in a RO buffer", e); |
||
496 | } catch (InvalidSetViewException e) {
|
||
497 | throw new QueryException("Error setting buffer params in a RO buffer", e); |
||
498 | } |
||
499 | } else {
|
||
500 | BandList bandList = buildDrawableBandList(store.getBands()); |
||
501 | 2308 | nbrodin | int bandCount = bandList.getDrawableBandsCount();
|
502 | if(forceARGBBuffer)
|
||
503 | bandCount = 4;
|
||
504 | if(forceRGBBuffer)
|
||
505 | bandCount = 3;
|
||
506 | |||
507 | 2234 | nbrodin | if(isMemoryBuffer())
|
508 | bufferForProviders = DefaultRasterManager.getInstance().createMemoryBuffer( |
||
509 | 2308 | nbrodin | store.getDataType()[0], getAdjustedBufWidth(), getAdjustedBufHeight(), bandCount, true); |
510 | 2234 | nbrodin | else
|
511 | bufferForProviders = DefaultRasterManager.getInstance().createBuffer( |
||
512 | 2308 | nbrodin | store.getDataType()[0], getAdjustedBufWidth(), getAdjustedBufHeight(), bandCount, true); |
513 | 2232 | nbrodin | } |
514 | |||
515 | 2234 | nbrodin | bufferForProviders.setDataExtent(getAdjustedRequestBoundingBox().toRectangle2D()); |
516 | return bufferForProviders;
|
||
517 | 2232 | nbrodin | |
518 | 2234 | nbrodin | } |
519 | 2232 | nbrodin | |
520 | 2234 | nbrodin | /**
|
521 | * Builds a list o bands to draw from the store band list and
|
||
522 | * the <code>drawablebands</code> asigned by the user
|
||
523 | * @param drawableBands
|
||
524 | * @param storeBandList
|
||
525 | * @return
|
||
526 | */
|
||
527 | public BandList buildDrawableBandList(BandList storeBandList) {
|
||
528 | bandList = (BandList)storeBandList.clone(); |
||
529 | 2236 | nbrodin | //If drawableBands is null then the bandList is the same that the source band list
|
530 | if(drawableBands != null) |
||
531 | bandList.setDrawableBands(drawableBands); |
||
532 | 2234 | nbrodin | return bandList;
|
533 | } |
||
534 | 2236 | nbrodin | |
535 | private boolean isAdjustingPixelWindowToStore(RasterDataStore store) { |
||
536 | return (pixelWindow.getX() >= 0 && |
||
537 | pixelWindow.getY() >= 0 &&
|
||
538 | pixelWindow.getWidth() <= store.getWidth() && |
||
539 | pixelWindow.getHeight() <= store.getHeight()); |
||
540 | } |
||
541 | |||
542 | private boolean isBufferSizeDefined() { |
||
543 | return (widthForResampling != -1 && heightForResampling != -1); |
||
544 | } |
||
545 | |||
546 | private boolean isAdjustingRequestBBoxToStore(RasterDataStore store) { |
||
547 | Extent intersection = requestBoundingBox.intersection(store.getExtent()); |
||
548 | return intersection.equals(store.getExtent());
|
||
549 | } |
||
550 | |||
551 | private void calculateRequestType(RasterDataStore store) { |
||
552 | if(type == TYPE_ENTIRE) {
|
||
553 | pixelWindow = new Rectangle(0, 0, (int)store.getWidth(), (int)store.getHeight()); |
||
554 | return;
|
||
555 | } |
||
556 | |||
557 | if(!adjustToSrcExtent) {
|
||
558 | if(type == TYPE_PX) {
|
||
559 | if(isAdjustingPixelWindowToStore(store)) {
|
||
560 | if(isBufferSizeDefined())
|
||
561 | this.type = TYPE_PX_RESCALED;
|
||
562 | else
|
||
563 | this.type = TYPE_PX;
|
||
564 | } else {
|
||
565 | if(isBufferSizeDefined())
|
||
566 | this.type = TYPE_PX_RESCALED_SHIFT;
|
||
567 | else
|
||
568 | this.type = TYPE_PX_SHIFT;
|
||
569 | } |
||
570 | } |
||
571 | if(type == TYPE_WCOORDS) {
|
||
572 | if(isBufferSizeDefined()) {
|
||
573 | if(isAdjustingRequestBBoxToStore(store))
|
||
574 | this.type = TYPE_WCOORDS_RESCALED;
|
||
575 | else
|
||
576 | this.type = TYPE_WCOORDS_SHIFT;
|
||
577 | } //else TYPE_WCOORDS
|
||
578 | } |
||
579 | } else {
|
||
580 | if(type == TYPE_PX) {
|
||
581 | if(isBufferSizeDefined())
|
||
582 | this.type = TYPE_PX_RESCALED;
|
||
583 | } |
||
584 | if(type == TYPE_WCOORDS) {
|
||
585 | if(isBufferSizeDefined())
|
||
586 | this.type = TYPE_WCOORDS_RESCALED;
|
||
587 | //else TYPE_WCOORDS
|
||
588 | } |
||
589 | } |
||
590 | } |
||
591 | 2232 | nbrodin | |
592 | 1047 | nbrodin | //****************************************************
|
593 | 88 | nbrodin | //*********Implementing DataQuery methods*************
|
594 | //****************************************************
|
||
595 | 2234 | nbrodin | |
596 | 88 | nbrodin | public Object getQueryParameter(String name) { |
597 | return null; |
||
598 | } |
||
599 | |||
600 | public double getScale() { |
||
601 | return 0; |
||
602 | } |
||
603 | |||
604 | public void setQueryParameter(String name, Object value) { |
||
605 | 2234 | nbrodin | |
606 | 88 | nbrodin | } |
607 | |||
608 | public void setScale(double scale) { |
||
609 | 2234 | nbrodin | |
610 | 88 | nbrodin | } |
611 | 2234 | nbrodin | |
612 | 88 | nbrodin | //****************************************************
|
613 | //*********Implementing Persistent methods************
|
||
614 | //****************************************************
|
||
615 | |||
616 | public void loadFromState(PersistentState state) |
||
617 | throws PersistenceException {
|
||
618 | 2234 | nbrodin | |
619 | 88 | nbrodin | } |
620 | |||
621 | public void saveToState(PersistentState state) throws PersistenceException { |
||
622 | 2234 | nbrodin | |
623 | 88 | nbrodin | } |
624 | 2234 | nbrodin | |
625 | //****************************************************
|
||
626 | //**************Getters and Setters*******************
|
||
627 | //****************************************************
|
||
628 | 2236 | nbrodin | |
629 | 2308 | nbrodin | public void forceARGBRequest() { |
630 | this.forceARGBBuffer = true; |
||
631 | this.forceRGBBuffer = false; |
||
632 | } |
||
633 | |||
634 | public void forceRGBRequest() { |
||
635 | this.forceRGBBuffer = true; |
||
636 | this.forceARGBBuffer = false; |
||
637 | } |
||
638 | |||
639 | 2329 | nbrodin | public boolean isforcingRGBRequest() { |
640 | return (forceRGBBuffer && !forceARGBBuffer);
|
||
641 | } |
||
642 | |||
643 | public boolean isforcingARGBRequest() { |
||
644 | return (forceARGBBuffer && !forceRGBBuffer);
|
||
645 | } |
||
646 | |||
647 | 2303 | nbrodin | public void dontBuildBuffer() { |
648 | this.dontBuildBuffer = true; |
||
649 | } |
||
650 | |||
651 | 2234 | nbrodin | public int getType() { |
652 | return type;
|
||
653 | } |
||
654 | |||
655 | public void storeLastBuffer(boolean store) { |
||
656 | this.storeLastBuffer = store;
|
||
657 | } |
||
658 | |||
659 | /**
|
||
660 | * The user can told if the buffer will be stored or not in the RasterDatasource.
|
||
661 | * @return store
|
||
662 | */
|
||
663 | public boolean isStoredLastBuffer() { |
||
664 | return storeLastBuffer;
|
||
665 | } |
||
666 | |||
667 | public void setAdjustToExtent(boolean adjustToExtent) { |
||
668 | this.adjustToSrcExtent = adjustToExtent;
|
||
669 | } |
||
670 | |||
671 | public boolean isAdjustToExtent() { |
||
672 | return adjustToSrcExtent;
|
||
673 | } |
||
674 | |||
675 | public int[] getDrawableBands() { |
||
676 | return drawableBands;
|
||
677 | } |
||
678 | |||
679 | public void setAllDrawableBands() { |
||
680 | this.drawableBands = null; |
||
681 | } |
||
682 | |||
683 | public void setDrawableBands(int[] drawableBands) { |
||
684 | this.drawableBands = drawableBands;
|
||
685 | } |
||
686 | |||
687 | public void setReadOnly(boolean readOnly) { |
||
688 | this.readOnly = readOnly;
|
||
689 | } |
||
690 | |||
691 | 2236 | nbrodin | /**
|
692 | * Returns true if the supersampling is enable and false if it is disable
|
||
693 | * Rendering from gvSIG, the resampling is always disable because if the request
|
||
694 | * is greater than 1:1 scale the resampling will be done in the client <code>Render</code>.
|
||
695 | * The default value is disable.
|
||
696 | */
|
||
697 | 2234 | nbrodin | public boolean isSupersamplingOptionActive() { |
698 | return supersamplingLoadingBuffer;
|
||
699 | } |
||
700 | |||
701 | 2236 | nbrodin | /**
|
702 | * Enables or disables the supersampling loading the buffer. Rendering from gvSIG,
|
||
703 | * the resampling is always disable because if the request is greater than 1:1 scale
|
||
704 | * the resampling will be done in the client <code>Render</code>
|
||
705 | */
|
||
706 | 2234 | nbrodin | public void setSupersamplingOption(boolean supersamplingLoadingBuffer) { |
707 | this.supersamplingLoadingBuffer = supersamplingLoadingBuffer;
|
||
708 | } |
||
709 | |||
710 | public void setMemoryBuffer(boolean memoryBuffer) { |
||
711 | this.memoryBuffer = memoryBuffer;
|
||
712 | } |
||
713 | |||
714 | /**
|
||
715 | * Obtiene el flag que dice si la carga del siguiente buffer es en memoria
|
||
716 | * @return memory true si la siguiente carga de buffer se hace en memoria y false se deja decidir al dataset
|
||
717 | * el tipo de buffer
|
||
718 | */
|
||
719 | public boolean isMemoryBuffer() { |
||
720 | return memoryBuffer;
|
||
721 | } |
||
722 | |||
723 | public void setNoDataToFill(NoData noData) { |
||
724 | this.noDataValueToFill = noData;
|
||
725 | } |
||
726 | |||
727 | public void setAlphaBand(int bandNumber) { |
||
728 | this.alphaBandNumber = bandNumber;
|
||
729 | } |
||
730 | |||
731 | public int getAlphaBandNumber() { |
||
732 | return alphaBandNumber;
|
||
733 | } |
||
734 | |||
735 | public NoData getNoDataValueToFill() {
|
||
736 | return this.noDataValueToFill; |
||
737 | } |
||
738 | 2236 | nbrodin | |
739 | public void setRequestPixelWindow(Rectangle pixelWindow) { |
||
740 | this.pixelWindow = pixelWindow;
|
||
741 | } |
||
742 | 2234 | nbrodin | |
743 | public int getX() { |
||
744 | return (int)pixelWindow.getX(); |
||
745 | } |
||
746 | |||
747 | public int getY() { |
||
748 | return (int)pixelWindow.getY(); |
||
749 | } |
||
750 | |||
751 | public int getWidth() { |
||
752 | return (int)pixelWindow.getWidth(); |
||
753 | } |
||
754 | |||
755 | public int getHeight() { |
||
756 | return (int)pixelWindow.getHeight(); |
||
757 | } |
||
758 | |||
759 | public void setX(int x) { |
||
760 | pixelWindow.setLocation(x, getY()); |
||
761 | } |
||
762 | |||
763 | public void setY(int y) { |
||
764 | pixelWindow.setLocation(getX(), y); |
||
765 | } |
||
766 | |||
767 | public void setWidth(int w) { |
||
768 | pixelWindow.setSize(w, getWidth()); |
||
769 | } |
||
770 | |||
771 | public void setHeight(int h) { |
||
772 | pixelWindow.setSize(getHeight(), h); |
||
773 | } |
||
774 | |||
775 | public int getAdjustedX() { |
||
776 | return (int)adjustedPixelWindow.getX(); |
||
777 | } |
||
778 | |||
779 | public int getAdjustedY() { |
||
780 | return (int)adjustedPixelWindow.getY(); |
||
781 | } |
||
782 | |||
783 | public int getAdjustedWidth() { |
||
784 | return (int)adjustedPixelWindow.getWidth(); |
||
785 | } |
||
786 | |||
787 | public int getAdjustedHeight() { |
||
788 | return (int)adjustedPixelWindow.getHeight(); |
||
789 | } |
||
790 | |||
791 | public void setAdjustedX(int x) { |
||
792 | adjustedPixelWindow.setLocation(x, getAdjustedY()); |
||
793 | } |
||
794 | |||
795 | public void setAdjustedY(int y) { |
||
796 | adjustedPixelWindow.setLocation(getAdjustedX(), y); |
||
797 | } |
||
798 | |||
799 | public void setAdjustedWidth(int w) { |
||
800 | adjustedPixelWindow.setSize(w, getAdjustedHeight()); |
||
801 | } |
||
802 | |||
803 | public void setAdjustedHeight(int h) { |
||
804 | adjustedPixelWindow.setSize(getAdjustedWidth(), h); |
||
805 | } |
||
806 | |||
807 | /**
|
||
808 | * Gets the window of the request in pixel coordinates
|
||
809 | */
|
||
810 | public Rectangle getRequestPxWindow() { |
||
811 | return pixelWindow;
|
||
812 | } |
||
813 | |||
814 | /**
|
||
815 | * Gets the adjusted window of the request in pixel coordinates
|
||
816 | */
|
||
817 | public Rectangle getAdjustedRequestPxWindow() { |
||
818 | return adjustedPixelWindow;
|
||
819 | } |
||
820 | |||
821 | /**
|
||
822 | * Gets a bounding box of a request in world coordinates.
|
||
823 | */
|
||
824 | public Extent getRequestBoundingBox() {
|
||
825 | return requestBoundingBox;
|
||
826 | } |
||
827 | |||
828 | /**
|
||
829 | * Sets a bounding box of a request in world coordinates.
|
||
830 | * @param requestBoundingBox
|
||
831 | */
|
||
832 | public void setRequestBoundingBox(Extent requestBoundingBox) { |
||
833 | this.requestBoundingBox = requestBoundingBox;
|
||
834 | } |
||
835 | |||
836 | /**
|
||
837 | * Gets a bounding box of a request in world coordinates adjusted to the bounding box of the source.
|
||
838 | */
|
||
839 | public Extent getAdjustedRequestBoundingBox() {
|
||
840 | return adjustedBoundingBox;
|
||
841 | } |
||
842 | |||
843 | /**
|
||
844 | * Sets a bounding box of a request in world coordinates adjusted to the bounding box of the source.
|
||
845 | * @param requestBoundingBox
|
||
846 | */
|
||
847 | public void setAdjustedRequestBoundingBox(Extent adjustedBoundingBox) { |
||
848 | this.adjustedBoundingBox = adjustedBoundingBox;
|
||
849 | } |
||
850 | |||
851 | public int getBufWidth() { |
||
852 | return widthForResampling;
|
||
853 | } |
||
854 | |||
855 | public int getBufHeight() { |
||
856 | return heightForResampling;
|
||
857 | } |
||
858 | |||
859 | public void setBufHeight(int h) { |
||
860 | 2295 | nbrodin | heightForResampling = h; |
861 | 2234 | nbrodin | } |
862 | |||
863 | public void setBufWidth(int w) { |
||
864 | 2295 | nbrodin | widthForResampling = w; |
865 | 2234 | nbrodin | } |
866 | |||
867 | public int getAdjustedBufWidth() { |
||
868 | return adjustedBufferWidth;
|
||
869 | } |
||
870 | |||
871 | public int getAdjustedBufHeight() { |
||
872 | return adjustedBufferHeight;
|
||
873 | } |
||
874 | |||
875 | public void setAdjustedBufHeight(int h) { |
||
876 | adjustedBufferHeight = h; |
||
877 | } |
||
878 | |||
879 | public void setAdjustedBufWidth(int w) { |
||
880 | adjustedBufferWidth = w; |
||
881 | } |
||
882 | |||
883 | public boolean isReadOnly() { |
||
884 | return readOnly;
|
||
885 | } |
||
886 | |||
887 | public TileListener getTileListener() {
|
||
888 | return listener;
|
||
889 | } |
||
890 | |||
891 | public void setTileListener(TileListener listener) { |
||
892 | this.listener = listener;
|
||
893 | } |
||
894 | |||
895 | public Time getTime() { |
||
896 | return time;
|
||
897 | } |
||
898 | |||
899 | public void setTime(Time time) { |
||
900 | this.time = time;
|
||
901 | } |
||
902 | |||
903 | public int getTileRow() { |
||
904 | return tileRow;
|
||
905 | } |
||
906 | |||
907 | public int getTileCol() { |
||
908 | return tileCol;
|
||
909 | } |
||
910 | |||
911 | public CacheStruct getCacheStruct() {
|
||
912 | return cacheStruct;
|
||
913 | } |
||
914 | |||
915 | public void setCacheStruct(CacheStruct cacheStruct) { |
||
916 | this.cacheStruct = cacheStruct;
|
||
917 | } |
||
918 | |||
919 | public int getResolutionLevel() { |
||
920 | return resolutionLevel;
|
||
921 | } |
||
922 | |||
923 | public void setTaskStatus(TaskStatus taskStatus) { |
||
924 | this.taskStatus = taskStatus;
|
||
925 | } |
||
926 | |||
927 | public BandList getBandList() {
|
||
928 | return bandList;
|
||
929 | } |
||
930 | |||
931 | public void setBandList(BandList bandList) { |
||
932 | this.bandList = bandList;
|
||
933 | } |
||
934 | |||
935 | /**
|
||
936 | * Buffer loaded by the provider and created by the store
|
||
937 | * @return
|
||
938 | */
|
||
939 | public Buffer getBufferForProviders() { |
||
940 | return bufferForProviders;
|
||
941 | } |
||
942 | 2239 | nbrodin | |
943 | public void setBufferResult(Buffer buffer) { |
||
944 | this.bufferForProviders = buffer;
|
||
945 | } |
||
946 | 2234 | nbrodin | |
947 | 2236 | nbrodin | public void setBufferForProviders(Buffer buffer) throws QueryException { |
948 | if(buffer.getWidth() != getAdjustedBufWidth() || buffer.getHeight() != getAdjustedBufHeight())
|
||
949 | throw new QueryException("Error in buffer size"); |
||
950 | 2234 | nbrodin | this.bufferForProviders = buffer;
|
951 | } |
||
952 | |||
953 | public double[] getStep() { |
||
954 | return step;
|
||
955 | } |
||
956 | |||
957 | /**
|
||
958 | * Gets the task status
|
||
959 | */
|
||
960 | public TaskStatus getTaskStatus() {
|
||
961 | return taskStatus;
|
||
962 | } |
||
963 | 27 | nbrodin | } |