Ejemplo n.º 1
0
 public void drawPixels(ImageProcessor ip) {
   int saveWidth = ip.getLineWidth();
   if (getStrokeWidth() > 1f) ip.setLineWidth((int) Math.round(getStrokeWidth()));
   double offset = getOffset(0.5);
   if (xSpline != null) {
     ip.moveTo(
         x + (int) (Math.round(xSpline[0]) + offset), y + (int) Math.round(ySpline[0] + offset));
     for (int i = 1; i < splinePoints; i++)
       ip.lineTo(
           x + (int) (Math.round(xSpline[i]) + offset), y + (int) Math.round(ySpline[i] + offset));
     if (type == POLYGON || type == FREEROI || type == TRACED_ROI)
       ip.lineTo(
           x + (int) (Math.round(xSpline[0]) + offset), y + (int) Math.round(ySpline[0] + offset));
   } else if (xpf != null) {
     ip.moveTo(x + (int) (Math.round(xpf[0]) + offset), y + (int) Math.round(ypf[0] + offset));
     for (int i = 1; i < nPoints; i++)
       ip.lineTo(x + (int) (Math.round(xpf[i]) + offset), y + (int) Math.round(ypf[i] + offset));
     if (type == POLYGON || type == FREEROI || type == TRACED_ROI)
       ip.lineTo(x + (int) (Math.round(xpf[0]) + offset), y + (int) Math.round(ypf[0] + offset));
   } else {
     ip.moveTo(x + xp[0], y + yp[0]);
     for (int i = 1; i < nPoints; i++) ip.lineTo(x + xp[i], y + yp[i]);
     if (type == POLYGON || type == FREEROI || type == TRACED_ROI) ip.lineTo(x + xp[0], y + yp[0]);
   }
   ip.setLineWidth(saveWidth);
   updateFullWindow = true;
 }
Ejemplo n.º 2
0
 /** Draws an outline of this OvalRoi on the image. */
 public void drawPixels(ImageProcessor ip) {
   Polygon p = getPolygon();
   if (p.npoints > 0) {
     int saveWidth = ip.getLineWidth();
     if (getStrokeWidth() > 1f) ip.setLineWidth((int) Math.round(getStrokeWidth()));
     ip.drawPolygon(p);
     ip.setLineWidth(saveWidth);
   }
   if (Line.getWidth() > 1 || getStrokeWidth() > 1) updateFullWindow = true;
 }