Class ImageConfiguration
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newImageConfigurationinstance.ImageConfiguration(boolean imageCompareEnabled) Creates a newImageConfigurationinstance, setting the value of the imageCompareEnabled parameter. -
Method Summary
Modifier and TypeMethodDescriptionGets the current image comparison granularity.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.Gets the value of the mediaObjectParentsList parameter.Gets the value of the outputImageRefFavourSourceDoc parameter.Gets the value of the outputImageRefForm parameter.booleanGets the value of the imageCompareEnabled parameter.booleanGets the value of the showImageChangesAtMediaObjectLevel parameter.booleanGets the value of the showImageChangesAtMediaObjectParentLevel parameter.voidsetImageCompareEnabled(boolean value) Whether the actual images used will be compared rather than the string value of the location (fileref attribute) of the imagedata.voidsetImageComparisonGranularity(ImageComparisonGranularity imageComparisonGranularity) Sets theImageComparisonGranularityat which the differences between two images will be represented.voidsetInputAMarkupStyle(String inputAMarkupStyle) Sets the Input A image markup style setting for binary image comparison results.voidsetInputBMarkupStyle(String inputBMarkupStyle) Sets the Input B image markup style setting for binary image comparison results.voidsetMediaObjectParentsList(String value) Sets the comma and/or space separated list of media object parents using Clark notation.voidIfsetImageCompareEnabled(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.voidIfsetImageCompareEnabled(boolean)is set to true this may change the form of fileref attributes of imagedata elements.voidsetShowImageChangesAtMediaObjectLevel(boolean value) IfsetImageCompareEnabled(boolean)is set to true and determines that images have changed, show the changes as changes to the containing mediaobject.voidsetShowImageChangesAtMediaObjectParentLevel(boolean value) Sets image changes at media object parent level.
-
Constructor Details
-
ImageConfiguration
public ImageConfiguration()Creates a newImageConfigurationinstance. Contains parameters managing image comparison. -
ImageConfiguration
public ImageConfiguration(boolean imageCompareEnabled) Creates a newImageConfigurationinstance, setting the value of the imageCompareEnabled parameter. Contains parameters managing image comparison.- Parameters:
imageCompareEnabled- the value of the imageCompareEnabled parameter.
-
-
Method Details
-
isImageCompareEnabled
public boolean isImageCompareEnabled()Gets the value of the imageCompareEnabled parameter.- Returns:
- the value of the imageCompareEnabled parameter
-
setImageCompareEnabled
public void setImageCompareEnabled(boolean value) Whether the actual images used will be compared rather than the string value of the location (fileref attribute) of the imagedata.
This can mean that even though the fileref has not changed the image will be marked as a change if it resolves to different images within the context of A or B. Similarly if the fileref has changed but resolves to the same image within the context of A or B it will not be marked as a change. The xml:base of both input files will be used to resolve the fileref to an absolute location. If no xml:base is given the XPAth base-uri() function is used. The resolved locations from A and B will then be compared for string equality. If they are the same then the fileref will not be marked as a change, if they are different then the URIs will be opened using
URL.openStream()and byte-wise comparison of the images will be done. If any problem occurs then the images will be marked as changed, otherwise the result of the byte-wise comparison will be used to determine whether the image is marked as changed.- Parameters:
value- the value to set for the imageCompare parameter- See Also:
-
isShowImageChangesAtMediaObjectLevel
public boolean isShowImageChangesAtMediaObjectLevel()Gets the value of the showImageChangesAtMediaObjectLevel parameter.- Returns:
- the value of the showImageChangesAtMediaObjectLevel parameter
-
setShowImageChangesAtMediaObjectLevel
public void setShowImageChangesAtMediaObjectLevel(boolean value) If
setImageCompareEnabled(boolean)is set to true and determines that images have changed, show the changes as changes to the containing mediaobject.By default, image changes are tracked as changes to the fileref attribute of the DocBook imagedata tag. Since changes to attributes are difficult to show in docbook, it may be preferable to show the change at the level of the containing mediaobject or inlinemediaobject by cloning them and showing the A and B versions 'side by side' in the result document.
Default:
false- Parameters:
value- the value to set for the showImageChangesAtMediaObjectLevel parameter
-
isShowImageChangesAtMediaObjectParentLevel
public boolean isShowImageChangesAtMediaObjectParentLevel()Gets the value of the showImageChangesAtMediaObjectParentLevel parameter.- Returns:
- the value of the showImageChangesAtMediaObjectParentLevel parameter
-
setShowImageChangesAtMediaObjectParentLevel
public void setShowImageChangesAtMediaObjectParentLevel(boolean value) Sets image changes at media object parent level. This only works if a value for media object parent list has a matching element.
- Parameters:
value- the value to set for the boolean parameter- See Also:
-
getMediaObjectParentsList
Gets the value of the mediaObjectParentsList parameter.- Returns:
- the value of the mediaObjectParentsList parameter
-
setMediaObjectParentsList
Sets the comma and/or space separated list of media object parents using Clark notation. Only active when
setShowImageChangesAtMediaObjectParentLevel(boolean)is set to true.This parameter defines which media object parents are allowed by DocBook documentation.
- Parameters:
value- the value to set for the mediaObjectParentsList parameter- Throws:
IllegalArgumentException- if the value is null
-
getOutputImageRefForm
Gets the value of the outputImageRefForm parameter.- Returns:
- the value of the outputImageRefForm parameter
-
setOutputImageRefForm
If
setImageCompareEnabled(boolean)is set to true this may change the form of fileref attributes of imagedata elements. If set toOutputImageRefForm.SOURCEthe value will be as it appears in the source A or B document. If set toOutputImageRefForm.ABSOLUTEthe 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. SeesetImageCompareEnabled(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
Gets the value of the outputImageRefFavourSourceDoc parameter.- Returns:
- the value of the outputImageRefFavourSourceDoc parameter
-
setOutputImageRefFavourSourceDoc
If
setImageCompareEnabled(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 tosetOutputImageRefForm(OutputImageRefForm)Even if there are no differences A and B can still point to different files, so there is still a choice of the value used to derive the result.- Parameters:
value- the value to set for the outputImageRefFavourSourceDoc parameter- Throws:
IllegalArgumentException- if the value is null- See Also:
-
getImageComparisonGranularity
Gets the current image comparison granularity.
- Returns:
- the current image comparison granularity
- See Also:
-
setImageComparisonGranularity
Sets theImageComparisonGranularityat which the differences between two images will be represented. The default isImageComparisonGranularity.DETAILED_ADJACENT.- Parameters:
imageComparisonGranularity- the value to set for the imageComparisonGranularity parameter
-
getInputAMarkupStyle
Gets the Input A Image comparison markup style used for image comparison results.- Returns:
- the Input A Image markup style.
-
setInputAMarkupStyle
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.
-
getInputBMarkupStyle
Gets the Input B Image comparison markup style used for image comparison results.- Returns:
- the Input B Image markup style.
-
setInputBMarkupStyle
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.
-