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 / grid / filter / enhancement / EnhancementStretchListManager.java @ 2348
History | View | Annotate | Download (19.1 KB)
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.impl.grid.filter.enhancement; |
23 |
|
24 |
import java.util.ArrayList; |
25 |
import java.util.List; |
26 |
|
27 |
import org.gvsig.fmap.dal.coverage.RasterLibrary; |
28 |
import org.gvsig.fmap.dal.coverage.datastruct.Params; |
29 |
import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException; |
30 |
import org.gvsig.fmap.dal.coverage.exception.FilterTypeException; |
31 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
32 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
33 |
import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager; |
34 |
import org.gvsig.fmap.dal.coverage.grid.RasterFilter; |
35 |
import org.gvsig.fmap.dal.coverage.grid.RasterFilterList; |
36 |
import org.gvsig.fmap.dal.coverage.store.props.Statistics; |
37 |
import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl; |
38 |
import org.gvsig.raster.impl.grid.filter.statistics.StatisticsListManager; |
39 |
import org.gvsig.raster.impl.store.ParamImpl; |
40 |
/**
|
41 |
* Gestor de la pila de filtros para el filtro de realce por intervalos.
|
42 |
*
|
43 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
44 |
*/
|
45 |
public class EnhancementStretchListManager extends AbstractRasterFilterManager { |
46 |
private static String ID = "EnhancementStretch"; |
47 |
private RasterFilterListManagerImpl filterListManager = null; |
48 |
|
49 |
/**
|
50 |
* Default constructor. Sets the filter list.
|
51 |
* @param filterList
|
52 |
*/
|
53 |
public EnhancementStretchListManager(RasterFilterList filterList) {
|
54 |
super(filterList);
|
55 |
} |
56 |
|
57 |
public String getManagerID() { |
58 |
return ID;
|
59 |
} |
60 |
|
61 |
public static void register() { |
62 |
AbstractRasterFilterManager.register(ID, EnhancementStretchListManager.class); |
63 |
} |
64 |
|
65 |
/**
|
66 |
* Constructor
|
67 |
* @param filterListManager
|
68 |
*/
|
69 |
public EnhancementStretchListManager(RasterFilterListManagerImpl filterListManager) {
|
70 |
super(filterListManager.getFilterList());
|
71 |
this.filterListManager = filterListManager;
|
72 |
} |
73 |
|
74 |
public Class<?> getFilterClassByID(String id) { |
75 |
if(id.compareTo("enhanced_stretch") == 0) |
76 |
return LinearStretchEnhancementFilter.class;
|
77 |
return null; |
78 |
} |
79 |
|
80 |
public boolean isDataTypeSupported(int dataType) { |
81 |
return true; |
82 |
} |
83 |
|
84 |
/**
|
85 |
* A?ade un filtro de realce.
|
86 |
* La forma de insercion del filtro es fija ya que la insercion de un realce lleva implicita
|
87 |
* la insercion de un filtro de recorte de colas (tailtrim), aunque no en todos los casos.
|
88 |
* Si ya existe un filtro de realce en la lista se obtiene la posici?n de este.
|
89 |
* Si es necesario un recorte de colas entonces se comprueba si existe un uno reemplazandose
|
90 |
* por el nuevo y sino se insertar? uno. Al final reemplazamos el realce que existia.
|
91 |
*
|
92 |
* Si por el contrario no existen realce ni trim se a?aden ambos al final de la lista.
|
93 |
* @param stats Objeto de estadisticas asociado
|
94 |
* @param tailTrim porcentaje de recorte de colas. Ser? un valor entre 0 y 1.
|
95 |
* @param insertionMode Modo de inserci?n
|
96 |
* @param renderBands bandas RGB mostradas en la visualizaci?n.
|
97 |
* @throws FilterTypeException
|
98 |
*/
|
99 |
public void addEnhancedStretchFilter(DefaultLinearStretchParams leParams, Statistics stats, int[] renderBands, boolean removeEnds) throws FilterTypeException { |
100 |
try {
|
101 |
if (!leParams.hasTailTrim()) { // En este caso siempre es necesario el m?ximo y |
102 |
// m?nimo
|
103 |
if (!stats.isCalculated())
|
104 |
try {
|
105 |
stats.calculate(RasterLibrary.statisticsScale); |
106 |
} catch (FileNotOpenException e) {
|
107 |
// No podemos aplicar el filtro
|
108 |
return;
|
109 |
} catch (RasterDriverException e) {
|
110 |
// No podemos aplicar el filtro
|
111 |
return;
|
112 |
} |
113 |
} else {
|
114 |
StatisticsListManager slm = null;
|
115 |
if(filterListManager != null) |
116 |
slm = new StatisticsListManager(filterListManager/*, stats*/); |
117 |
else
|
118 |
slm = new StatisticsListManager(getFilterList());
|
119 |
slm.addTailFilter(leParams.getTailTrimList(), 0D, removeEnds, stats);
|
120 |
} |
121 |
|
122 |
RasterFilter filter = createEnhancedFilter(leParams, stats, renderBands, removeEnds); |
123 |
if (filter != null) |
124 |
getFilterList().add(filter); |
125 |
} catch (ProcessInterruptedException e) {
|
126 |
//Si se ha interrumpido no a?adimos el filtro
|
127 |
} |
128 |
} |
129 |
|
130 |
public void addFilter(Params params) throws FilterTypeException { |
131 |
int[] renderBands = (int[])params.getParamById("renderBands").getDefaultValue(); |
132 |
Statistics stats = (Statistics)params.getParamById("stats").getDefaultValue();
|
133 |
boolean removeEnds = ((Boolean)params.getParamById("remove").getDefaultValue()).booleanValue(); |
134 |
|
135 |
DefaultLinearStretchParams p = null;
|
136 |
|
137 |
try {
|
138 |
if( params.getParamById("tailtrim") != null && |
139 |
params.getParamById("tailtrim").getDefaultValue() != null && |
140 |
params.getParamById("rgb").getDefaultValue() != null) { |
141 |
double tailtrim = ((Double)params.getParamById("tailtrim").getDefaultValue()).doubleValue(); |
142 |
boolean rgb = ((Boolean)params.getParamById("rgb").getDefaultValue()).booleanValue(); |
143 |
p = DefaultLinearStretchParams.createStandardParam(renderBands, tailtrim, stats, rgb); |
144 |
} else {
|
145 |
//Si stretch vale null se usan los par?metros por defecto de LinearStretchParams
|
146 |
if(params.getParamById("stretchs").getDefaultValue() == null) { |
147 |
boolean rgb = false; |
148 |
if(params.getParamById("rgb").getDefaultValue() != null) |
149 |
rgb = ((Boolean)params.getParamById("rgb").getDefaultValue()).booleanValue(); |
150 |
p = DefaultLinearStretchParams.createStandardParam(renderBands, 0.0, stats, rgb);
|
151 |
} |
152 |
} |
153 |
} catch (FileNotOpenException e) {
|
154 |
throw new FilterTypeException("", e); |
155 |
} catch (RasterDriverException e) {
|
156 |
throw new FilterTypeException("", e); |
157 |
} |
158 |
addEnhancedStretchFilter(p, stats, renderBands, removeEnds); |
159 |
} |
160 |
|
161 |
/**
|
162 |
* Crea un filtro de realce por tramos de forma est?tica
|
163 |
* @param leParams Par?metros del filtro
|
164 |
* @param stats
|
165 |
* @param renderBands
|
166 |
* @return
|
167 |
*/
|
168 |
public static RasterFilter createEnhancedFilter(DefaultLinearStretchParams leParams, Statistics stats, int[] renderBands, boolean removeEnds) { |
169 |
RasterFilter filter = new LinearStretchEnhancementFloatFilter();
|
170 |
if (filter != null) { |
171 |
filter.addParam("stats", stats);
|
172 |
filter.addParam("remove", new Boolean(false)); |
173 |
filter.addParam("renderBands", renderBands);
|
174 |
filter.addParam("stretchs", leParams);
|
175 |
filter.addParam("remove", new Boolean(removeEnds)); |
176 |
} |
177 |
|
178 |
return filter;
|
179 |
} |
180 |
|
181 |
public List<Class<?>> getRasterFilterList() { |
182 |
List<Class<?>> filters = new ArrayList<Class<?>>(); |
183 |
filters.add(LinearStretchEnhancementFilter.class); |
184 |
return filters;
|
185 |
} |
186 |
|
187 |
public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException { |
188 |
if (LinearStretchEnhancementFilter.class.isAssignableFrom(classFilter)) {
|
189 |
int[] renderBands = { 0, 1, 2 }; |
190 |
boolean removeEnds = false; |
191 |
|
192 |
DefaultLinearStretchParams leParams = new DefaultLinearStretchParams();
|
193 |
|
194 |
for (int i = 0; i < params.getNumParams(); i++) { |
195 |
if (((ParamImpl)params.getParam(i)).getId().equals("RenderBands") && |
196 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof String) { |
197 |
String[] bands = new String((String) ((ParamImpl)params.getParam(i)).getDefaultValue()).split(" "); |
198 |
renderBands[0] = new Integer(bands[0]).intValue(); |
199 |
renderBands[1] = new Integer(bands[1]).intValue(); |
200 |
renderBands[2] = new Integer(bands[2]).intValue(); |
201 |
continue;
|
202 |
} |
203 |
|
204 |
if (((ParamImpl)params.getParam(i)).getId().equals("Remove")) |
205 |
removeEnds = ((Boolean) ((ParamImpl)params.getParam(i)).getDefaultValue()).booleanValue();
|
206 |
|
207 |
if (((ParamImpl)params.getParam(i)).getId().equals("RGB")) |
208 |
leParams.rgb = ((Boolean) ((ParamImpl)params.getParam(i)).getDefaultValue()).booleanValue();
|
209 |
|
210 |
if (((ParamImpl)params.getParam(i)).getId().equals("StretchInRed") && |
211 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[]) |
212 |
leParams.red.stretchIn = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue()); |
213 |
if (((ParamImpl)params.getParam(i)).getId().equals("StretchInGreen") && |
214 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[]) |
215 |
leParams.green.stretchIn = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue()); |
216 |
if (((ParamImpl)params.getParam(i)).getId().equals("StretchInBlue") && |
217 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[]) |
218 |
leParams.blue.stretchIn = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue()); |
219 |
if (((ParamImpl)params.getParam(i)).getId().equals("StretchOutRed") && |
220 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof int[]) |
221 |
leParams.red.stretchOut = ((int[]) ((ParamImpl)params.getParam(i)).getDefaultValue()); |
222 |
if (((ParamImpl)params.getParam(i)).getId().equals("StretchOutGreen") && |
223 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof int[]) |
224 |
leParams.green.stretchOut = ((int[]) ((ParamImpl)params.getParam(i)).getDefaultValue()); |
225 |
if (((ParamImpl)params.getParam(i)).getId().equals("StretchOutBlue") && |
226 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof int[]) |
227 |
leParams.blue.stretchOut = ((int[]) ((ParamImpl)params.getParam(i)).getDefaultValue()); |
228 |
|
229 |
|
230 |
if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimRedMin") && |
231 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
232 |
leParams.red.tailTrimMin = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
233 |
if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimRedMax") && |
234 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
235 |
leParams.red.tailTrimMax = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
236 |
if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimGreenMin") && |
237 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
238 |
leParams.green.tailTrimMin = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
239 |
if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimGreenMax") && |
240 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
241 |
leParams.green.tailTrimMax = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
242 |
if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimBlueMin") && |
243 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
244 |
leParams.blue.tailTrimMin = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
245 |
if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimBlueMax") && |
246 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
247 |
leParams.blue.tailTrimMax = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
248 |
|
249 |
|
250 |
if (((ParamImpl)params.getParam(i)).getId().equals("StretchRedFunctionType") && |
251 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer) |
252 |
leParams.red.functionType = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
|
253 |
if (((ParamImpl)params.getParam(i)).getId().equals("StretchRedValueFunction") && |
254 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
255 |
leParams.red.valueFunction = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
256 |
if (((ParamImpl)params.getParam(i)).getId().equals("StretchGreenFunctionType") && |
257 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer) |
258 |
leParams.green.functionType = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
|
259 |
if (((ParamImpl)params.getParam(i)).getId().equals("StretchGreenValueFunction") && |
260 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
261 |
leParams.green.valueFunction = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
262 |
if (((ParamImpl)params.getParam(i)).getId().equals("StretchBlueFunctionType") && |
263 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer) |
264 |
leParams.blue.functionType = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
|
265 |
if (((ParamImpl)params.getParam(i)).getId().equals("StretchBlueValueFunction") && |
266 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
267 |
leParams.blue.valueFunction = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
268 |
|
269 |
|
270 |
if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimRedValueMin") && |
271 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
272 |
leParams.red.tailTrimValueMin = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
273 |
if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimRedValueMax") && |
274 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
275 |
leParams.red.tailTrimValueMax = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
276 |
if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimGreenValueMin") && |
277 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
278 |
leParams.green.tailTrimValueMin = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
279 |
if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimGreenValueMax") && |
280 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
281 |
leParams.green.tailTrimValueMax = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
282 |
if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimBlueValueMin") && |
283 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
284 |
leParams.blue.tailTrimValueMin = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
285 |
if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimBlueValueMax") && |
286 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
287 |
leParams.blue.tailTrimValueMax = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
288 |
|
289 |
|
290 |
if (((ParamImpl)params.getParam(i)).getId().equals("RedMaxValue") && |
291 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
292 |
leParams.red.maxValue = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
293 |
if (((ParamImpl)params.getParam(i)).getId().equals("RedMinValue") && |
294 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
295 |
leParams.red.minValue = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
296 |
if (((ParamImpl)params.getParam(i)).getId().equals("GreenMaxValue") && |
297 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
298 |
leParams.green.maxValue = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
299 |
if (((ParamImpl)params.getParam(i)).getId().equals("GreenMinValue") && |
300 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
301 |
leParams.green.minValue = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
302 |
if (((ParamImpl)params.getParam(i)).getId().equals("BlueMaxValue") && |
303 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
304 |
leParams.blue.maxValue = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
305 |
if (((ParamImpl)params.getParam(i)).getId().equals("BlueMinValue") && |
306 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double) |
307 |
leParams.blue.minValue = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
|
308 |
|
309 |
|
310 |
if (((ParamImpl)params.getParam(i)).getId().equals("RedOffset") && |
311 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[]) |
312 |
leParams.red.offset = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue()); |
313 |
if (((ParamImpl)params.getParam(i)).getId().equals("GreenOffset") && |
314 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[]) |
315 |
leParams.green.offset = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue()); |
316 |
if (((ParamImpl)params.getParam(i)).getId().equals("BlueOffset") && |
317 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[]) |
318 |
leParams.blue.offset = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue()); |
319 |
if (((ParamImpl)params.getParam(i)).getId().equals("RedScale") && |
320 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[]) |
321 |
leParams.red.scale = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue()); |
322 |
if (((ParamImpl)params.getParam(i)).getId().equals("GreenScale") && |
323 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[]) |
324 |
leParams.green.scale = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue()); |
325 |
if (((ParamImpl)params.getParam(i)).getId().equals("BlueScale") && |
326 |
((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[]) |
327 |
leParams.blue.scale = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue()); |
328 |
} |
329 |
|
330 |
addEnhancedStretchFilter(leParams, (Statistics) getFilterList().getEnvParam("SrcStatistics"), renderBands, removeEnds);
|
331 |
} |
332 |
} |
333 |
|
334 |
public RasterFilter createFilter(Params params) throws FilterTypeException { |
335 |
int[] renderBands = null; |
336 |
Statistics stats = null;
|
337 |
Boolean removeEnds = null; |
338 |
|
339 |
if(params.getParamById("renderBands") != null) |
340 |
renderBands = (int[])params.getParamById("renderBands").getDefaultValue(); |
341 |
if(params.getParamById("stats") != null) |
342 |
stats = (Statistics)params.getParamById("stats").getDefaultValue();
|
343 |
if(params.getParamById("remove") != null) |
344 |
removeEnds = ((Boolean)params.getParamById("remove").getDefaultValue()); |
345 |
|
346 |
DefaultLinearStretchParams p = null;
|
347 |
|
348 |
try {
|
349 |
if( params.getParamById("tailtrim") != null && |
350 |
params.getParamById("rgb") != null && |
351 |
params.getParamById("tailtrim").getDefaultValue() != null && |
352 |
params.getParamById("rgb").getDefaultValue() != null) { |
353 |
double tailtrim = ((Double)params.getParamById("tailtrim").getDefaultValue()).doubleValue(); |
354 |
boolean rgb = ((Boolean)params.getParamById("rgb").getDefaultValue()).booleanValue(); |
355 |
p = DefaultLinearStretchParams.createStandardParam(renderBands, tailtrim, stats, rgb); |
356 |
} else {
|
357 |
//Si stretch vale null se usan los par?metros por defecto de LinearStretchParams
|
358 |
if( params.getParamById("stretchs") != null && |
359 |
params.getParamById("stretchs").getDefaultValue() == null) { |
360 |
p = DefaultLinearStretchParams.createStandardParam(renderBands, 0.0, stats, removeEnds.booleanValue());
|
361 |
} |
362 |
} |
363 |
} catch (FileNotOpenException e) {
|
364 |
throw new FilterTypeException("", e); |
365 |
} catch (RasterDriverException e) {
|
366 |
throw new FilterTypeException("", e); |
367 |
} |
368 |
return createEnhancedFilter(p, stats, renderBands, removeEnds != null ? removeEnds.booleanValue() : true); |
369 |
} |
370 |
} |