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

Method updateImage

ij/src/main/java/ij/CompositeImage.java:212–341  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

210 * LUTs or the display mode.
211 */
212 @Override
213 public synchronized void updateImage() {
214 int imageSize = width*height;
215 int nChannels = getNChannels();
216 int redValue, greenValue, blueValue;
217 int ch = getChannel();
218
219 //IJ.log("updateImage: "+ch+"/"+nChannels+" "+currentSlice+" "+currentFrame);
220 if (ch>nChannels) ch = nChannels;
221 boolean newChannel = false;
222 if (ch-1!=currentChannel) {
223 previousChannel = currentChannel;
224 currentChannel = ch-1;
225 newChannel = true;
226 }
227
228 ImageProcessor ip = getProcessor();
229 if (mode!=COMPOSITE) {
230 if (newChannel) {
231 setupLuts(nChannels);
232 LUT cm = lut[currentChannel];
233 if (ip!=null && !(ip instanceof ColorProcessor)) {
234 if (mode==COLOR)
235 ip.setLut(cm);
236 if (!(cm.min==0.0&&cm.max==0.0))
237 ip.setMinAndMax(cm.min, cm.max);
238 }
239 if (!IJ.isMacro()) ContrastAdjuster.update();
240 for (int i=0; i<MAX_CHANNELS; i++)
241 active[i] = i==currentChannel?true:false;
242 Channels.updateChannels();
243 }
244 if (ip!=null)
245 img = ip.createImage();
246 return;
247 }
248
249 if (nChannels==1) {
250 cip = null;
251 rgbPixels = null;
252 awtImage = null;
253 if (ip!=null)
254 img = ip.createImage();
255 return;
256 }
257
258 if (cip==null||cip[0].getWidth()!=width||cip[0].getHeight()!=height||getBitDepth()!=bitDepth) {
259 setup(nChannels, getImageStack());
260 rgbPixels = null;
261 rgbSampleModel = null;
262 if (currentChannel>=nChannels) {
263 setSlice(1);
264 currentChannel = 0;
265 newChannel = true;
266 }
267 bitDepth = getBitDepth();
268 }
269

Callers 2

getImageMethod · 0.95
updateAndDrawMethod · 0.95

Calls 15

getProcessorMethod · 0.95
setupLutsMethod · 0.95
setLutMethod · 0.95
setMinAndMaxMethod · 0.95
isMacroMethod · 0.95
updateMethod · 0.95
updateChannelsMethod · 0.95
createImageMethod · 0.95
setupMethod · 0.95
getMinMethod · 0.95
getMaxMethod · 0.95
makeInvertedCompositeMethod · 0.95

Tested by

no test coverage detected