MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getMask

Method getMask

ij/src/main/java/ij/gui/PointRoi.java:522–533  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 5

getPixelsMethod · 0.95
putPixelMethod · 0.95
getXBaseMethod · 0.80
getYBaseMethod · 0.80
roundMethod · 0.45

Tested by

no test coverage detected