Class Rotate
java.lang.Object
is.galia.operation.Rotate
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidfreeze()Makes the instance unmodifiable.doublegetResultingSize(Size fullSize, ScaleConstraint scaleConstraint) This default implementation returns thefullSizeargument.booleanSimpler but less-accurate counterpart ofOperation.hasEffect(Size, OperationList).booleanhasEffect(Size fullSize, OperationList opList) Context-aware counterpart toOperation.hasEffect().inthashCode()voidsetDegrees(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:OperationMakes the instance unmodifiable. When frozen, mutation methods should throw anIllegalStateExceptionand getters should return immutable values, if possible. (But they should do that anyway.) -
getDegrees
public double getDegrees()- Returns:
- Degrees.
-
getResultingSize
Description copied from interface:OperationThis default implementation returns thefullSizeargument. It will need to be overridden by operations that could change the image's resulting size.- Specified by:
getResultingSizein 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: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
-
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
-