Revision 33221 trunk/libraries/libRaster/src/org/gvsig/raster/grid/filter/enhancement/LinearStretchParams.java

View differences:

LinearStretchParams.java
175 175
		public void setMaxMin(DatasetListStatistics stats, int band, boolean rgb) {
176 176
			try {
177 177
				if (rgb) {
178
					if (stats.getMinRGB() != null)
179
						minValue = stats.getMinRGB()[band];
180
					if (stats.getMaxRGB() != null)
181
						maxValue = stats.getMaxRGB()[band];
178
					if (stats.getMinByteUnsigned() != null)
179
						minValue = stats.getMinByteUnsigned()[band];
180
					if (stats.getMaxByteUnsigned() != null)
181
						maxValue = stats.getMaxByteUnsigned()[band];
182 182
				} else {
183 183
					if (stats.getMin() != null) {
184 184
						minValue = stats.getMin()[band];
......
206 206
				return;
207 207
			try {
208 208
				if(rgb) {
209
					if(stats.getSecondMinRGB() != null)
210
						stretchIn[0] = minValue = stats.getSecondMinRGB()[band];
211
					if(stats.getSecondMaxRGB() != null)
212
						stretchIn[stretchIn.length - 1] = maxValue = stats.getSecondMaxRGB()[band];
209
					if(stats.getSecondMinByteUnsigned() != null)
210
						stretchIn[0] = minValue = stats.getSecondMinByteUnsigned()[band];
211
					if(stats.getSecondMaxByteUnsigned() != null)
212
						stretchIn[stretchIn.length - 1] = maxValue = stats.getSecondMaxByteUnsigned()[band];
213 213
				} else {
214 214
					if(stats.getSecondMin() != null)
215 215
						stretchIn[0] = minValue = stats.getSecondMin()[band];
......
343 343
		}
344 344
		if (renderBands[0] >= 0) {
345 345
			if (rgb)
346
				leParams.red.stretchIn = new double[] { stats.getMinRGB()[0], stats.getMaxRGB()[0] };
346
				leParams.red.stretchIn = new double[] { stats.getMinByteUnsigned()[0], stats.getMaxByteUnsigned()[0] };
347 347
			else
348 348
				leParams.red.stretchIn = new double[] { stats.getMin()[renderBands[0]], stats.getMax()[renderBands[0]] };
349 349
		}
......
352 352
		leParams.red.tailTrimMax = tailTrim;
353 353
		if (renderBands[1] >= 0) {
354 354
			if (rgb)
355
				leParams.green.stretchIn = new double[] { stats.getMinRGB()[0], stats.getMaxRGB()[0] };
355
				leParams.green.stretchIn = new double[] { stats.getMinByteUnsigned()[0], stats.getMaxByteUnsigned()[0] };
356 356
			else
357 357
				leParams.green.stretchIn = new double[] { stats.getMin()[renderBands[1]], stats.getMax()[renderBands[1]] };
358 358
		}
......
361 361
		leParams.green.tailTrimMax = tailTrim;
362 362
		if (renderBands[2] >= 0) {
363 363
			if (rgb)
364
				leParams.blue.stretchIn = new double[] { stats.getMinRGB()[0], stats.getMaxRGB()[0] };
364
				leParams.blue.stretchIn = new double[] { stats.getMinByteUnsigned()[0], stats.getMaxByteUnsigned()[0] };
365 365
			else
366 366
				leParams.blue.stretchIn = new double[] { stats.getMin()[renderBands[2]], stats.getMax()[renderBands[2]] };
367 367
		}

Also available in: Unified diff