Пример #1
0
  static boolean testSubImage(
      int x0,
      int y0,
      int dx,
      int dy,
      int type,
      int rBits,
      int gBits,
      int bBits,
      int cs,
      BufferedImage gldImage,
      double accuracy) {
    BufferedImage src = ImageFactory.createDCMImage(type, cs);
    BufferedImage subSrc = src.getSubimage(x0, y0, dx, dy);
    BufferedImage dst = ImageFactory.createDstImage(BufferedImage.TYPE_INT_RGB);
    BufferedImage subDst = dst.getSubimage(x0, y0, dx, dy);

    ColorConvertOp op = new ColorConvertOp(null);

    op.filter(subSrc, subDst);

    ImageComparator cmp = new ImageComparator(accuracy, rBits, gBits, bBits);
    boolean result = cmp.compare(subDst, gldImage, x0, y0, dx, dy);
    if (!result) {
      System.err.println(cmp.getStat());
    }
    return result;
  }
Пример #2
0
  static boolean testImage(
      int dataType,
      int rBits,
      int gBits,
      int bBits,
      int cs,
      BufferedImage gldImage,
      double accuracy) {
    BufferedImage src = ImageFactory.createCCMImage(cs, dataType);
    BufferedImage dst = ImageFactory.createDstImage(BufferedImage.TYPE_INT_RGB);
    ColorConvertOp op = new ColorConvertOp(null);
    op.filter(src, dst);

    ImageComparator cmp = new ImageComparator(accuracy, rBits, gBits, bBits);
    boolean result = cmp.compare(gldImage, dst);
    if (!result) {
      System.err.println(cmp.getStat());
    }
    return result;
  }