Returns the coordinates of the pixels inside this ROI as a FloatPolygon. @see #getContainedPoints @see #iterator
()
| 791 | * @see #iterator |
| 792 | */ |
| 793 | public FloatPolygon getContainedFloatPoints() { |
| 794 | Roi roi2 = this; |
| 795 | if (isLine()) { |
| 796 | if (getStrokeWidth()<=1) |
| 797 | return roi2.getInterpolatedPolygon(); |
| 798 | else |
| 799 | roi2 = convertLineToArea(this); |
| 800 | } |
| 801 | ImageProcessor mask = roi2.getMask(); |
| 802 | Rectangle bounds = roi2.getBounds(); |
| 803 | FloatPolygon points = new FloatPolygon(); |
| 804 | for (int y=0; y<bounds.height; y++) { |
| 805 | for (int x=0; x<bounds.width; x++) { |
| 806 | if (mask==null || mask.getPixel(x,y)!=0) |
| 807 | points.addPoint((float)(bounds.x+x),(float)(bounds.y+y)); |
| 808 | } |
| 809 | } |
| 810 | return points; |
| 811 | } |
| 812 | |
| 813 | /** |
| 814 | * <pre> |
no test coverage detected