@Override public void fill() { record("fill"); proc.fill(); }
@Override public void fill(ImageProcessor mask) { record("fill", mask, ImageProcessor.class); proc.fill(mask); }
@Override public void fill() { record("fill"); proc.fill(); }
@Override public void fill(ImageProcessor mask) { record("fill", mask, ImageProcessor.class); proc.fill(mask); }
/** Fills the polygon using the ImageProcessor's current drawing color. */ public void fill(ImageProcessor ip, Rectangle r) { ip.fill(getMask(r.width, r.height)); }
/** Fills a rectangle. */ public void fillRect(int x, int y, int width, int height) { setRoi(x, y, width, height); fill(); resetRoi(); }
void drawFilledParticle(ImageProcessor ip, Roi roi, ImageProcessor mask) { ip.setRoi(roi.getBounds()); ip.fill(mask); }
private void drawRoundedRect(ImageProcessor ip) { int margin = (int)getStrokeWidth()/2; BufferedImage bi = new BufferedImage(width+margin*2+1, height+margin*2+1, BufferedImage.TYPE_BYTE_GRAY); Graphics2D g = bi.createGraphics(); if (stroke!=null) g.setStroke(stroke); g.drawRoundRect(margin, margin, width, height, cornerDiameter, cornerDiameter); ByteProcessor mask = new ByteProcessor(bi); ip.setRoi(x-margin, y-margin, width+margin*2+1, height+margin*2+1); ip.fill(mask); }
private void drawRoundedRect(ImageProcessor ip) { int margin = (int)getStrokeWidth()/2; BufferedImage bi = new BufferedImage(width+margin*2+1, height+margin*2+1, BufferedImage.TYPE_BYTE_GRAY); Graphics2D g = bi.createGraphics(); if (stroke!=null) g.setStroke(stroke); g.drawRoundRect(margin, margin, width, height, cornerDiameter, cornerDiameter); ByteProcessor mask = new ByteProcessor(bi); ip.setRoi(x-margin, y-margin, width+margin*2+1, height+margin*2+1); ip.fill(mask); }
/** Fills a polygon. */ public void fillPolygon(Polygon p) { setRoi(p); fill(getMask()); resetRoi(); }
void drawRoiFilledParticle(ImageProcessor ip, Roi roi, ImageProcessor mask, int count) { int grayLevel = (count < 65535) ? count : 65535; ip.setValue((double) grayLevel); ip.setRoi(roi.getBounds()); ip.fill(mask); }
void createHistogramImage(String title) { if (title == null) title = "Histogram Plot"; hist_img = NewImage.createByteImage(title,width,height,1,0); ip = hist_img.getProcessor(); ip.setValue(BACKGROUND); ip.fill(); }
public ImageProcessor expandImage(ImageProcessor ipOld, int wNew, int hNew, int xOff, int yOff) { ImageProcessor ipNew = ipOld.createProcessor(wNew, hNew); if (zeroFill) ipNew.setValue(0.0); else ipNew.setColor(Toolbar.getBackgroundColor()); ipNew.fill(); ipNew.insert(ipOld, xOff, yOff); return ipNew; }
public ImageProcessor expandImage(ImageProcessor ipOld, int wNew, int hNew, int xOff, int yOff) { ImageProcessor ipNew = ipOld.createProcessor(wNew, hNew); if (zeroFill) ipNew.setValue(0.0); else ipNew.setColor(Toolbar.getBackgroundColor()); ipNew.fill(); ipNew.insert(ipOld, xOff, yOff); return ipNew; }
ImageProcessor expand(ImageProcessor ip, boolean hasEdgePixels) { if (hasEdgePixels) { ImageProcessor ip2 = ip.createProcessor(ip.getWidth()+2, ip.getHeight()+2); if (foreground==0) { ip2.setColor(255); ip2.fill(); } ip2.insert(ip, 1, 1); //new ImagePlus("ip2", ip2).show(); return ip2; } else return ip; }
private ImageProcessor createImage_Square10x10 () { ImageProcessor image = new ByteProcessor(30, 30); image.setValue(0); image.fill(); for (int y = 10; y < 20; y++) { for (int x = 10; x < 20; x++) { image.set(x, y, 255); } } return image; } }
private ImageProcessor createImage_Square4x4 () { ImageProcessor image = new ByteProcessor(10, 10); image.setValue(0); image.fill(); for (int y = 3; y < 7; y++) { for (int x = 3; x < 7; x++) { image.set(x, y, 255); } } return image; }
private ImageProcessor createImage_Square4x4 () { ImageProcessor image = new ByteProcessor(10, 10); image.setValue(0); image.fill(); for (int y = 3; y < 7; y++) { for (int x = 3; x < 7; x++) { image.set(x, y, 255); } } return image; }
private ImageProcessor createImage_Square4x4 () { ImageProcessor image = new ByteProcessor(10, 10); image.setValue(0); image.fill(); for (int y = 3; y < 7; y++) { for (int x = 3; x < 7; x++) { image.set(x, y, 255); } } return image; }
private void fillPolygon(ImageProcessor ip, Polygon p, boolean internContour) { PolygonRoi proi = new PolygonRoi(p, PolygonRoi.POLYGON); Rectangle r = proi.getBounds(); PolygonFiller pf = new PolygonFiller(); pf.setPolygon(proi.getXCoordinates(), proi.getYCoordinates(), proi.getNCoordinates()); ip.setRoi(r); ImageProcessor objectMask = pf.getMask(r.width, r.height); ip.fill(objectMask); if(!internContour){ ip.drawPolygon(p); } }