Class ImageConfiguration

java.lang.Object
com.deltaxml.core.config.image.ImageConfiguration

public class ImageConfiguration extends Object
`* Specifies configuration options for Binary Image comparison. These configuration options can be specified on a DocumentComparator to configure its behavior when comparing binary images, like PNGs, JPEGs, etc. If input files contain referenced binary images it is recommended to enable this feature and specify their locations in the file using the XPath setting. Additionally, If the referenced images are SVG @see SVGConfiguration as it can provide more granular change representation.
Since:
17.0
  • Constructor Details

    • ImageConfiguration

      public ImageConfiguration()
      Initializes a new empty ImageConfiguration instance with no XPaths specified.
    • ImageConfiguration

      public ImageConfiguration(String imageXPath)
      Initializes a new ImageConfiguration instance with the provided String of XPaths.
      Parameters:
      imageXPath - is a String of XPaths to referenced binary images, using the union operator to separate them.
      Throws:
      IllegalArgumentException - if passed imageXPath is invalid.
    • ImageConfiguration

      public ImageConfiguration(String imageXPath, ImageComparisonGranularity imageComparisonGranularity, String inputAMarkupStyle, String inputBMarkupStyle)
      Initializes a new ImageConfiguration instance with the provided String of XPaths, inputAMarkupStyle, inputBMarkupStyle, imageComparisonGranularity.
      Parameters:
      imageXPath - is a String of XPaths to referenced binary images, using the union operator to separate them.
      imageComparisonGranularity - an instance of ImageComparisonGranularity
      inputAMarkupStyle - input A markup style
      inputBMarkupStyle - input B markup style
      Throws:
      IllegalArgumentException - if passed imageXPath is invalid.
    • ImageConfiguration

      public ImageConfiguration(String imageXPath, ImageComparisonGranularity imageComparisonGranularity)
      Initializes a new ImageConfiguration instance with the provided String of XPaths, inputAMarkupStyle, inputBMarkupStyle, imageComparisonGranularity.
      Parameters:
      imageXPath - is a String of XPaths to referenced binary images, using the union operator to separate them.
      imageComparisonGranularity - an instance of ImageComparisonGranularity
      Throws:
      IllegalArgumentException - if passed imageXPath is invalid.
  • Method Details

    • setEnabled

      public void setEnabled(boolean isEnabled)
      `* Sets whether to use Binary Image comparison.
      Parameters:
      isEnabled - sets whether to use binary image comparison.
    • isEnabled

      public boolean isEnabled()
      Gets whether Binary Image comparison is enabled.
      Returns:
      a boolean showing whether Binary Image comparison is enabled.
    • setImageXPath

      public void setImageXPath(String imageXPath)
      Sets the XPath to the referenced binary image. To provide more than one XPath the union operator can be used, for example *:img/@src | *:image/@href.
      Parameters:
      imageXPath - is a String of XPaths to referenced binary images, using the union operator to separate them.
      Throws:
      IllegalArgumentException - if passed imageXPath is invalid.
    • getImageXPath

      public String getImageXPath()
      Get the String of XPaths to the referenced binary images.
      Returns:
      a String of XPaths to the referenced binary images.
    • setImageComparisonGranularity

      public void setImageComparisonGranularity(ImageComparisonGranularity imageComparisonGranularity)
      Sets the ImageComparisonGranularity at which the differences between two images will be represented. The default is DETAILED_ADJACENT.
      Parameters:
      imageComparisonGranularity - an instance of ImageComparisonGranularity
    • getImageComparisonGranularity

      public ImageComparisonGranularity getImageComparisonGranularity()
      Returns the ImageComparisonGranularity setting for Image comparison results.
      Returns:
      an instance of ImageComparisonGranularity
    • setInputAMarkupStyle

      public void setInputAMarkupStyle(String inputAMarkupStyle)
      Sets the Input A image markup style used for image comparison results. The default is "red" and XML Compare expects the style in the same format.
      Parameters:
      inputAMarkupStyle - the Input A image markup style.
    • getInputAMarkupStyle

      public String getInputAMarkupStyle()
      Gets the Input A Image comparison markup style used for image comparison results.
      Returns:
      the Input A Image markup style.
    • setInputBMarkupStyle

      public void setInputBMarkupStyle(String inputBMarkupStyle)
      Sets the Input B image markup style used for image comparison results. The default is "green" and XML Compare expects the style in the same format.
      Parameters:
      inputBMarkupStyle - the Input B image markup style.
    • getInputBMarkupStyle

      public String getInputBMarkupStyle()
      Gets the Input B Image comparison markup style used for image comparison results.
      Returns:
      the Input B Image markup style.
    • getOutputRefForm

      public OutputImageRefForm getOutputRefForm()
    • setOutputRefForm

      public void setOutputRefForm(OutputImageRefForm outputRefForm)
    • getOutputImageRefFavourSourceDoc

      public OutputImageRefFavourSourceDoc getOutputImageRefFavourSourceDoc()
    • setOutputImageRefFavourSourceDoc

      public void setOutputImageRefFavourSourceDoc(OutputImageRefFavourSourceDoc outputImageRefFavourSourceDoc)