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

Method waitForImage

ij/src/main/java/ij/ImagePlus.java:317–340  ·  view source on GitHub ↗
(Image image)

Source from the content-addressed store, hash-verified

315 }
316
317 private void waitForImage(Image image) {
318 if (comp==null) {
319 comp = IJ.getInstance();
320 if (comp==null)
321 comp = new Canvas();
322 }
323 imageLoaded = false;
324 if (!comp.prepareImage(image, this)) {
325 double progress;
326 waitStart = System.currentTimeMillis();
327 while (!imageLoaded && !errorLoadingImage) {
328 IJ.wait(30);
329 if (imageUpdateW>1) {
330 progress = (double)imageUpdateY/imageUpdateW;
331 if (!(progress<1.0)) {
332 progress = 1.0 - (progress-1.0);
333 if (progress<0.0) progress = 0.9;
334 }
335 showProgress(progress);
336 }
337 }
338 showProgress(1.0);
339 }
340 }
341
342 long waitStart;
343 private void showProgress(double percent) {

Callers 1

setImageMethod · 0.95

Calls 3

getInstanceMethod · 0.95
waitMethod · 0.95
showProgressMethod · 0.95

Tested by

no test coverage detected