Class ImageConfiguration

java.lang.Object
com.deltaxml.htmlcompare.ImageConfiguration

public class ImageConfiguration extends Object
Specifies configuration options for Binary Image comparison. These configuration options can be specified on a HTMLCompare 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. Additionally, If the referenced images are SVG see SvgConfiguration as it can provide more granular change representation.
  • Constructor Details

  • 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.
    • 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 setting for binary image comparison results. The default is 'red' and an image color can be provided as color names, RGB or RGBA values, HEX values, HSL or HSLA values.
      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 setting for binary image comparison results. The default is"green" and an image color can be provided as color names, RGB or RGBA values, HEX values, HSL or HSLA values.
      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.
    • getOutputImageRefForm

      public OutputImageRefForm getOutputImageRefForm()
      Gets the value of the outputImageRefForm parameter.
      Returns:
      the value of the outputImageRefForm parameter
    • setOutputImageRefForm

      public void setOutputImageRefForm(OutputImageRefForm value)

      If setEnabled(boolean) is set to true this may change the form of fileref attributes of imagedata elements. If set to OutputImageRefForm.SOURCE the value will be as it appears in the source A or B document. If set to OutputImageRefForm.ABSOLUTE the value will be the absolute location used to calculate whether the image has changed. This should mean that for filesystem filerefs at least the images should be visible in the result document. See setEnabled(boolean) (boolean)} for more detail on how the absolute form is calculated.

      Default: OutputImageRefForm.absolute

      Parameters:
      value - the value to set for the outputImageRefForm parameter
      Throws:
      IllegalArgumentException - if the value is null
    • getOutputImageRefFavourSourceDoc

      public OutputImageRefFavourSourceDoc getOutputImageRefFavourSourceDoc()
      Gets the value of the outputImageRefFavourSourceDoc parameter.
      Returns:
      the value of the outputImageRefFavourSourceDoc parameter
    • setOutputImageRefFavourSourceDoc

      public void setOutputImageRefFavourSourceDoc(OutputImageRefFavourSourceDoc value)

      If setEnabled(boolean) is set to true and there are no differences in the A and B images, this determines which of the source Documents, A or B, will be used to set the value of the result fileref. This value will then be used as is or be turned into an absolute value depending on the value passed to setOutputImageRefForm(OutputImageRefForm)

      Parameters:
      value - the value to set for the outputImageRefFavourSourceDoc parameter
      Throws:
      IllegalArgumentException - if the value is null