Class CropImageAction.Cropping

java.lang.Object
org.ametys.plugins.core.upload.image.CropImageAction.Cropping
Enclosing class:
CropImageAction

protected static class CropImageAction.Cropping extends Object
Represents a rectangular cropping of an image.
It stores only relative float values (which are between 0 and 1) as ratio of the width and height of the original image, which are unknown.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Cropping(Parameters parameters)
    Builds a new Cropping object from Parameters
  • Method Summary

    Modifier and Type
    Method
    Description
    protected int
    getHeight(int originalHeight)
    Gets the height of the cropping rectangular region
    protected int
    getWidth(int originalWidth)
    Gets the width of the cropping rectangular region
    protected int
    getX(int originalWidth)
    Gets the X coordinate of the upper-left corner of the cropping rectangular region
    protected int
    getY(int originalHeight)
    Gets the Y coordinate of the upper-left corner of the cropping rectangular region
    protected boolean
    Returns true if this cropping actually represents the original image

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • isOriginal

      protected boolean isOriginal()
      Returns true if this cropping actually represents the original image
      Returns:
      true if this cropping actually represents the original image
    • getX

      protected int getX(int originalWidth)
      Gets the X coordinate of the upper-left corner of the cropping rectangular region
      Parameters:
      originalWidth - The width of the original image
      Returns:
      the X coordinate of the upper-left corner of the cropping rectangular region
    • getY

      protected int getY(int originalHeight)
      Gets the Y coordinate of the upper-left corner of the cropping rectangular region
      Parameters:
      originalHeight - The height of the original image
      Returns:
      the Y coordinate of the upper-left corner of the cropping rectangular region
    • getWidth

      protected int getWidth(int originalWidth)
      Gets the width of the cropping rectangular region
      Parameters:
      originalWidth - The width of the original image
      Returns:
      the width of the cropping rectangular region
    • getHeight

      protected int getHeight(int originalHeight)
      Gets the height of the cropping rectangular region
      Parameters:
      originalHeight - The height of the original image
      Returns:
      the height of the cropping rectangular region