Class DifferenceHash.DHash
- java.lang.Object
-
- dev.brachtendorf.jimagehash.hash.Hash
-
- dev.brachtendorf.jimagehash.hashAlgorithms.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
-
-
Field Summary
-
Fields inherited from class dev.brachtendorf.jimagehash.hash.Hash
algorithmId, hashLength, hashValue
-
-
Constructor Summary
Constructors Constructor Description DHash(Hash h, DifferenceHash.Precision precision, int width, int height)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BufferedImagetoImage(int blockSize)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.BufferedImagetoImage(int[] bitColorIndex, javafx.scene.paint.Color[] colors, int blockSize)Creates a visual representation of the hash mapping the hash values to the section of the rescaled image used to generate the hash.-
Methods inherited from class dev.brachtendorf.jimagehash.hash.Hash
equals, fromFile, getAlgorithmId, getBit, getBitResolution, getBitUnsafe, getHashValue, hammingDistance, hammingDistanceFast, hammingDistanceFast, hashCode, normalizedHammingDistance, normalizedHammingDistanceFast, toByteArray, toFile, toImage, toString
-
-
-
-
Constructor Detail
-
DHash
public DHash(Hash h, DifferenceHash.Precision precision, int width, int height)
-
-
Method Detail
-
toImage
public BufferedImage toImage(int blockSize)
Description copied from class:HashCreates 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 caseHash.toImage(int, HashingAlgorithm)may help to resolve the issue;
-
toImage
public BufferedImage toImage(int[] bitColorIndex, javafx.scene.paint.Color[] colors, int blockSize)
Description copied from class:HashCreates a visual representation of the hash mapping the hash values to the section of the rescaled image used to generate the hash.- Overrides:
toImagein classHash- Parameters:
bitColorIndex- array mapping each bit of the hash to a color of the color arraycolors- array to colorize the pixelsblockSize- 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
-
-