public void setSnapshotPixels(Object pixels) { record("setSnapshotPixels", pixels, Object.class); proc.setSnapshotPixels(pixels); }
public void setSnapshotPixels(Object pixels) { record("setSnapshotPixels", pixels, Object.class); proc.setSnapshotPixels(pixels); }
/** Frees RAM by setting the snapshot (undo) buffer in the current ImageProcessor to null. */ public void trimProcessor() { ImageProcessor ip2 = ip; if (!locked && ip2!=null) { if (IJ.debugMode) IJ.log(title + ": trimProcessor"); Roi roi2 = getRoi(); if (roi2!=null && roi2.getPasteMode()!=Roi.NOT_PASTING) roi2.endPaste(); ip2.setSnapshotPixels(null); } }
/** Frees RAM by setting the snapshot (undo) buffer in the current ImageProcessor to null. */ public void trimProcessor() { ImageProcessor ip2 = ip; if (!locked && ip2!=null) { if (IJ.debugMode) IJ.log(title + ": trimProcessor"); Roi roi2 = getRoi(); if (roi2!=null && roi2.getPasteMode()!=Roi.NOT_PASTING) roi2.endPaste(); ip2.setSnapshotPixels(null); } }
((PlugInFilter)theFilter).run(ip); ip.setPixels(null); ip.setSnapshotPixels(null); } else if (slicesForThread!=null && slicesForThread.containsKey(thread)) { int[] range = (int[])slicesForThread.get(thread);
((PlugInFilter)theFilter).run(ip); ip.setPixels(null); ip.setSnapshotPixels(null); } else if (slicesForThread!=null && slicesForThread.containsKey(thread)) { int[] range = (int[])slicesForThread.get(thread);
/** Updates this image from the pixel data in its associated ImageProcessor, then displays it. Does nothing if there is no window associated with this image (i.e. show() has not been called).*/ public synchronized void updateAndDraw() { if (stack!=null && !stack.isVirtual() && currentSlice>=1 && currentSlice<=stack.getSize()) { Object pixels = stack.getPixels(currentSlice); if (ip!=null && pixels!=null && pixels!=ip.getPixels()) { // was stack updated? try { ip.setPixels(pixels); ip.setSnapshotPixels(null); } catch(Exception e) {} } } if (win!=null) { win.getCanvas().setImageUpdated(); if (listeners.size()>0) notifyListeners(UPDATED); } draw(); }
/** Updates this image from the pixel data in its associated ImageProcessor, then displays it. Does nothing if there is no window associated with this image (i.e. show() has not been called).*/ public synchronized void updateAndDraw() { if (stack!=null && !stack.isVirtual() && currentSlice>=1 && currentSlice<=stack.getSize()) { Object pixels = stack.getPixels(currentSlice); if (ip!=null && pixels!=null && pixels!=ip.getPixels()) { // was stack updated? try { ip.setPixels(pixels); ip.setSnapshotPixels(null); } catch(Exception e) {} } } if (win!=null) { win.getCanvas().setImageUpdated(); if (listeners.size()>0) notifyListeners(UPDATED); } draw(); }
proc.setSnapshotPixels(null); proc.setSnapshotPixels(snapshot);
static boolean swapImages(ImagePlus imp1, ImagePlus imp2) { if (imp1.getWidth()!=imp2.getWidth() || imp1.getHeight()!=imp2.getHeight() || imp1.getBitDepth()!=imp2.getBitDepth() || IJ.macroRunning()) return false; ImageProcessor ip1 = imp1.getProcessor(); ImageProcessor ip2 = imp2.getProcessor(); double min1 = ip1.getMin(); double max1 = ip1.getMax(); double min2 = ip2.getMin(); double max2 = ip2.getMax(); ip2.setSnapshotPixels(ip1.getPixels()); ip2.swapPixelArrays(); ip1.setPixels(ip2.getSnapshotPixels()); ip2.setSnapshotPixels(null); ip1.setMinAndMax(min2, max2); ip2.setMinAndMax(min1, max1); return true; }
static boolean swapImages(ImagePlus imp1, ImagePlus imp2) { if (imp1.getWidth()!=imp2.getWidth() || imp1.getHeight()!=imp2.getHeight() || imp1.getBitDepth()!=imp2.getBitDepth() || IJ.macroRunning()) return false; ImageProcessor ip1 = imp1.getProcessor(); ImageProcessor ip2 = imp2.getProcessor(); double min1 = ip1.getMin(); double max1 = ip1.getMax(); double min2 = ip2.getMin(); double max2 = ip2.getMax(); ip2.setSnapshotPixels(ip1.getPixels()); ip2.swapPixelArrays(); ip1.setPixels(ip2.getSnapshotPixels()); ip2.setSnapshotPixels(null); ip1.setMinAndMax(min2, max2); ip2.setMinAndMax(min1, max1); return true; }
try { ip.setPixels(pixels); ip.setSnapshotPixels(null); } catch(Exception e) {} } else {
try { ip.setPixels(pixels); ip.setSnapshotPixels(null); } catch(Exception e) {} } else {
ip.setSnapshotPixels(null); // disable undo previousImageID = 0; setup(imp, false);
ip.setSnapshotPixels(null); // disable undo previousImageID = 0; setup(imp, false);