NumberRange targetRange = TypeMap.getRange(targetType); Category[] categories = new Category[1];
private void handleSampleDimensionType(SampleDimensionType sdType) { // old data dirs upgrading will have this empty if (sdType == null) { // pick the one with the largest domain and be done with it sdType = SampleDimensionType.REAL_64BITS; } final NumberRange<? extends Number> indicativeRange = TypeMap.getRange(sdType); setRange(indicativeRange); }
public HistogramConfig(final SampleModel sampleModel) { final int numBands = sampleModel.getNumBands(); highValues = new double[numBands]; lowValues = new double[numBands]; numBins = new int[numBands]; for (int b = 0; b < numBands; b++) { final NumberRange range = TypeMap.getRange(TypeMap.getSampleDimensionType(sampleModel, b)); int bins; double min = range.getMinimum(true); double max = range.getMaximum(true); if (Double.isInfinite(min) || Double.isInfinite(max) || Double.isNaN(min) || Double.isNaN(max)) { // in this case there is no reasonable default, just use a range // of 0 to 1 as a placeholder min = 0; max = 1; bins = MAX_DEFAULT_NUM_BINS; } else { bins = (int) Math.min(MAX_DEFAULT_NUM_BINS, (max - min) + 1); } lowValues[b] = min; highValues[b] = max; numBins[b] = bins; } }
NumberRange targetRange = TypeMap.getRange(targetType); Category[] categories = new Category[1]; final boolean needScaling; needScaling = !targetRange.contains(TypeMap.getRange(sourceType)); NumberRange sourceRange = TypeMap.getRange(sourceType); for (int b=0; b<numBands; b++) { final Color[] c = colors!=null ? colors[b] : null;
NumberRange targetRange = TypeMap.getRange(targetType); Category[] categories = new Category[1]; final boolean needScaling; needScaling = !targetRange.contains(TypeMap.getRange(sourceType)); NumberRange sourceRange = TypeMap.getRange(sourceType); for (int b=0; b<numBands; b++) { final Color[] c = colors!=null ? colors[b] : null;