Class Redaction
java.lang.Object
is.galia.operation.redaction.Redaction
- All Implemented Interfaces:
Operation
Encapsulates a rectangle overlaid onto an image.
Instances should be obtained from the RedactionService
.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
freeze()
Makes the instance unmodifiable.getColor()
getResultingRegion
(Size fullSize, ScaleConstraint scaleConstraint, Crop appliedCrop) boolean
Simpler but less-accurate counterpart ofOperation.hasEffect(Size, OperationList)
.boolean
hasEffect
(Size fullSize, OperationList opList) Context-aware counterpart toOperation.hasEffect()
.int
hashCode()
void
void
toMap
(Size fullSize, ScaleConstraint scaleConstraint) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface is.galia.operation.Operation
getResultingSize, validate
-
Constructor Details
-
Redaction
public Redaction()No-op constructor. -
Redaction
-
-
Method Details
-
equals
-
freeze
public void freeze()Description copied from interface:Operation
Makes the instance unmodifiable. When frozen, mutation methods should throw anIllegalStateException
and getters should return immutable values, if possible. (But they should do that anyway.) -
getColor
- Returns:
- Color with alpha.
-
getRegion
- Returns:
- Redacted region in source image pixel coordinates.
-
getResultingRegion
- Parameters:
fullSize
- Size of the source image.scaleConstraint
- Scale constraint.appliedCrop
- Crop that has been applied to the source image.- Returns:
- Region of the cropped image to be redacted, or an empty rectangle if none.
-
hasEffect
public boolean hasEffect()Description copied from interface:Operation
Simpler but less-accurate counterpart ofOperation.hasEffect(Size, OperationList)
. -
hasEffect
Description copied from interface:Operation
Context-aware counterpart toOperation.hasEffect()
. For example, a scale operation specifying a scale to 300×200, when the given operation list contains a crop of 300×200, would returnfalse
.- Specified by:
hasEffect
in interfaceOperation
- 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.
-
hashCode
-
setColor
-
setRegion
- Parameters:
region
- Redacted region in source image pixel coordinates.- Throws:
IllegalStateException
- If the instance is frozen.
-
toMap
-
toString
-