@Override public int getWidth() {return sb.getWidth();}
/** * <p> * Return true if the coordinate is inside the image or false if not.<br> * 0 ≤ x ≤ width<br> * 0 ≤ y ≤ height * </p> * <p>Note: while the image is defined up to width and height, including coordinates up to that point contribute * nothing towards the line integral since they are infinitesimally small.</p> * * @param x x-coordinate in pixel coordinates * @param y y-coordinate in pixel coordinates * @return true if inside or false if outside */ public boolean isInside( double x, double y ) { return x >= 0 && y >= 0 && x <= image.getWidth() && y <= image.getHeight(); }
public static void checkBorderZero(ImageGray outputImage, int border) { GImageGray img = FactoryGImageGray.wrap(outputImage); for (int y = 0; y < img.getHeight(); y++) { if (y >= border && y < img.getHeight() - border) continue; for (int x = 0; x < img.getWidth(); x++) { if (x >= border && x < img.getWidth() - border) continue; if (img.get(x, y).intValue() != 0) throw new RuntimeException("The border is not zero: "+x+" "+y); } } }
public static void checkBorderZero(ImageGray outputImage, int borderX0 , int borderY0 , int borderX1 , int borderY1 ) { GImageGray img = FactoryGImageGray.wrap(outputImage); for (int y = 0; y < img.getHeight(); y++) { if (y >= borderY0 && y < img.getHeight() - borderY1) continue; for (int x = 0; x < img.getWidth(); x++) { if (x >= borderX0 && x < img.getWidth() - borderX1) continue; if (img.get(x, y).intValue() != 0) throw new RuntimeException("The border is not zero: "+x+" "+y); } } }