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

Method setMode

ij/src/main/java/ij/CompositeImage.java:520–547  ·  view source on GitHub ↗
(int mode)

Source from the content-addressed store, hash-verified

518 }
519
520 public synchronized void setMode(int mode) {
521 if (mode<COMPOSITE || mode>GRAYSCALE)
522 return;
523 if (mode==COMPOSITE && getNChannels()>MAX_CHANNELS)
524 mode = COLOR;
525 if (!(mode==COMPOSITE && mode==this.mode)) {
526 for (int i=0; i<MAX_CHANNELS; i++)
527 active[i] = true;
528 }
529 if (this.mode!=COMPOSITE && mode==COMPOSITE)
530 img = null;
531 this.mode = mode;
532 if (mode==COLOR || mode==GRAYSCALE) {
533 if (cip!=null) {
534 for (int i=0; i<cip.length; i++) {
535 if (cip[i]!=null) cip[i].setPixels(null);
536 cip[i] = null;
537 }
538 }
539 cip = null;
540 rgbPixels = null;
541 awtImage = null;
542 currentChannel = -1;
543 }
544 if (mode==GRAYSCALE || mode==TRANSPARENT)
545 ip.setColorModel(ip.getDefaultColorModel());
546 Channels.updateChannels();
547 }
548
549 public int getMode() {
550 return mode;

Callers 11

copyLutsMethod · 0.95
resetMethod · 0.95
showLutMethod · 0.95
mergeStacksMethod · 0.95
convertStackToBinaryMethod · 0.95
runMethod · 0.95
runMethod · 0.95
itemStateChangedMethod · 0.95
setDisplayModeMethod · 0.45
setImageMethod · 0.45

Calls 5

updateChannelsMethod · 0.95
getDefaultColorModelMethod · 0.80
getNChannelsMethod · 0.45
setPixelsMethod · 0.45
setColorModelMethod · 0.45

Tested by

no test coverage detected