Revision 859 org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/BufferHistogramImpl.java

View differences:

BufferHistogramImpl.java
25 25
import org.gvsig.fmap.dal.coverage.dataset.Buffer;
26 26
import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
27 27
import org.gvsig.fmap.dal.coverage.datastruct.HistogramClass;
28
import org.gvsig.fmap.dal.coverage.datastruct.NoData;
28 29
import org.slf4j.LoggerFactory;
29 30
/**
30 31
 * Representa un histograma.
......
43 44
	private long[][]           table       = null;
44 45
	private double[]           min         = null;
45 46
	private double[]           max         = null;
46
	private double             noDataValue = RasterLibrary.defaultNoDataValue;
47
	private NoData             noDataValue = null;
47 48
	private int                dataType    = Buffer.TYPE_UNDEFINED;
48 49
	
49 50
	private int                nClasses    = 0;
......
332 333
		if (Double.isNaN(px))
333 334
			return;
334 335

  
335
		if (px == noDataValue)
336
			return;
336
		if (noDataValue != null && noDataValue.isDefined()) {
337
			switch (dataType) {
338
			case Buffer.TYPE_BYTE:
339
				if(((byte)px) == noDataValue.getValue().byteValue())
340
						return;
341
				break;
342
			case Buffer.TYPE_SHORT:
343
				if(((short)px) == noDataValue.getValue().shortValue())
344
					return;
345
				break;
346
			case Buffer.TYPE_INT:
347
				if(((int)px) == noDataValue.getValue().intValue())
348
					return;
349
				break;
350
			case Buffer.TYPE_FLOAT:
351
				if(((float)px) == noDataValue.getValue().floatValue())
352
					return;
353
				break;
354
			case Buffer.TYPE_DOUBLE:
355
				if(((double)px) == noDataValue.getValue().doubleValue())
356
					return;
357
				break;
358
			}
359
		}
360
			
337 361

  
338 362
		int pos = (int) (((nClasses - 1) * (px - min[band])) / (max[band] - min[band]));
339 363

  
......
593 617
	/**
594 618
	 * @param noDataValue the noDataValue to set
595 619
	 */
596
	public void setNoDataValue(double noDataValue) {
620
	public void setNoDataValue(NoData noDataValue) {
597 621
		this.noDataValue = noDataValue;
598 622
	}
599 623
}

Also available in: Unified diff