Class DifferenceHash.DHash

  • All Implemented Interfaces:
    Serializable
    Enclosing class:
    DifferenceHash

    public static class DifferenceHash.DHash
    extends Hash
    An extended hash class allowing dhashes to be visually represented.
    Since:
    3.0.0
    Author:
    Kilian
    See Also:
    Serialized Form
    • Method Detail

      • toImage

        public BufferedImage toImage​(int blockSize)
        Description copied from class: Hash
        Creates a visual representation of the hash mapping the hash values to the section of the rescaled image used to generate the hash assuming default bit encoding.

        Some hash algorithms may chose to construct their hashes in a non default manner (e.g. DifferenceHash). In this case Hash.toImage(int, HashingAlgorithm) may help to resolve the issue;

        Overrides:
        toImage in class Hash
        Parameters:
        blockSize - scaling factor of each pixel in the has. each bit of the hash will be represented to blockSize*blockSize pixels
        Returns:
        A black and white image representing the individual bits of the hash
      • toImage

        public BufferedImage toImage​(int[] bitColorIndex,
                                     javafx.scene.paint.Color[] colors,
                                     int blockSize)
        Description copied from class: Hash
        Creates a visual representation of the hash mapping the hash values to the section of the rescaled image used to generate the hash.
        Overrides:
        toImage in class Hash
        Parameters:
        bitColorIndex - array mapping each bit of the hash to a color of the color array
        colors - array to colorize the pixels
        blockSize - scaling factor of each pixel in the has. each bit of the hash will be represented to blockSize*blockSize pixels
        Returns:
        A colorized image representing the individual bits of the hash