(int x, int y)
| 303 | |
| 304 | // get a pixel value; returns Float.NaN if outside the field. |
| 305 | private float getPixel(int x, int y) { |
| 306 | if (x<0 || x>=width || y<0 || y>=height) |
| 307 | return Float.NaN; |
| 308 | if (bpixels!=null) |
| 309 | return bpixels[y*width + x] & 0xff; |
| 310 | else if (spixels!=null) |
| 311 | return spixels[y*width + x] & 0xffff; |
| 312 | else if (fpixels!=null) |
| 313 | return fpixels[y*width + x]; |
| 314 | else if (exactPixelValue) //RGB for exact match |
| 315 | return cpixels[y*width + x] & 0xffffff; //don't care for upper byte |
| 316 | else //gray value of RGB |
| 317 | return ip.getPixelValue(x,y); |
| 318 | } |
| 319 | |
| 320 | /* Are we tracing a one pixel wide line? Makes Legacy mode 8-connected instead of 4-connected */ |
| 321 | private boolean isLine(int xs, int ys) { |
no test coverage detected