Package com.vaadin.testbench.screenshot
Class ImageComparisonUtil
java.lang.Object
com.vaadin.testbench.screenshot.ImageComparisonUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static int
getNrBlocks
(int pixels) Returns the number of blocks used for the given number of pixels.
-
Constructor Details
-
ImageComparisonUtil
public ImageComparisonUtil()
-
-
Method Details
-
generateImageHash
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
-