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

Method setup

ij/src/main/java/ij/plugin/LUT_Editor.java:120–141  ·  view source on GitHub ↗
(ImagePlus imp)

Source from the content-addressed store, hash-verified

118 }
119
120 public void setup(ImagePlus imp) {
121 if (imp==null) {
122 IJ.noImage();
123 return;
124 }
125 this.imp = imp;
126 bitDepth = imp.getBitDepth();
127 ImageProcessor ip = imp.getChannelProcessor();
128 IndexColorModel cm = (IndexColorModel)ip.getColorModel();
129 origin = cm;
130 mapSize = cm.getMapSize();
131 reds = new byte[256];
132 greens = new byte[256];
133 blues = new byte[256];
134 cm.getReds(reds);
135 cm.getGreens(greens);
136 cm.getBlues(blues);
137 addMouseListener(this);
138 addMouseMotionListener(this);
139 for(int index = 0; index < mapSize; index++)
140 c[index] = new Color(reds[index]&255, greens[index]&255, blues[index]&255);
141 }
142
143 public Dimension getPreferredSize() {
144 return new Dimension(columns*entryWidth, rows*entryHeight);

Callers 1

ColorPanelMethod · 0.95

Calls 9

noImageMethod · 0.95
getColorModelMethod · 0.95
getBitDepthMethod · 0.45
getChannelProcessorMethod · 0.45
getMapSizeMethod · 0.45
getRedsMethod · 0.45
getGreensMethod · 0.45
getBluesMethod · 0.45
addMouseListenerMethod · 0.45

Tested by

no test coverage detected