public final class ImageSimilarity
extends java.lang.Object
| Constructor and Description |
|---|
ImageSimilarity(java.awt.image.BufferedImage referenceImage,
int sampleSize) |
ImageSimilarity(java.io.File referenceImage,
int sampleSize)
The constructor, which creates the GUI and start the image processing task.
|
| Modifier and Type | Method and Description |
|---|---|
void |
assertSimilarity(java.io.File other,
double maxDistance)
Check that the other 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 void |
exportReportToFile(net.sf.jasperreports.engine.JasperPrint jasperPrint,
java.lang.String fileName,
java.lang.Integer page)
Exports a rendered
JasperPrint to a graphics file. |
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.
|
static void |
writeUncompressedImage(java.awt.image.BufferedImage image,
java.lang.String file)
Write the image to a file in uncompressed tiff format.
|
public ImageSimilarity(java.io.File referenceImage,
int sampleSize)
throws java.io.IOException
java.io.IOExceptionpublic ImageSimilarity(java.awt.image.BufferedImage referenceImage,
int sampleSize)
throws java.io.IOException
java.io.IOExceptionpublic void assertSimilarity(java.io.File other,
double maxDistance)
throws java.io.IOException
other - the image to compare to "this" image.maxDistance - the maximum distance between the two images.java.io.IOExceptionpublic static void writeUncompressedImage(java.awt.image.BufferedImage image,
java.lang.String file)
throws java.io.IOException
image - image to writefile - path and file name (extension will be ignored and changed to tiff.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)org.apache.batik.transcoder.TranscoderExceptionjava.io.IOExceptionpublic 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 java.lang.Exception
JasperPrint to a BufferedImage.java.lang.Exceptionpublic static void exportReportToFile(net.sf.jasperreports.engine.JasperPrint jasperPrint,
java.lang.String fileName,
java.lang.Integer page)
throws java.lang.Exception
JasperPrint to a graphics file.java.lang.Exceptionpublic static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOException