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 TypeMethodDescriptionbooleanvoidfreeze()Makes the instance unmodifiable.getColor()getResultingRegion(Size fullSize, ScaleConstraint scaleConstraint, Crop appliedCrop) booleanSimpler but less-accurate counterpart ofOperation.hasEffect(Size, OperationList).booleanhasEffect(Size fullSize, OperationList opList) Context-aware counterpart toOperation.hasEffect().inthashCode()voidvoidtoMap(Size fullSize, ScaleConstraint scaleConstraint) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:OperationMakes the instance unmodifiable. When frozen, mutation methods should throw anIllegalStateExceptionand 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:OperationSimpler but less-accurate counterpart ofOperation.hasEffect(Size, OperationList). -
hasEffect
Description copied from interface:OperationContext-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:
hasEffectin 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
-