| 267 | |
| 268 | // add a point x,y to the outline polygon |
| 269 | private void addPoint (int x, int y) { |
| 270 | if (npoints==maxPoints) { |
| 271 | int[] xtemp = new int[maxPoints*2]; |
| 272 | int[] ytemp = new int[maxPoints*2]; |
| 273 | System.arraycopy(xpoints, 0, xtemp, 0, maxPoints); |
| 274 | System.arraycopy(ypoints, 0, ytemp, 0, maxPoints); |
| 275 | xpoints = xtemp; |
| 276 | ypoints = ytemp; |
| 277 | maxPoints *= 2; |
| 278 | } |
| 279 | xpoints[npoints] = x; |
| 280 | ypoints[npoints] = y; |
| 281 | npoints++; |
| 282 | if (xmin > x) xmin = x; |
| 283 | } |
| 284 | |
| 285 | // check pixel at (x,y), whether it is inside traced area |
| 286 | private boolean inside(int x, int y) { |