MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / scaleDown

Method scaleDown

ij/src/main/java/ij/gui/HistogramPlot.java:212–219  ·  view source on GitHub ↗

Scales a threshold level to the range 0-255.

(ImageProcessor ip, double threshold)

Source from the content-addressed store, hash-verified

210
211 /** Scales a threshold level to the range 0-255. */
212 int scaleDown(ImageProcessor ip, double threshold) {
213 double min = ip.getMin();
214 double max = ip.getMax();
215 if (max>min)
216 return (int)(((threshold-min)/(max-min))*255.0);
217 else
218 return 0;
219 }
220
221 void drawPlot(long maxCount, ImageProcessor ip) {
222 if (frame == null)

Callers

nothing calls this directly

Calls 2

getMinMethod · 0.45
getMaxMethod · 0.45

Tested by

no test coverage detected