Class Sharpen

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

public class Sharpen extends Object implements Operation
  • Constructor Details

    • Sharpen

      public Sharpen()
      No-op constructor.
    • Sharpen

      public Sharpen(double amount)
      Parameters:
      amount - Amount to sharpen.
  • Method Details

    • freeze

      public void freeze()
      Description copied from interface: Operation
      Makes the instance unmodifiable. When frozen, mutation methods should throw an IllegalStateException and getters should return immutable values, if possible. (But they should do that anyway.)
      Specified by:
      freeze in interface Operation
    • hasEffect

      public boolean hasEffect()
      Description copied from interface: Operation
      Simpler but less-accurate counterpart of Operation.hasEffect(Size, OperationList).
      Specified by:
      hasEffect in interface Operation
      Returns:
      Whether applying the operation on its own would result in a changed image.
    • 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
      Parameters:
      fullSize - Full size of the source image.
      opList - Operation list of which the operation may or may not be a member.
      Returns:
      Whether applying the operation in the context of the given full size and operation list would result in a changed image.
    • getAmount

      public double getAmount()
    • setAmount

      public void setAmount(double amount) throws IllegalArgumentException
      Parameters:
      amount - Amount to sharpen.
      Throws:
      IllegalArgumentException - if the supplied amount is less than zero.
      IllegalStateException - if the instance is frozen.
    • toMap

      public Map<String,Object> toMap(Size fullSize, ScaleConstraint scaleConstraint)
      Specified by:
      toMap in interface Operation
      Parameters:
      fullSize - Full size of the source image on which the operation is being applied.
      scaleConstraint - Scale constraint applied to the given full size.
      Returns:
      Map with an amount key corresponding to the amount.
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      String representation of the instance, guaranteed to represent the instance, but not guaranteed to have any particular format.