private T ensureMaxValueOfOne(T input, double maxPixelValue) { T adjusted; if( maxPixelValue < 0 ) { maxPixelValue = GImageStatistics.max(input); } if( maxPixelValue != 1.0f ) { adjusted = this.adjusted; GPixelMath.divide(input, maxPixelValue, adjusted); } else { adjusted = input; } return adjusted; }