abbot.tester
Class ImageComparator

java.lang.Object
  extended byabbot.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


Constructor Summary
ImageComparator()
           
 
Method Summary
 int compare(Object obj1, Object obj2)
          Compare two images.
 boolean equals(Object obj)
          Comparators are equal if they're the same class.
static void writeJPEG(File file, BufferedImage img)
          Write the given buffered image to disk.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageComparator

public ImageComparator()
Method Detail

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


Copyright © 2002-2004 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge