public class ImageDiff extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
writeDiff |
static boolean |
writeImage |
static boolean |
writeInfo |
Constructor and Description |
---|
ImageDiff(BufferedImage i1,
BufferedImage i2,
String fileBase,
long allowedDiff)
Compares two images, i1 and i2, writing information out to fileBase about the
differences.
|
Modifier and Type | Method and Description |
---|---|
protected int |
colourDiff(int c1,
int c2)
Returns the difference in the colour component
|
protected int |
colourDiffPixel(int c1,
int c2)
Returns a pixel representing the difference in the colour component
|
protected void |
computeDiffs(BufferedImage i1,
BufferedImage i2,
BufferedImage i3) |
long |
getMaxDiff() |
long |
getPixelCount() |
long |
getSumDifference() |
long |
getSumSqrDifference() |
protected int |
grayDiffPixel(int diff)
Returns a gray pixel diff
|
public static boolean writeImage
public static boolean writeDiff
public static boolean writeInfo
public ImageDiff(BufferedImage i1, BufferedImage i2, String fileBase, long allowedDiff) throws IOException
i1
- - this is typically the "correct" image.i2
- - this is typically the image you are testing.fileBase
- - this is the location to use for saving filesallowedDiff
- - this is the amount of difference, per pixel that is allowed.IOException
protected void computeDiffs(BufferedImage i1, BufferedImage i2, BufferedImage i3)
protected int colourDiff(int c1, int c2)
protected int colourDiffPixel(int c1, int c2)
protected int grayDiffPixel(int diff)
public long getMaxDiff()
public long getPixelCount()
public long getSumDifference()
public long getSumSqrDifference()
Copyright © 2016. All rights reserved.