(String arg, ImagePlus imp)
| 26 | private boolean done; |
| 27 | |
| 28 | public int setup(String arg, ImagePlus imp) { |
| 29 | this.imp = imp; |
| 30 | if (imp!=null) { |
| 31 | bitDepth = imp.getBitDepth(); |
| 32 | Roi roi = imp.getRoi(); |
| 33 | if (roi!=null && roi.isLine()) |
| 34 | roi = null; |
| 35 | overlay = imp.getOverlay(); |
| 36 | if (roi!=null && overlay!=null && Macro.getOptions()==null) { |
| 37 | String msg = "This image has an overlay so the\nselection will be removed."; |
| 38 | if (!IJ.showMessageWithCancel("Rotator", msg)) |
| 39 | return DONE; |
| 40 | imp.deleteRoi(); |
| 41 | } |
| 42 | Rectangle r = roi!=null?roi.getBounds():null; |
| 43 | canEnlarge = r==null || (r.x==0&&r.y==0&&r.width==imp.getWidth()&&r.height==imp.getHeight()); |
| 44 | if (imp.getDisplayMode()==IJ.COMPOSITE) { // setup Undo for composite color stacks |
| 45 | Undo.setup(Undo.TRANSFORM, imp); |
| 46 | flags = flags | NO_UNDO_RESET; |
| 47 | } |
| 48 | Undo.saveOverlay(imp); |
| 49 | if (overlay==null) |
| 50 | overlay = new Overlay(); |
| 51 | } |
| 52 | return flags; |
| 53 | } |
| 54 | |
| 55 | public void run(ImageProcessor ip) { |
| 56 | if (enlarge && gd.wasOKed()) synchronized(this) { |
nothing calls this directly
no test coverage detected