Revision 10996 trunk/libraries/libRaster/src/org/gvsig/raster/dataset/properties/DatasetHistogram.java

View differences:

DatasetHistogram.java
50 50
	 */
51 51
	private RasterDataset				dataset = null;
52 52
	
53
	private int percent = 0;
54
	
53 55
	/**
54 56
	 * Constructor
55 57
	 * @param dataset
......
103 105
	 * @return histograma
104 106
	 */
105 107
	private Histogram getHistogramByValue() throws InvalidSetViewException, FileNotOpenException, RasterDriverException {
108
		percent = 0;
106 109
		if(dataset.getDataType() != IBuffer.TYPE_BYTE)
107 110
			return null;
108 111
		
......
112 115
				byte[] bLine = (byte[])obj;
113 116
				for (int k = 0; k < bLine.length; k++)
114 117
					histogram.incrementPxValue(band, (bLine[k] & 0xff));
118
				percent = ((band * dataset.getHeight() + line) * 100) / (dataset.getBandCount() * dataset.getHeight());
115 119
			}
116 120
		} 
121
		percent = 100;
117 122
		return histogram;
118 123
	}
119 124
	
......
170 175
		} 
171 176
		return histogram;
172 177
	}
178
	
179
	public int getPercent() {
180
		return percent;
181
	}
173 182
}

Also available in: Unified diff