Class Rotate
java.lang.Object
is.galia.operation.Rotate
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
freeze()
Makes the instance unmodifiable.double
getResultingSize
(Size fullSize, ScaleConstraint scaleConstraint) This default implementation returns thefullSize
argument.boolean
Simpler but less-accurate counterpart ofOperation.hasEffect(Size, OperationList)
.boolean
hasEffect
(Size fullSize, OperationList opList) Context-aware counterpart toOperation.hasEffect()
.int
hashCode()
void
setDegrees
(double degrees) toMap
(Size fullSize, ScaleConstraint scaleConstraint) Returns a map in the following format:toString()
-
Constructor Details
-
Rotate
public Rotate()No-op constructor. -
Rotate
public Rotate(double degrees) - Parameters:
degrees
- Degrees of rotation between 0 and 360.
-
-
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.) -
getDegrees
public double getDegrees()- Returns:
- Degrees.
-
getResultingSize
Description copied from interface:Operation
This default implementation returns thefullSize
argument. It will need to be overridden by operations that could change the image's resulting size.- Specified by:
getResultingSize
in interfaceOperation
- 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:
- Resulting dimensions when the scale is applied to the given full size.
-
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
-
setDegrees
public void setDegrees(double degrees) - Parameters:
degrees
- Degrees of rotation between 0 and 360- Throws:
IllegalArgumentException
- If the given degrees are invalid.IllegalStateException
- if the instance is frozen.
-
toMap
Returns a map in the following format:
{ class: "Rotate", degrees: double }
-
toString
-