Example #1
0
  public static void checkBorderZero(ImageSingleBand outputImage, int border) {
    GImageSingleBand img = FactoryGImageSingleBand.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);
      }
    }
  }