Package org.netbeans.jemmy.image
Class StrictImageComparator
- java.lang.Object
-
- org.netbeans.jemmy.image.StrictImageComparator
-
- All Implemented Interfaces:
ImageComparator
- Direct Known Subclasses:
ColorImageComparator
public class StrictImageComparator extends java.lang.Object implements ImageComparator
Compares two images strictly (i.e. all the pixel colors should match).- Author:
- Alexandre Iline (alexandre.iline@sun.com)
-
-
Constructor Summary
Constructors Constructor Description StrictImageComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
compare(java.awt.image.BufferedImage image1, java.awt.image.BufferedImage image2)
Checks images sizes and pixels.protected boolean
compareColors(int rgb1, int rgb2)
Could be used to override the way of comparing colors.
-
-
-
Method Detail
-
compare
public boolean compare(java.awt.image.BufferedImage image1, java.awt.image.BufferedImage image2)
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.
-
-