abbot.tester
Class ImageComparator

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


Field Summary
static String IMAGE_SUFFIX
           
 
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 writeImage(File file, BufferedImage img)
           
static void writeJPEG(File file, BufferedImage img)
          Write the given buffered image to disk.
static void writePNG(File file, BufferedImage img)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMAGE_SUFFIX

public static String IMAGE_SUFFIX
Constructor Detail

ImageComparator

public ImageComparator()
Method Detail

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

SourceForge