Class CropToSquare

java.lang.Object
is.galia.operation.Crop
is.galia.operation.CropToSquare
All Implemented Interfaces:
Operation

public class CropToSquare extends Crop implements Operation
  • Constructor Details

    • CropToSquare

      public CropToSquare()
  • Method Details

    • getRegion

      public Region getRegion(Size reducedSize, ReductionFactor reductionFactor, ScaleConstraint scaleConstraint)
      Description copied from class: Crop
      Computes an effective crop rectangle in source image coordinates.
      Specified by:
      getRegion in class Crop
      Parameters:
      reducedSize - Size of the input image, reduced by reductionFactor.
      reductionFactor - Factor by which the full-sized image has been reduced to become reducedSize.
      scaleConstraint - Scale constraint yet to be applied to the input image. The instance is expressed relative to this constraint rather than to reducedSize or the full image size.
      Returns:
      Region relative to the given reduced dimensions.
    • hasEffect

      public boolean hasEffect()
      May produce false positives. hasEffect(Size, OperationList) should be used instead where possible.
      Specified by:
      hasEffect in interface Operation
      Specified by:
      hasEffect in class Crop
      Returns:
      Whether the crop is not effectively a no-op.
    • hasEffect

      public boolean hasEffect(Size fullSize, OperationList opList)
      Description copied from interface: Operation
      Context-aware counterpart to Operation.hasEffect(). For example, a scale operation specifying a scale to 300×200, when the given operation list contains a crop of 300×200, would return false.
      Specified by:
      hasEffect in interface Operation
      Specified by:
      hasEffect in class Crop
      Parameters:
      fullSize - Full size of the source image.
      opList - Operation list of which the operation may or may not be a member.
      Returns:
      Whether the crop is not effectively a no-op.
    • toString

      public String toString()
      Overrides:
      toString in class Object