Class FileImageComparator


  • public class FileImageComparator
    extends Object
    Allowes compares images in memory to ones stored in files and compare such images one with another.
    Author:
    Alexandre Iline (alexandre.iline@sun.com)
    • Constructor Detail

      • FileImageComparator

        public FileImageComparator​(ImageComparator comparator,
                                   ImageLoader loader)
        Constructs a FileImageComparator object.
        Parameters:
        comparator - - ImageComparator to be used for image comparision.
        loader - - ImageLoader to be used for image loading.
    • Method Detail

      • compare

        public boolean compare​(BufferedImage image,
                               String fileName)
        Compares an image with one stored in file. Comparision is performed by ImageComparator passed into constructor. Image is loaded by ImageLoader passed into constructor.
        Parameters:
        image - an image to compare.
        fileName - a file containing an image to compare.
        Returns:
        true if images match each other.
      • compare

        public boolean compare​(String fileName1,
                               String fileName2)
        Compares two image stored in files.. Comparision is performed by ImageComparator passed into constructor. Images are loaded by ImageLoader passed into constructor.
        Parameters:
        fileName1 - a file containing an image to compare.
        fileName2 - a file containing an image to compare.
        Returns:
        true if images match each other.