Package com.vaadin.testbench.screenshot
Class ImageComparisonUtil
- java.lang.Object
-
- com.vaadin.testbench.screenshot.ImageComparisonUtil
-
public class ImageComparisonUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description ImageComparisonUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgenerateImageHash(BufferedImage image)Generates blocks representing an image by dividing the image up in 16x16 pixel blocks and calculating a mean value of the color in each block.static intgetNrBlocks(int pixels)Returns the number of blocks used for the given number of pixels.
-
-
-
Method Detail
-
generateImageHash
public static String generateImageHash(BufferedImage image)
Generates blocks representing an image by dividing the image up in 16x16 pixel blocks and calculating a mean value of the color in each block.- Parameters:
image- the image- Returns:
- the block representation of the image
-
getNrBlocks
public static int getNrBlocks(int pixels)
Returns the number of blocks used for the given number of pixels. All blocks are full size with the (possible) exception of the bottom and right edges.- Parameters:
pixels- The number of pixels for the dimension.- Returns:
- The number of blocks used for that dimension
-
-