Class 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

      All Methods Instance Methods Concrete Methods 
      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 isOriginal()
      Returns true if this cropping actually represents the original image
    • Constructor Detail

      • Cropping

        protected Cropping​(Parameters parameters)
        Builds a new Cropping object from Parameters
        Parameters:
        parameters - The parameters
    • Method Detail

      • 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