Mercurial > hg > gfx-test
changeset 810:38e1f8d55fde draft
Javadoc for the method diffImages.
author | Pavel Tisnovsky <ptisnovs@redhat.com> |
---|---|
date | Tue, 22 Mar 2016 13:55:37 +0100 |
parents | ab44756e58f8 |
children | 32beb2ec550b |
files | ChangeLog src/org/gfxtest/ImageDiffer/ImageComparator.java |
diffstat | 2 files changed, 16 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Mar 21 11:18:24 2016 +0100 +++ b/ChangeLog Tue Mar 22 13:55:37 2016 +0100 @@ -1,3 +1,8 @@ +2016-03-22 Pavel Tisnovsky <ptisnovs@redhat.com> + + * src/org/gfxtest/ImageDiffer/ImageComparator.java: + Javadoc for the method diffImages. + 2016-03-21 Pavel Tisnovsky <ptisnovs@redhat.com> * src/org/gfxtest/ImageDiffer/ImageComparator.java:
--- a/src/org/gfxtest/ImageDiffer/ImageComparator.java Mon Mar 21 11:18:24 2016 +0100 +++ b/src/org/gfxtest/ImageDiffer/ImageComparator.java Tue Mar 22 13:55:37 2016 +0100 @@ -94,6 +94,14 @@ g.dispose(); } + /** + * Perform the comparison of two images and generate result with arreas containing different pixel values etc. + * + * @param imageFileName + * @param images + * @param configuration + * @return + */ public ComparisonResult diffImages(String imageFileName, BufferedImage[] images, Configuration configuration) { Point min = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE); @@ -104,6 +112,7 @@ int differentPixels = 0; int smallDifferences = 0; int equalPixels = 0; + // new image used to draw difference(s) BufferedImage diffImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); for (int j = 0; j < height; j++) { @@ -132,6 +141,7 @@ } } boolean equalImages = min.x == Integer.MAX_VALUE; + // we found at least one area with different pixels if (!equalImages) { drawRectangleAroundDifferentPixels(configuration, min, max, width, height, diffImage); @@ -141,6 +151,7 @@ min = new Point(-1, -1); max = new Point(-1, -1); } + // generate the comparison result(s) return new ComparisonResult(imageFileName, equalImages, diffImage, min, max, width, height, totalPixels, differentPixels, smallDifferences, equalPixels); }