org.apache.batik.apps.regard
Class Main

java.lang.Object
  |
  +--org.apache.batik.apps.regard.Main

public class Main
extends java.lang.Object

A diffing tool.


Constructor Summary
Main()
           
 
Method Summary
static java.lang.String computeTimeStamp()
           
static void diffBufferedImage(java.awt.image.Raster ref, java.awt.image.Raster cmp, java.awt.image.Raster diff)
          This is the core method to calculate the difference of the two input images and save the comparison into the output image
static void diffImage()
          DIFFERENCE Diffs the images from the 'ref' and the 'new' directories.
static boolean diffImage(java.lang.String refInputURI, java.lang.String newInputURI)
          Returns true if the specified images are the same, false otherwise.
static void display(java.lang.String msg)
          Display the specified message.
static void error(java.lang.String msg)
          Display the specified error message.
static void exit(int code)
          Exits the application with the specified code.
static void generateNewImages()
          NEW IMAGES Generates the new images using the SVG files from the 'svg' directory.
static void generateRefImages()
          REFERENCE Generates the reference images using the SVG files from the 'svg' directory.
static void generateReport()
           
static void generateReport(java.io.File[] refImages, int[] badIndex, int bi)
           
static java.lang.String getDiffDirectory()
          Returns the directory where the difference images are stored.
static java.lang.String getNewDirectory()
          Returns the directory where the new images are stored.
static java.lang.String getRefDirectory()
          Returns the directory where the reference images are stored.
static java.lang.String getSamplesDirectory()
          Returns the directory where the SVG samples are stored.
static Transcoder getTranscoder()
          Returns the transcoder to use.
static void init()
          INITILIZATION Creates the regard directory and its three sub directory if needed.
static void main(java.lang.String[] args)
          MAIN
static void reset()
          RESET Removes the reference images.
static void usage(java.io.PrintStream out)
          Shows the usage message.
static void writeImage(Transcoder transcoder, java.lang.String inputURI, java.lang.String output)
          Writes an image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Main

public Main()
Method Detail

main

public static void main(java.lang.String[] args)
MAIN

init

public static void init()
INITILIZATION Creates the regard directory and its three sub directory if needed.

reset

public static void reset()
RESET Removes the reference images.

generateRefImages

public static void generateRefImages()
REFERENCE Generates the reference images using the SVG files from the 'svg' directory.

generateNewImages

public static void generateNewImages()
NEW IMAGES Generates the new images using the SVG files from the 'svg' directory.

diffImage

public static void diffImage()
DIFFERENCE Diffs the images from the 'ref' and the 'new' directories.

generateReport

public static void generateReport()

generateReport

public static void generateReport(java.io.File[] refImages,
                                  int[] badIndex,
                                  int bi)

diffBufferedImage

public static void diffBufferedImage(java.awt.image.Raster ref,
                                     java.awt.image.Raster cmp,
                                     java.awt.image.Raster diff)
This is the core method to calculate the difference of the two input images and save the comparison into the output image
Parameters:
ref - the reference image in BufferedImage
new - the new image in BufferedImage
diff - the difference image in BufferedImage

computeTimeStamp

public static java.lang.String computeTimeStamp()

writeImage

public static void writeImage(Transcoder transcoder,
                              java.lang.String inputURI,
                              java.lang.String output)
Writes an image.
Parameters:
transcoder - the transcoder to use to generate the image
inputURI - the URI of the SVG file
outputURI - the URI of the image to generate

diffImage

public static boolean diffImage(java.lang.String refInputURI,
                                java.lang.String newInputURI)
Returns true if the specified images are the same, false otherwise.
Parameters:
refInputURI - the reference image
newInputURI - the new produced image

getTranscoder

public static Transcoder getTranscoder()
Returns the transcoder to use.

error

public static void error(java.lang.String msg)
Display the specified error message.
Parameters:
msg - the error message to display

display

public static void display(java.lang.String msg)
Display the specified message.
Parameters:
msg - the message to display

usage

public static void usage(java.io.PrintStream out)
Shows the usage message.
Parameters:
out - the stream where to write the usage message

exit

public static void exit(int code)
Exits the application with the specified code.
Parameters:
code - the exit code

getRefDirectory

public static java.lang.String getRefDirectory()
Returns the directory where the reference images are stored.

getNewDirectory

public static java.lang.String getNewDirectory()
Returns the directory where the new images are stored.

getSamplesDirectory

public static java.lang.String getSamplesDirectory()
Returns the directory where the SVG samples are stored.

getDiffDirectory

public static java.lang.String getDiffDirectory()
Returns the directory where the difference images are stored.


Copyright © 2000 Apache Software Foundation. All Rights Reserved.