Package org.netbeans.jemmy.image
Class StrictImageComparator
java.lang.Object
org.netbeans.jemmy.image.StrictImageComparator
- All Implemented Interfaces:
ImageComparator
- Direct Known Subclasses:
ColorImageComparator
Compares two images strictly (i.e. all the pixel colors should match).
- Author:
- Alexandre Iline (alexandre.iline@sun.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
compare
(BufferedImage image1, BufferedImage image2) Checks images sizes and pixels.protected boolean
compareColors
(int rgb1, int rgb2) Could be used to override the way of comparing colors.
-
Constructor Details
-
StrictImageComparator
public StrictImageComparator()
-
-
Method Details
-
compare
Checks images sizes and pixels. Compares one pixel after another untill one will be different.- Specified by:
compare
in interfaceImageComparator
- Parameters:
image1
- an image to compare.image2
- an image to compare.- Returns:
- True if all the pixels match, false otherwise.
-
compareColors
protected boolean compareColors(int rgb1, int rgb2) Could be used to override the way of comparing colors.- Parameters:
rgb1
- a color to compare.rgb2
- a color to compare.- Returns:
- true if colors are equal.
-