Package com.deltaxml.core.config.image
Class ImageConfiguration
java.lang.Object
com.deltaxml.core.config.image.ImageConfiguration
`*
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 Summary
ConstructorsConstructorDescriptionInitializes a new emptyImageConfigurationinstance with no XPaths specified.ImageConfiguration(String imageXPath) Initializes a newImageConfigurationinstance with the provided String of XPaths.ImageConfiguration(String imageXPath, ImageComparisonGranularity imageComparisonGranularity) Initializes a newImageConfigurationinstance with the provided String of XPaths, inputAMarkupStyle, inputBMarkupStyle, imageComparisonGranularity.ImageConfiguration(String imageXPath, ImageComparisonGranularity imageComparisonGranularity, String inputAMarkupStyle, String inputBMarkupStyle) Initializes a newImageConfigurationinstance with the provided String of XPaths, inputAMarkupStyle, inputBMarkupStyle, imageComparisonGranularity. -
Method Summary
Modifier and TypeMethodDescriptionReturns theImageComparisonGranularitysetting for Image comparison results.Get the String of XPaths to the referenced binary images.Gets the Input A Image comparison markup style used for image comparison results.Gets the Input B Image comparison markup style used for image comparison results.booleanGets whether Binary Image comparison is enabled.voidsetEnabled(boolean isEnabled) `* Sets whether to use Binary Image comparison.voidsetImageComparisonGranularity(ImageComparisonGranularity imageComparisonGranularity) Sets theImageComparisonGranularityat which the differences between two images will be represented.voidsetImageXPath(String imageXPath) Sets the XPath to the referenced binary image.voidsetInputAMarkupStyle(String inputAMarkupStyle) Sets the Input A image markup style used for image comparison results.voidsetInputBMarkupStyle(String inputBMarkupStyle) Sets the Input B image markup style used for image comparison results.voidsetOutputImageRefFavourSourceDoc(OutputImageRefFavourSourceDoc outputImageRefFavourSourceDoc) voidsetOutputRefForm(OutputImageRefForm outputRefForm)
-
Constructor Details
-
ImageConfiguration
public ImageConfiguration()Initializes a new emptyImageConfigurationinstance with no XPaths specified. -
ImageConfiguration
Initializes a newImageConfigurationinstance 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 newImageConfigurationinstance 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 ofImageComparisonGranularityinputAMarkupStyle- input A markup styleinputBMarkupStyle- input B markup style- Throws:
IllegalArgumentException- if passed imageXPath is invalid.
-
ImageConfiguration
Initializes a newImageConfigurationinstance 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 ofImageComparisonGranularity- 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
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
Get the String of XPaths to the referenced binary images.- Returns:
- a String of XPaths to the referenced binary images.
-
setImageComparisonGranularity
Sets theImageComparisonGranularityat which the differences between two images will be represented. The default is DETAILED_ADJACENT.- Parameters:
imageComparisonGranularity- an instance ofImageComparisonGranularity
-
getImageComparisonGranularity
Returns theImageComparisonGranularitysetting for Image comparison results.- Returns:
- an instance of
ImageComparisonGranularity
-
setInputAMarkupStyle
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
Gets the Input A Image comparison markup style used for image comparison results.- Returns:
- the Input A Image markup style.
-
setInputBMarkupStyle
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
Gets the Input B Image comparison markup style used for image comparison results.- Returns:
- the Input B Image markup style.
-
getOutputRefForm
-
setOutputRefForm
-
getOutputImageRefFavourSourceDoc
-
setOutputImageRefFavourSourceDoc
public void setOutputImageRefFavourSourceDoc(OutputImageRefFavourSourceDoc outputImageRefFavourSourceDoc)
-