(ImagePlus imp)
| 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); |
no test coverage detected