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

Method resize

ij/src/main/java/ij/plugin/LUT_Editor.java:311–330  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

309 }
310
311 void resize() {
312 GenericDialog sgd = new GenericDialog("LUT Editor");
313 sgd.addNumericField("Number of Colors:", mapSize, 0);
314 sgd.addChoice("Scale Using:", choices, scaleMethod);
315 sgd.showDialog();
316 if (sgd.wasCanceled()){
317 cancelLUT();
318 return;
319 }
320 int newSize = (int)sgd.getNextNumber();
321 if (newSize<2) newSize = 2;
322 if (newSize>256) newSize =256;
323 scaleMethod = sgd.getNextChoice();
324 scale(reds, greens, blues, newSize);
325 mapSize = newSize;
326 for(int i=0; i<mapSize; i++)
327 c[i] = new Color(reds[i]&255, greens[i]&255, blues[i]&255);
328 applyLUT();
329 repaint();
330 }
331
332 void scale(byte[] reds, byte[] greens, byte[] blues, int newSize) {
333 if (newSize==mapSize)

Callers 1

actionPerformedMethod · 0.45

Calls 10

addNumericFieldMethod · 0.95
addChoiceMethod · 0.95
showDialogMethod · 0.95
wasCanceledMethod · 0.95
cancelLUTMethod · 0.95
getNextNumberMethod · 0.95
getNextChoiceMethod · 0.95
scaleMethod · 0.95
applyLUTMethod · 0.95
repaintMethod · 0.45

Tested by

no test coverage detected