Class RoughImageComparator

java.lang.Object
org.netbeans.jemmy.image.RoughImageComparator
All Implemented Interfaces:
ImageComparator

public class RoughImageComparator extends Object implements ImageComparator
Compares two images roughly (i.e. not all of the pixel colors should match).
Author:
Alexandre Iline (alexandre.iline@sun.com)
  • Constructor Details

    • RoughImageComparator

      public RoughImageComparator(double roughness)
      Creates a comparator with roughness allowed roughness.
      Parameters:
      roughness - Allowed comparision roughness.
  • Method Details

    • compare

      public boolean compare(BufferedImage image1, BufferedImage image2)
      Compares two images with allowed roughness.
      Specified by:
      compare in interface ImageComparator
      Parameters:
      image1 - an image to compare.
      image2 - an image to compare.
      Returns:
      true if images have the same sizes and number of unmatching pixels less or equal to image1.getWidth() * image1.getHeight() * roughness