public final class ImageSimilarity
extends java.lang.Object
CHECKSTYLE:OFF
| Constructor and Description |
|---|
ImageSimilarity(java.io.File expectedFile)
The constructor, which creates the GUI and start the image processing task.
|
| Modifier and Type | Method and Description |
|---|---|
void |
assertSimilarity(java.awt.image.BufferedImage actualImage,
double maxDistance)
Check that the actual image and the image calculated by this object are within the given distance.
|
void |
assertSimilarity(byte[] graphicData,
double maxDistance)
Check that the actual image and the image calculated by this object are within the given distance.
|
void |
assertSimilarity(java.io.File actual)
Check that the actual image and the image calculated by this object are within the given distance.
|
void |
assertSimilarity(java.io.File actualFile,
double maxDistance)
Check that the actual image and the image calculated by this object are within the given distance.
|
void |
assertSimilarity(net.sf.jasperreports.engine.JasperPrint jasperPrint,
java.lang.Integer page,
double maxDistance)
Check that the actual image and the image calculated by this object are within the given distance.
|
void |
assertSimilarity(java.util.List<java.net.URI> graphicFiles,
int width,
int height,
double maxDistance)
Check that the actual image and the image calculated by this object are within the given distance.
|
void |
assertSimilarity(java.net.URI svgFile,
int width,
int height,
double maxDistance)
Check that the actual image and the image calculated by this object are within the given distance.
|
static java.awt.image.BufferedImage |
convertFromSvg(java.net.URI svgFile,
int width,
int height)
Renders an SVG image into a
BufferedImage. |
static java.awt.image.BufferedImage |
exportReportToImage(net.sf.jasperreports.engine.JasperPrint jasperPrint,
java.lang.Integer page)
Exports a rendered
JasperPrint to a BufferedImage. |
static void |
main(java.lang.String[] args) |
static java.awt.image.BufferedImage |
mergeImages(java.util.List<java.net.URI> graphicFiles,
int width,
int height)
Merges a list of graphic files into a single graphic.
|
public ImageSimilarity(java.io.File expectedFile)
throws java.io.IOException
java.io.IOExceptionpublic static java.awt.image.BufferedImage mergeImages(java.util.List<java.net.URI> graphicFiles,
int width,
int height)
throws java.io.IOException,
org.apache.batik.transcoder.TranscoderException
graphicFiles - a list of graphic fileswidth - the graphic width (required for svg files)height - the graphic height (required for svg files)java.io.IOExceptionorg.apache.batik.transcoder.TranscoderExceptionpublic static java.awt.image.BufferedImage convertFromSvg(java.net.URI svgFile,
int width,
int height)
throws org.apache.batik.transcoder.TranscoderException
BufferedImage.org.apache.batik.transcoder.TranscoderExceptionpublic static java.awt.image.BufferedImage exportReportToImage(net.sf.jasperreports.engine.JasperPrint jasperPrint,
java.lang.Integer page)
throws net.sf.jasperreports.engine.JRException
JasperPrint to a BufferedImage.net.sf.jasperreports.engine.JRExceptionpublic static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOExceptionpublic void assertSimilarity(java.io.File actual)
throws java.io.IOException
actual - the image to compare to "this" image.java.io.IOExceptionpublic void assertSimilarity(byte[] graphicData,
double maxDistance)
throws java.io.IOException
maxDistance - the maximum distance between the two images.java.io.IOExceptionpublic void assertSimilarity(java.util.List<java.net.URI> graphicFiles,
int width,
int height,
double maxDistance)
throws java.io.IOException,
org.apache.batik.transcoder.TranscoderException
graphicFiles - a list of graphic fileswidth - the graphic width (required for svg files)height - the graphic height (required for svg files)maxDistance - the maximum distance between the two images.java.io.IOExceptionorg.apache.batik.transcoder.TranscoderExceptionpublic void assertSimilarity(java.net.URI svgFile,
int width,
int height,
double maxDistance)
throws java.io.IOException,
org.apache.batik.transcoder.TranscoderException
maxDistance - the maximum distance between the two images.java.io.IOExceptionorg.apache.batik.transcoder.TranscoderExceptionpublic void assertSimilarity(net.sf.jasperreports.engine.JasperPrint jasperPrint,
java.lang.Integer page,
double maxDistance)
throws java.io.IOException,
net.sf.jasperreports.engine.JRException
maxDistance - the maximum distance between the two images.java.io.IOExceptionnet.sf.jasperreports.engine.JRExceptionpublic void assertSimilarity(java.io.File actualFile,
double maxDistance)
throws java.io.IOException
actualFile - the file to compare to "this" image.maxDistance - the maximum distance between the two images.java.io.IOExceptionpublic void assertSimilarity(java.awt.image.BufferedImage actualImage,
double maxDistance)
throws java.io.IOException
actualImage - the image to compare to "this" image.maxDistance - the maximum distance between the two images.java.io.IOException