Revision 2312
org.gvsig.raster.tools/branches/org.gvsig.raster.tools_dataaccess_refactoring/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/control/EnhancedControl.java | ||
---|---|---|
268 | 268 |
if (ePanel.getActive().isSelected()) { |
269 | 269 |
if(lyr != null) { |
270 | 270 |
stats = lyr.getDataStore().getStatistics(); |
271 |
renderBands = lyr.getRender().getRenderBands(); |
|
271 |
renderBands = lyr.getRender().getRenderColorInterpretation().buildRenderBands();
|
|
272 | 272 |
// En este caso siempre es necesario el m?ximo y m?nimo |
273 | 273 |
try { |
274 | 274 |
if(!stats.isCalculated() && lyr instanceof FLyrRaster) |
org.gvsig.raster.tools/branches/org.gvsig.raster.tools_dataaccess_refactoring/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/PreviewFiltering.java | ||
---|---|---|
207 | 207 |
try { |
208 | 208 |
Params params = (Params) ((RasterFilter) filtersInit.get(i)).getUIParams(((RasterFilter) filtersInit.get(i)).getName()).clone(); |
209 | 209 |
// A?ado el parametro RenderBands a los parametros del filtro |
210 |
String rgb = layerRaster.getRender().getRenderBands()[0] + " " + layerRaster.getRender().getRenderBands()[1] + " " + layerRaster.getRender().getRenderBands()[2]; |
|
210 |
int[] renderBands = layerRaster.getRender().getRenderColorInterpretation().buildRenderBands(); |
|
211 |
String rgb = renderBands[0] + " " + renderBands[1] + " " + renderBands[2]; |
|
211 | 212 |
params.setParam("RenderBands", rgb, 0, null); |
212 | 213 |
|
213 | 214 |
ParamStruct newParam = new ParamStruct(); |
org.gvsig.raster.tools/branches/org.gvsig.raster.tools_dataaccess_refactoring/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/EnhancedHistogramController.java | ||
---|---|---|
32 | 32 |
* Manager para actualizar la vista previa y el histograma de salida del cuadro |
33 | 33 |
* de realce |
34 | 34 |
* |
35 |
* @version 04/03/2008 |
|
36 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
|
35 |
* @author BorSanZa - Borja S?nchez Zamorano |
|
37 | 36 |
*/ |
38 | 37 |
public class EnhancedHistogramController { |
39 | 38 |
private InputHistogram inputHistogram = null; |
... | ... | |
46 | 45 |
this.enhancedDialog = enhancedDialog; |
47 | 46 |
} |
48 | 47 |
|
49 |
public void updatePreview() { |
|
50 |
Params params = RasterLocator.getManager().createParams("", 0, 0, null); |
|
51 |
|
|
52 |
// Double min = Double.valueOf(0.0D); |
|
53 |
boolean rgb = enhancedDialog.getGraphicsPanel().getRGB().isSelected(); |
|
54 |
HistogramStatus histogram = inputHistogram.getHistogramStatus(HistogramGraphicBase.GRAY); |
|
55 |
if (enhancedDialog.getLayer().getRender().isRenderingAsGray()) { |
|
48 |
private void renderingAsGray(HistogramStatus histogram, Params params) { |
|
49 |
if (histogram.getBaseFunction() instanceof StraightLine) { |
|
50 |
StraightLine line = (StraightLine) histogram.getBaseFunction(); |
|
51 |
double[] valuesIn; |
|
52 |
if (enhancedDialog.getGraphicsPanel().getRGB().isSelected()) |
|
53 |
valuesIn = line.getInValues(0, 255); |
|
54 |
else |
|
55 |
valuesIn = line.getInValues(histogram.getMin(), histogram.getMax()); |
|
56 |
int[] valuesOut = line.getOutValues(); |
|
57 |
params.setParam("StretchInRed", valuesIn, -1, null); |
|
58 |
params.setParam("StretchOutRed", valuesOut, -1, null); |
|
59 |
params.setParam("StretchRedFunctionType", Integer.valueOf(line.getFunctionType()), -1, null); |
|
60 |
params.setParam("StretchRedValueFunction", Double.valueOf(line.getValueFunction()), -1, null); |
|
61 |
params.setParam("StretchInGreen", valuesIn, -1, null); |
|
62 |
params.setParam("StretchOutGreen", valuesOut, -1, null); |
|
63 |
params.setParam("StretchGreenFunctionType", Integer.valueOf(line.getFunctionType()), -1, null); |
|
64 |
params.setParam("StretchGreenValueFunction", Double.valueOf(line.getValueFunction()), -1, null); |
|
65 |
params.setParam("StretchInBlue", valuesIn, -1, null); |
|
66 |
params.setParam("StretchOutBlue", valuesOut, -1, null); |
|
67 |
params.setParam("StretchBlueFunctionType", Integer.valueOf(line.getFunctionType()), -1, null); |
|
68 |
params.setParam("StretchBlueValueFunction", Double.valueOf(line.getValueFunction()), -1, null); |
|
69 |
} |
|
70 |
} |
|
71 |
|
|
72 |
private void renderingAsColor(HistogramStatus histogram, |
|
73 |
Params params, |
|
74 |
String inColorLabel, |
|
75 |
String outColorLabel, |
|
76 |
String functionTypeLabel, |
|
77 |
String valueFunctionLabel) { |
|
78 |
if (histogram != null) { |
|
56 | 79 |
if (histogram.getBaseFunction() instanceof StraightLine) { |
57 | 80 |
StraightLine line = (StraightLine) histogram.getBaseFunction(); |
58 | 81 |
double[] valuesIn; |
59 |
if (rgb)
|
|
82 |
if (enhancedDialog.getGraphicsPanel().getRGB().isSelected())
|
|
60 | 83 |
valuesIn = line.getInValues(0, 255); |
61 | 84 |
else |
62 | 85 |
valuesIn = line.getInValues(histogram.getMin(), histogram.getMax()); |
63 | 86 |
int[] valuesOut = line.getOutValues(); |
64 |
params.setParam("StretchInRed", valuesIn, -1, null); |
|
65 |
params.setParam("StretchOutRed", valuesOut, -1, null); |
|
66 |
params.setParam("StretchRedFunctionType", Integer.valueOf(line.getFunctionType()), -1, null); |
|
67 |
params.setParam("StretchRedValueFunction", Double.valueOf(line.getValueFunction()), -1, null); |
|
68 |
params.setParam("StretchInGreen", valuesIn, -1, null); |
|
69 |
params.setParam("StretchOutGreen", valuesOut, -1, null); |
|
70 |
params.setParam("StretchGreenFunctionType", Integer.valueOf(line.getFunctionType()), -1, null); |
|
71 |
params.setParam("StretchGreenValueFunction", Double.valueOf(line.getValueFunction()), -1, null); |
|
72 |
params.setParam("StretchInBlue", valuesIn, -1, null); |
|
73 |
params.setParam("StretchOutBlue", valuesOut, -1, null); |
|
74 |
params.setParam("StretchBlueFunctionType", Integer.valueOf(line.getFunctionType()), -1, null); |
|
75 |
params.setParam("StretchBlueValueFunction", Double.valueOf(line.getValueFunction()), -1, null); |
|
87 |
|
|
88 |
params.setParam(inColorLabel, valuesIn, -1, null); |
|
89 |
params.setParam(outColorLabel, valuesOut, -1, null); |
|
90 |
params.setParam(functionTypeLabel, Integer.valueOf(line.getFunctionType()), -1, null); |
|
91 |
params.setParam(valueFunctionLabel, Double.valueOf(line.getValueFunction()), -1, null); |
|
76 | 92 |
} |
93 |
} |
|
94 |
} |
|
95 |
|
|
96 |
public void updatePreview() { |
|
97 |
Params params = RasterLocator.getManager().createParams("", 0, 0, null); |
|
98 |
HistogramStatus histogram = null; |
|
99 |
|
|
100 |
if (enhancedDialog.getLayer().getRender().isRenderingAsGray()) { |
|
101 |
histogram = inputHistogram.getHistogramStatus(HistogramGraphicBase.GRAY); |
|
102 |
renderingAsGray(histogram, params); |
|
77 | 103 |
} else { |
78 | 104 |
histogram = inputHistogram.getHistogramStatus(HistogramGraphicBase.RED); |
79 | 105 |
if (histogram != null) { |
80 |
if (histogram.getBaseFunction() instanceof StraightLine) { |
|
81 |
StraightLine line = (StraightLine) histogram.getBaseFunction(); |
|
82 |
double[] valuesIn; |
|
83 |
if (rgb) |
|
84 |
valuesIn = line.getInValues(0, 255); |
|
85 |
else |
|
86 |
valuesIn = line.getInValues(histogram.getMin(), histogram.getMax()); |
|
87 |
int[] valuesOut = line.getOutValues(); |
|
88 |
|
|
89 |
params.setParam("StretchInRed", valuesIn, -1, null); |
|
90 |
params.setParam("StretchOutRed", valuesOut, -1, null); |
|
91 |
params.setParam("StretchRedFunctionType", Integer.valueOf(line.getFunctionType()), -1, null); |
|
92 |
params.setParam("StretchRedValueFunction", Double.valueOf(line.getValueFunction()), -1, null); |
|
93 |
} |
|
106 |
renderingAsColor( |
|
107 |
histogram, |
|
108 |
params, |
|
109 |
"StretchInRed", |
|
110 |
"StretchOutRed", |
|
111 |
"StretchRedFunctionType", |
|
112 |
"StretchRedValueFunction"); |
|
94 | 113 |
} |
95 | 114 |
histogram = inputHistogram.getHistogramStatus(HistogramGraphicBase.GREEN); |
96 | 115 |
if (histogram != null) { |
97 |
if (histogram.getBaseFunction() instanceof StraightLine) { |
|
98 |
StraightLine line = (StraightLine) histogram.getBaseFunction(); |
|
99 |
double[] valuesIn; |
|
100 |
if (rgb) |
|
101 |
valuesIn = line.getInValues(0, 255); |
|
102 |
else |
|
103 |
valuesIn = line.getInValues(histogram.getMin(), histogram.getMax()); |
|
104 |
int[] valuesOut = line.getOutValues(); |
|
105 |
|
|
106 |
params.setParam("StretchInGreen", valuesIn, -1, null); |
|
107 |
params.setParam("StretchOutGreen", valuesOut, -1, null); |
|
108 |
params.setParam("StretchGreenFunctionType", Integer.valueOf(line.getFunctionType()), -1, null); |
|
109 |
params.setParam("StretchGreenValueFunction", Double.valueOf(line.getValueFunction()), -1, null); |
|
110 |
} |
|
116 |
renderingAsColor( |
|
117 |
histogram, |
|
118 |
params, |
|
119 |
"StretchInGreen", |
|
120 |
"StretchOutGreen", |
|
121 |
"StretchGreenFunctionType", |
|
122 |
"StretchGreenValueFunction"); |
|
111 | 123 |
} |
112 | 124 |
histogram = inputHistogram.getHistogramStatus(HistogramGraphicBase.BLUE); |
113 | 125 |
if (histogram != null) { |
114 |
if (histogram.getBaseFunction() instanceof StraightLine) { |
|
115 |
StraightLine line = (StraightLine) histogram.getBaseFunction(); |
|
116 |
double[] valuesIn; |
|
117 |
if (rgb) |
|
118 |
valuesIn = line.getInValues(0, 255); |
|
119 |
else |
|
120 |
valuesIn = line.getInValues(histogram.getMin(), histogram.getMax()); |
|
121 |
int[] valuesOut = line.getOutValues(); |
|
122 |
|
|
123 |
params.setParam("StretchInBlue", valuesIn, -1, null); |
|
124 |
params.setParam("StretchOutBlue", valuesOut, -1, null); |
|
125 |
params.setParam("StretchBlueFunctionType", Integer.valueOf(line.getFunctionType()), -1, null); |
|
126 |
params.setParam("StretchBlueValueFunction", Double.valueOf(line.getValueFunction()), -1, null); |
|
127 |
} |
|
126 |
renderingAsColor( |
|
127 |
histogram, |
|
128 |
params, |
|
129 |
"StretchInBlue", |
|
130 |
"StretchOutBlue", |
|
131 |
"StretchBlueFunctionType", |
|
132 |
"StretchBlueValueFunction"); |
|
128 | 133 |
} |
129 | 134 |
} |
130 | 135 |
|
... | ... | |
134 | 139 |
params.setParam("TailTrimGreenMax", Double.valueOf(0.0D), -1, null); |
135 | 140 |
params.setParam("TailTrimBlueMin", Double.valueOf(0.0D), -1, null); |
136 | 141 |
params.setParam("TailTrimBlueMax", Double.valueOf(0.0D), -1, null); |
137 |
|
|
142 |
|
|
143 |
boolean rgb = enhancedDialog.getGraphicsPanel().getRGB().isSelected(); |
|
144 |
|
|
138 | 145 |
params.setParam("RGB", new Boolean(rgb), -1, null); |
146 |
|
|
147 |
int[] renderBands = enhancedDialog.getLayer().getRender().getRenderColorInterpretation().buildRenderBands(); |
|
139 | 148 |
String render = ""; |
140 |
for (int i = 0; i < enhancedDialog.getLayer().getRender().getRenderBands().length; i++) {
|
|
149 |
for (int i = 0; i < renderBands.length; i++) {
|
|
141 | 150 |
if (render != "") |
142 | 151 |
render += " "; |
143 |
render = render + "" + enhancedDialog.getLayer().getRender().getRenderBands()[i];
|
|
152 |
render = render + "" + renderBands[i];
|
|
144 | 153 |
} |
145 | 154 |
params.setParam("RenderBands", render, -1, null); |
146 | 155 |
|
org.gvsig.raster.tools/branches/org.gvsig.raster.tools_dataaccess_refactoring/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/ui/EnhancedListener.java | ||
---|---|---|
217 | 217 |
|
218 | 218 |
if(((String)selectorsPanel.getEnhancedType().getSelectedItem()).equals(Messages.getText("equalization"))) { |
219 | 219 |
graphicsPanel.getInputHistogram().setFunction(GraphicHistogram.FUNCTION_NONE); |
220 |
int[] renderBands = enhancedDialog.getLayer().getRender().getRenderBands(); |
|
220 |
int[] renderBands = enhancedDialog.getLayer().getRender().getRenderColorInterpretation().buildRenderBands();
|
|
221 | 221 |
String values = ""; |
222 | 222 |
for (int i = 0; i < renderBands.length; i++) |
223 | 223 |
values += renderBands[i] + " "; |
org.gvsig.raster.tools/branches/org.gvsig.raster.tools_dataaccess_refactoring/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/enhanced/graphics/HistogramGraphicBase.java | ||
---|---|---|
29 | 29 |
import javax.swing.JPanel; |
30 | 30 |
|
31 | 31 |
import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram; |
32 |
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation; |
|
32 | 33 |
import org.gvsig.raster.fmap.layers.FLyrRaster; |
33 | 34 |
import org.gvsig.raster.swing.RasterSwingLocator; |
34 | 35 |
import org.gvsig.raster.swing.gcanvas.BaseFunction; |
... | ... | |
214 | 215 |
|
215 | 216 |
/** |
216 | 217 |
* Define el histograma para una banda de color |
217 |
* @param COLOR Banda al que se le aplicara el histograma |
|
218 |
* @param minList Lista de minimos |
|
219 |
* @param maxList Lista de maximos |
|
220 |
* @param table Tabla de valores de un histograma |
|
218 |
* @param color |
|
219 |
* Banda a la que se le aplicara el histograma |
|
220 |
* @param minList |
|
221 |
* Lista de minimos |
|
222 |
* @param maxList |
|
223 |
* Lista de maximos |
|
224 |
* @param table |
|
225 |
* Tabla de valores de un histograma |
|
221 | 226 |
*/ |
222 |
private void setHistogramBand(int COLOR, double[] minList, double[] maxList, long[][] table) {
|
|
227 |
private void setHistogramBand(int color, double[] minList, double[] maxList, long[][] table) {
|
|
223 | 228 |
int position = 0; |
224 |
switch (COLOR) {
|
|
229 |
switch (color) {
|
|
225 | 230 |
case GREEN: |
226 | 231 |
position = 1; |
227 | 232 |
break; |
... | ... | |
230 | 235 |
break; |
231 | 236 |
} |
232 | 237 |
|
233 |
int[] renderBands = lyr.getRender().getRenderBands(); |
|
238 |
ColorInterpretation ci = lyr.getRender().getRenderColorInterpretation(); |
|
239 |
int[] renderBands = ci.buildRenderBands(); |
|
234 | 240 |
|
235 | 241 |
if (position >= renderBands.length) |
236 | 242 |
return; |
... | ... | |
243 | 249 |
double histogram[] = new double[table[band].length]; |
244 | 250 |
for (int i = 0; i < histogram.length; i++) |
245 | 251 |
histogram[i] = (double) table[band][i]; |
246 |
setHistogram(histogram, COLOR);
|
|
252 |
setHistogram(histogram, color);
|
|
247 | 253 |
|
248 |
HistogramStatus histogramStatus = getHistogramStatus(COLOR);
|
|
254 |
HistogramStatus histogramStatus = getHistogramStatus(color);
|
|
249 | 255 |
|
250 | 256 |
if (histogramStatus == null) |
251 | 257 |
return; |
org.gvsig.raster.tools/branches/org.gvsig.raster.tools_dataaccess_refactoring/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/FilterListener.java | ||
---|---|---|
224 | 224 |
try { |
225 | 225 |
Params params = (Params) ((RasterFilter) filtersInit.get(i)).getUIParams(((RasterFilter) filtersInit.get(i)).getName()).clone(); |
226 | 226 |
// A?ado el parametro RenderBands a los parametros del filtro |
227 |
String rgb = layerRaster.getRender().getRenderBands()[0] + " " + layerRaster.getRender().getRenderBands()[1] + " " + layerRaster.getRender().getRenderBands()[2]; |
|
227 |
int[] renderBands = layerRaster.getRender().getRenderColorInterpretation().buildRenderBands(); |
|
228 |
String rgb = renderBands[0] + " " + renderBands[1] + " " + renderBands[2]; |
|
228 | 229 |
params.setParam("RenderBands", rgb, 0, null); |
229 | 230 |
params.setParam("alphaBand", new Integer(layerRaster.getAlphaBandNumber()), 0, null); |
230 | 231 |
|
... | ... | |
253 | 254 |
try { |
254 | 255 |
Params params = (Params) ((ParamStruct) paramsList.get(j)).getFilterParam().clone(); |
255 | 256 |
// A?ado el parametro RenderBands a los parametros del filtro |
256 |
String rgb = layerRaster.getRender().getRenderBands()[0] + " " + layerRaster.getRender().getRenderBands()[1] + " " + layerRaster.getRender().getRenderBands()[2]; |
|
257 |
int[] renderBands = layerRaster.getRender().getRenderColorInterpretation().buildRenderBands(); |
|
258 |
String rgb = renderBands[0] + " " + renderBands[1] + " " + renderBands[2]; |
|
257 | 259 |
params.setParam("RenderBands", rgb, 0, null); |
258 | 260 |
params.setParam("alphaBand", new Integer(layerRaster.getAlphaBandNumber()), 0, null); |
259 | 261 |
|
org.gvsig.raster.tools/branches/org.gvsig.raster.tools_dataaccess_refactoring/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/filter/regionalpha/RegionAlphaFilter.java | ||
---|---|---|
29 | 29 |
import org.gvsig.fmap.dal.coverage.datastruct.Params; |
30 | 30 |
import org.gvsig.fmap.dal.coverage.exception.FilterAddException; |
31 | 31 |
import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter; |
32 |
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation; |
|
33 | 32 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
34 | 33 |
import org.gvsig.raster.fmap.layers.FLyrRaster; |
35 | 34 |
import org.gvsig.raster.roi.ROI; |
... | ... | |
115 | 114 |
/** |
116 | 115 |
* Gets the result of this filter |
117 | 116 |
*/ |
118 |
public Object getResult(String name) { |
|
117 |
/*public Object getResult(String name) {
|
|
119 | 118 |
if (name.equals(RESULT_TRANSPARENCY)) { |
120 | 119 |
ColorInterpretation ci = null; |
121 | 120 |
if(renderBands != null) |
... | ... | |
134 | 133 |
} |
135 | 134 |
|
136 | 135 |
return super.getResult(name); |
137 |
} |
|
136 |
}*/
|
|
138 | 137 |
|
139 | 138 |
public void post() { |
140 | 139 |
} |
org.gvsig.raster.tools/branches/org.gvsig.raster.tools_dataaccess_refactoring/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/raster/process/FilterProcess.java | ||
---|---|---|
113 | 113 |
query.setReadOnly(true); |
114 | 114 |
|
115 | 115 |
//Asignaci?n de bandas |
116 |
int[] renderBands = lyr.getRender().getRenderBands(); |
|
116 |
int[] renderBands = lyr.getRender().getRenderColorInterpretation().buildRenderBands();
|
|
117 | 117 |
if (renderBands != null) { |
118 | 118 |
// Si es gris, se reduce a una sola banda |
119 | 119 |
if ((renderBands.length == 3) && (renderBands[0] == renderBands[1]) && (renderBands[1] == renderBands[2])) |
... | ... | |
231 | 231 |
return rManager.getDataStructFactory().createColorInterpretation( |
232 | 232 |
new String[] { ColorInterpretation.RED_BAND, ColorInterpretation.GREEN_BAND, ColorInterpretation.BLUE_BAND, ColorInterpretation.ALPHA_BAND }); |
233 | 233 |
if(nBands == 2 || nBands > 4) { |
234 |
int[] renderBands = lyr.getRender().getRenderBands(); |
|
234 |
return lyr.getRender().getRenderColorInterpretation(); |
|
235 |
/*int[] renderBands = lyr.getRender().getRenderBands(); |
|
235 | 236 |
String[] ci = new String[renderBands.length]; |
236 | 237 |
for (int i = 0; i < renderBands.length; i++) { |
237 | 238 |
switch (renderBands[i]) { |
... | ... | |
241 | 242 |
default: ci[i] = ColorInterpretation.UNDEF_BAND; |
242 | 243 |
} |
243 | 244 |
} |
244 |
return rManager.getDataStructFactory().createColorInterpretation(ci); |
|
245 |
return rManager.getDataStructFactory().createColorInterpretation(ci);*/
|
|
245 | 246 |
} |
246 | 247 |
} |
247 | 248 |
if(nBands == 1) |
org.gvsig.raster.tools/branches/org.gvsig.raster.tools_dataaccess_refactoring/org.gvsig.raster.tools.algorithm/org.gvsig.raster.tools.algorithm.layerdatatype/src/main/java/org/gvsig/raster/tools/algorithm/layerdatatype/LayerDatatypeProcess.java | ||
---|---|---|
26 | 26 |
import org.gvsig.fmap.dal.coverage.dataset.BufferParam; |
27 | 27 |
import org.gvsig.fmap.dal.coverage.datastruct.NoData; |
28 | 28 |
import org.gvsig.fmap.dal.coverage.exception.BufferCreationException; |
29 |
import org.gvsig.fmap.dal.coverage.exception.CloneException; |
|
30 | 29 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
31 | 30 |
import org.gvsig.fmap.dal.coverage.exception.QueryException; |
32 | 31 |
import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
... | ... | |
49 | 48 |
public static String ADJUST_DEC2INT = "AdjustDec2Int"; |
50 | 49 |
public static String ADJUST_BIG2SMALL = "AdjustBig2Small"; |
51 | 50 |
|
52 |
public static String[] DEC2INT_OPTIONS = new String[]{"Trunk", "Round", |
|
53 |
"Ceil", "Floor"}; |
|
54 |
public static String[] BIG2SMALL_OPTIONS = new String[]{"Trunk", "Maxvalue", |
|
55 |
"NoData"}; |
|
51 |
public static String[] DEC2INT_OPTIONS = new String[]{"Trunk", "Round", "Ceil", "Floor"}; |
|
52 |
public static String[] BIG2SMALL_OPTIONS = new String[]{"Trunk", "Maxvalue", "NoData"}; |
|
56 | 53 |
|
57 | 54 |
private RasterDataStore store = null; |
58 | 55 |
private String filename = null; |
org.gvsig.raster.wms/branches/org.gvsig.raster.wms_dataaccess_refactoring/org.gvsig.raster.wms.app.wmsclient/src/main/java/org/gvsig/raster/wms/app/wmsclient/layer/FLyrWMS.java | ||
---|---|---|
64 | 64 |
import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters; |
65 | 65 |
import org.gvsig.fmap.dal.coverage.store.parameter.RemoteStoreParameters; |
66 | 66 |
import org.gvsig.fmap.dal.coverage.store.parameter.TileDataParameters; |
67 |
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation; |
|
67 | 68 |
import org.gvsig.fmap.dal.exception.DataException; |
68 | 69 |
import org.gvsig.fmap.dal.exception.InitializeException; |
69 | 70 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
... | ... | |
1153 | 1154 |
List<RasterFilter> filters = getRender().getFilterList().getStatusCloned(); |
1154 | 1155 |
|
1155 | 1156 |
//Hacemos una copia de las bandas a renderizar |
1156 |
if(getRender().getRenderBands() != null) { |
|
1157 |
int[] rb = new int[getRender().getRenderBands().length]; |
|
1158 |
for (int i = 0; i < rb.length; i++) |
|
1159 |
rb[i] = getRender().getRenderBands()[i]; |
|
1160 |
newLayer.getRender().setRenderBands(rb); |
|
1157 |
ColorInterpretation ci = getRender().getRenderColorInterpretation(); |
|
1158 |
if(ci != null) { |
|
1159 |
newLayer.getRender().setRenderColorInterpretation(ci.cloneColorInterpretation()); |
|
1161 | 1160 |
} |
1162 | 1161 |
|
1163 | 1162 |
//Asignamos el entorno |
org.gvsig.raster.wms/branches/org.gvsig.raster.wms_dataaccess_refactoring/org.gvsig.raster.wms.io/src/main/java/org/gvsig/raster/wms/io/WMSProvider.java | ||
---|---|---|
275 | 275 |
if(getBandCount() == 3) |
276 | 276 |
colorInterpretation = DataStoreColorInterpretation.createRGBInterpretation(); |
277 | 277 |
if(getBandCount() == 4) |
278 |
colorInterpretation = DataStoreColorInterpretation.createARGBInterpretation();
|
|
278 |
colorInterpretation = DataStoreColorInterpretation.createRGBAInterpretation();
|
|
279 | 279 |
setColorInterpretation(colorInterpretation); |
280 | 280 |
} |
281 | 281 |
return super.getColorInterpretation(); |
org.gvsig.raster.gdal/branches/org.gvsig.raster.gdal_dataaccess_refactoring/org.gvsig.raster.gdal.io/src/main/java/org/gvsig/raster/gdal/io/GdalProvider.java | ||
---|---|---|
235 | 235 |
try { |
236 | 236 |
setParam(storeServices, params); |
237 | 237 |
validRmf(params.getURI()); |
238 |
setFName(translateFileName(params.getURI())); |
|
238 | 239 |
file = new GdalNative(translateFileName(params.getURI())); |
239 | 240 |
setColorInterpretation(file.colorInterpr); |
240 | 241 |
setColorTable(file.palette); |
org.gvsig.raster.ermapper/branches/org.gvsig.raster.ermapper_dataaccess_refactoring/org.gvsig.raster.ermapper.io/src/main/java/org/gvsig/raster/ermapper/io/ErmapperProvider.java | ||
---|---|---|
748 | 748 |
colorInterpr = DataStoreColorInterpretation.createRGBInterpretation(); |
749 | 749 |
} |
750 | 750 |
if(getBandCount() >= 4) { |
751 |
colorInterpr = DataStoreColorInterpretation.createARGBInterpretation();
|
|
751 |
colorInterpr = DataStoreColorInterpretation.createRGBAInterpretation();
|
|
752 | 752 |
} |
753 | 753 |
} |
754 | 754 |
return colorInterpr; |
org.gvsig.raster.tilecache/branches/org.gvsig.raster.tilecache_dataaccess_refactoring/org.gvsig.raster.tilecache.io/src/main/java/org/gvsig/raster/tilecache/io/TileProvider.java | ||
---|---|---|
369 | 369 |
ColorInterpretation ci = provider.getColorInterpretation(); |
370 | 370 |
if(ci != null) { |
371 | 371 |
if(ci.isRGB() || ci.isBGR()) { |
372 |
ci = DataStoreColorInterpretation.createARGBInterpretation();
|
|
372 |
ci = DataStoreColorInterpretation.createRGBAInterpretation();
|
|
373 | 373 |
} else |
374 | 374 |
ci = ci.cloneColorInterpretation(); |
375 | 375 |
} else { |
376 | 376 |
if(provider.getDataType()[0] == Buffer.TYPE_BYTE) { |
377 | 377 |
if(provider.getBandCount() == 3) |
378 |
ci = DataStoreColorInterpretation.createARGBInterpretation();
|
|
378 |
ci = DataStoreColorInterpretation.createRGBAInterpretation();
|
|
379 | 379 |
else |
380 | 380 |
ci = DataStoreColorInterpretation.createDefaultInterpretation(getBandCount()); |
381 | 381 |
} else { |
org.gvsig.raster.lizardtech/branches/org.gvsig.raster.lizardtech_dataaccess_refactoring/org.gvsig.raster.lizardtech.io/src/main/java/org/gvsig/raster/lizardtech/io/LizardTechProvider.java | ||
---|---|---|
471 | 471 |
colorInterpr = DataStoreColorInterpretation.createRGBInterpretation(); |
472 | 472 |
} |
473 | 473 |
if(getBandCount() >= 4) { |
474 |
colorInterpr = DataStoreColorInterpretation.createARGBInterpretation();
|
|
474 |
colorInterpr = DataStoreColorInterpretation.createRGBAInterpretation();
|
|
475 | 475 |
} |
476 | 476 |
} |
477 | 477 |
return colorInterpr; |
org.gvsig.raster.wmts/branches/org.gvsig.raster.wmts_dataaccess_refactoring/org.gvsig.raster.wmts.io/src/main/java/org/gvsig/raster/wmts/io/WMTSProvider.java | ||
---|---|---|
389 | 389 |
colorInterpretation = DataStoreColorInterpretation.createRGBInterpretation(); |
390 | 390 |
|
391 | 391 |
if(getBandCount() == 4) |
392 |
colorInterpretation = DataStoreColorInterpretation.createARGBInterpretation();
|
|
392 |
colorInterpretation = DataStoreColorInterpretation.createRGBAInterpretation();
|
|
393 | 393 |
|
394 | 394 |
if(getBandCount() > 4 || getBandCount() == 2) { |
395 | 395 |
for (int i = 0; i < getBandCount(); i++) { |
org.gvsig.raster.wmts/branches/org.gvsig.raster.wmts_dataaccess_refactoring/org.gvsig.raster.wmts.app.wmtsclient/src/main/java/org/gvsig/raster/wmts/app/wmtsclient/layer/FLyrWMTS.java | ||
---|---|---|
37 | 37 |
import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
38 | 38 |
import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters; |
39 | 39 |
import org.gvsig.fmap.dal.coverage.store.parameter.TileDataParameters; |
40 |
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation; |
|
40 | 41 |
import org.gvsig.fmap.dal.coverage.store.props.Metadata; |
41 | 42 |
import org.gvsig.fmap.dal.exception.DataException; |
42 | 43 |
import org.gvsig.fmap.dal.exception.InitializeException; |
... | ... | |
703 | 704 |
List<RasterFilter> filters = getRender().getFilterList().getStatusCloned(); |
704 | 705 |
|
705 | 706 |
//Hacemos una copia de las bandas a renderizar |
706 |
if(getRender().getRenderBands() != null) { |
|
707 |
int[] rb = new int[getRender().getRenderBands().length]; |
|
708 |
for (int i = 0; i < rb.length; i++) |
|
709 |
rb[i] = getRender().getRenderBands()[i]; |
|
710 |
newLayer.getRender().setRenderBands(rb); |
|
707 |
ColorInterpretation ci = getRender().getRenderColorInterpretation(); |
|
708 |
if(ci != null) { |
|
709 |
newLayer.getRender().setRenderColorInterpretation(ci.cloneColorInterpretation()); |
|
711 | 710 |
} |
712 | 711 |
|
713 | 712 |
//Asignamos el entorno |
org.gvsig.raster.wcs/branches/org.gvsig.raster.wcs_dataaccess_refactoring/org.gvsig.raster.wcs.app.wcsclient/src/main/java/org/gvsig/raster/wcs/app/wcsclient/layer/FLyrWCS.java | ||
---|---|---|
75 | 75 |
import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
76 | 76 |
import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters; |
77 | 77 |
import org.gvsig.fmap.dal.coverage.store.parameter.TileDataParameters; |
78 |
import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation; |
|
78 | 79 |
import org.gvsig.fmap.dal.coverage.store.props.Transparency; |
79 | 80 |
import org.gvsig.fmap.dal.exception.DataException; |
80 | 81 |
import org.gvsig.fmap.dal.exception.InitializeException; |
... | ... | |
471 | 472 |
List<RasterFilter> filters = getRender().getFilterList().getStatusCloned(); |
472 | 473 |
|
473 | 474 |
//Hacemos una copia de las bandas a renderizar |
474 |
if(getRender().getRenderBands() != null) { |
|
475 |
int[] rb = new int[getRender().getRenderBands().length]; |
|
476 |
for (int i = 0; i < rb.length; i++) |
|
477 |
rb[i] = getRender().getRenderBands()[i]; |
|
478 |
layer.getRender().setRenderBands(rb); |
|
479 |
} |
|
475 |
ColorInterpretation ci = getRender().getRenderColorInterpretation(); |
|
476 |
if(ci != null) { |
|
477 |
layer.getRender().setRenderColorInterpretation(ci.cloneColorInterpretation()); |
|
478 |
} |
|
480 | 479 |
|
481 | 480 |
//Asignamos el entorno |
482 | 481 |
if(layer.getRender().getFilterList() == null) |
Also available in: Unified diff