abbot.tester
Class ImageComparator
java.lang.Object
abbot.tester.ImageComparator
- All Implemented Interfaces:
- Comparator
public class ImageComparator
- extends Object
- implements Comparator
This code expects the availability of the com.sun.image.codec.jpeg
extensions from the Sun JDK 1.3 or JRE.
Original comparison code contributed by asmithmb.
author: asmithmontebello@aol.com, twall
IMAGE_SUFFIX
public static String IMAGE_SUFFIX
ImageComparator
public ImageComparator()
writeImage
public static void writeImage(File file,
BufferedImage img)
throws IOException
- Throws:
IOException
writePNG
public static void writePNG(File file,
BufferedImage img)
throws IOException
- Throws:
IOException
writeJPEG
public static void writeJPEG(File file,
BufferedImage img)
throws IOException
- Write the given buffered image to disk.
- Throws:
IOException
compare
public int compare(Object obj1,
Object obj2)
- Compare two images. May be BufferedImages or File arguments.
- Specified by:
compare
in interface Comparator
equals
public boolean equals(Object obj)
- Comparators are equal if they're the same class.
- Specified by:
equals
in interface Comparator
- Overrides:
equals
in class Object
Copyright © 2002-2008 Timothy Wall. All Rights Reserved.
Abbot is hosted on