org.netbeans.jemmy.image
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 Summary |
RoughImageComparator(double roughness)
Creates a comparator with roughness allowed roughness. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RoughImageComparator
public RoughImageComparator(double roughness)
- Creates a comparator with
roughness
allowed roughness.
- Parameters:
roughness
- Allowed comparision roughness.
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