| 520 | } |
| 521 | |
| 522 | public ImageProcessor getMask() { |
| 523 | ImageProcessor mask = cachedMask; |
| 524 | if (mask!=null && mask.getPixels()!=null) |
| 525 | return mask; |
| 526 | mask = new ByteProcessor(width, height); |
| 527 | double deltaX = getXBase() - x; |
| 528 | double deltaY = getYBase() - y; |
| 529 | for (int i=0; i<nPoints; i++) |
| 530 | mask.putPixel((int)Math.round(xpf[i] + deltaX), (int)Math.round(ypf[i] + deltaY), 255); |
| 531 | cachedMask = mask; |
| 532 | return mask; |
| 533 | } |
| 534 | |
| 535 | /** Returns true if (x,y) is one of the points in this collection. */ |
| 536 | public boolean contains(int x, int y) { |