Class CropSourceOptions
java.lang.Object
org.alfresco.service.cmr.repository.AbstractTransformationSourceOptions
org.alfresco.service.cmr.repository.CropSourceOptions
- All Implemented Interfaces:
Cloneable,TransformationSourceOptions
DTO used to store options for ImageMagick cropping.
- Author:
- Nick Smith, Ray Gauss II
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassSerializer for crop source optionsNested classes/interfaces inherited from interface org.alfresco.service.cmr.repository.TransformationSourceOptions
TransformationSourceOptions.TransformationSourceOptionsSerializer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates an instance of the options serializerGets the 'gravity' which determines how the offset is applied.intGets the height of the cropped image.Gets the serializer for the source options.intgetWidth()Sets the width of the cropped image.intGets the horizontal offset.intGets the vertical offset.booleanisApplicableForMimetype(String sourceMimetype) Gets whether or not these transformation source options apply for the given mimetypebooleanvoidsetGravity(String gravity) Sets the 'gravity' which determines how the offset is applied.voidsetHeight(int height) Sets the height of the cropped image.voidsetPercentageCrop(boolean isPercentageCrop) voidsetWidth(int width) Sets the width of the cropped image.voidsetXOffset(int xOffset) Sets the horizontal offset.voidsetYOffset(int yOffset) Sets the vertical offset.toString()Methods inherited from class org.alfresco.service.cmr.repository.AbstractTransformationSourceOptions
clone, getApplicabledMimetypes, getApplicableMimetypes, mergedOptions, putParameterIfNotNull, setApplicableMimetypes
-
Constructor Details
-
CropSourceOptions
public CropSourceOptions()
-
-
Method Details
-
isApplicableForMimetype
Description copied from class:AbstractTransformationSourceOptionsGets whether or not these transformation source options apply for the given mimetype- Specified by:
isApplicableForMimetypein interfaceTransformationSourceOptions- Overrides:
isApplicableForMimetypein classAbstractTransformationSourceOptions- Parameters:
sourceMimetype- the mimetype of the source- Returns:
- if these transformation source options apply
-
getHeight
public int getHeight()Gets the height of the cropped image. By default this is in pixels but ifisPercentageCropis set to true then it changes to percentage.- Returns:
- the height
-
setHeight
public void setHeight(int height) Sets the height of the cropped image. By default this is in pixels but ifisPercentageCropis set to true then it changes to percentage.- Parameters:
height- the height to set
-
getWidth
public int getWidth()Sets the width of the cropped image. By default this is in pixels but ifisPercentageCropis set to true then it changes to percentage.- Returns:
- the width
-
setWidth
public void setWidth(int width) Sets the width of the cropped image. By default this is in pixels but ifisPercentageCropis set to true then it changes to percentage.- Parameters:
width- the width to set
-
getXOffset
public int getXOffset()Gets the horizontal offset. By default this starts fromt he top-left corner of the image and moves right, however thegravityproperty can change this.- Returns:
- the xOffset
-
setXOffset
public void setXOffset(int xOffset) Sets the horizontal offset. By default this starts fromt he top-left corner of the image and moves right, however thegravityproperty can change this.- Parameters:
xOffset- the xOffset to set
-
getYOffset
public int getYOffset()Gets the vertical offset. By default this starts fromt he top-left corner of the image and moves down, however thegravityproperty can change this.- Returns:
- the yOffset
-
setYOffset
public void setYOffset(int yOffset) Sets the vertical offset. By default this starts fromt he top-left corner of the image and moves down, however thegravityproperty can change this.- Parameters:
yOffset- the yOffset to set
-
isPercentageCrop
public boolean isPercentageCrop()- Returns:
- the isPercentageCrop
-
setPercentageCrop
public void setPercentageCrop(boolean isPercentageCrop) - Parameters:
isPercentageCrop- the isPercentageCrop to set
-
setGravity
Sets the 'gravity' which determines how the offset is applied. It affects both the origin of offset and the direction(s).- Parameters:
gravity- the gravity to set
-
getGravity
Gets the 'gravity' which determines how the offset is applied. It affects both the origin of offset and the direction(s).- Returns:
- the gravity
-
getSerializer
Description copied from interface:TransformationSourceOptionsGets the serializer for the source options.- Returns:
- the serializer
-
createSerializerInstance
public static TransformationSourceOptions.TransformationSourceOptionsSerializer createSerializerInstance()Creates an instance of the options serializer- Returns:
- the options serializer
-
toString
-