(ImageProcessor ip)
| 1537 | } |
| 1538 | |
| 1539 | private void drawRoundedRect(ImageProcessor ip) { |
| 1540 | int margin = (int)getStrokeWidth()/2; |
| 1541 | BufferedImage bi = new BufferedImage(width+margin*2+1, height+margin*2+1, BufferedImage.TYPE_BYTE_GRAY); |
| 1542 | Graphics2D g = bi.createGraphics(); |
| 1543 | if (stroke!=null) |
| 1544 | g.setStroke(stroke); |
| 1545 | g.drawRoundRect(margin, margin, width, height, cornerDiameter, cornerDiameter); |
| 1546 | ByteProcessor mask = new ByteProcessor(bi); |
| 1547 | ip.setRoi(x-margin, y-margin, width+margin*2+1, height+margin*2+1); |
| 1548 | ip.fill(mask); |
| 1549 | } |
| 1550 | |
| 1551 | /** Returns whether the center of pixel (x,y) is contained in the Roi. |
| 1552 | * The position of a pixel center determines whether a pixel is selected. |
no test coverage detected