Class CropSourceOptions

All Implemented Interfaces:
Cloneable, TransformationSourceOptions

public class CropSourceOptions extends AbstractTransformationSourceOptions
DTO used to store options for ImageMagick cropping.
Author:
Nick Smith, Ray Gauss II
  • Constructor Details

    • CropSourceOptions

      public CropSourceOptions()
  • Method Details

    • isApplicableForMimetype

      public boolean isApplicableForMimetype(String sourceMimetype)
      Description copied from class: AbstractTransformationSourceOptions
      Gets whether or not these transformation source options apply for the given mimetype
      Specified by:
      isApplicableForMimetype in interface TransformationSourceOptions
      Overrides:
      isApplicableForMimetype in class AbstractTransformationSourceOptions
      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 if isPercentageCrop is 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 if isPercentageCrop is 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 if isPercentageCrop is 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 if isPercentageCrop is 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 the gravity property 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 the gravity property 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 the gravity property 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 the gravity property 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

      public void setGravity(String gravity)
      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

      public String 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: TransformationSourceOptions
      Gets the serializer for the source options.
      Returns:
      the serializer
    • createSerializerInstance

      Creates an instance of the options serializer
      Returns:
      the options serializer
    • toString

      public String toString()
      Overrides:
      toString in class Object