Class Grow
Grow the bounding-box to fill
larger
as much as possible.
Depending on preserveAspectRatio
, the aspect-ratio of smaller
is preserved or
not.
When preserveAspectRatio==false
, the smaller bounding-box is guaranteed to become
identical to the larger.
Growth never occurs in the z-dimension, and the size in this dimension should be equal for
both smaller
and larger
.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BoundingBox
alignAfterCheck
(BoundingBox smaller, BoundingBox larger) protected BoundingBox
alignAfterCheck
(Extent smaller, BoundingBox larger) protected BoundingBox
alignAfterCheck
(Extent smaller, Extent larger) getAlign()
How to align the box after it is grown, as much as possible.boolean
Whether to preserve the aspect-ratio of the smaller image when growing.void
How to align the box after it is grown, as much as possible.void
setPreserveAspectRatio
(boolean preserveAspectRatio) Whether to preserve the aspect-ratio of the smaller image when growing.Methods inherited from class org.anchoranalysis.image.bean.spatial.arrange.align.BoxAligner
align, align, align
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
Grow
public Grow(boolean preserveAspectRatio) Create to preserve the aspect-ratio or not.- Parameters:
preserveAspectRatio
- whether to preserve the aspect-ratio of the smaller image when growing.
-
Grow
public Grow() -
Grow
Creates a newGrow
instance.- Parameters:
preserveAspectRatio
- Whether to preserve the aspect-ratio of the smaller image when growing.align
- How to align the box after it is grown, as much as possible.
-
-
Method Details
-
alignAfterCheck
protected BoundingBox alignAfterCheck(BoundingBox smaller, BoundingBox larger) throws OperationFailedException Description copied from class:BoxAligner
- Specified by:
alignAfterCheck
in classBoxAligner
- Parameters:
smaller
- the smaller bounding-box, relative to the minimum-corner oflarger
. Often this is(0, 0, 0)
if it sits at the minimum corner oflarger
.larger
- the larger bounding-box absolute coordinates.- Returns:
- absolute coordinates for
smaller
, while remaining insidelarger
. - Throws:
OperationFailedException
- if an unrecognized parameter or illegal state exists preventing successful alignment.
-
alignAfterCheck
protected BoundingBox alignAfterCheck(Extent smaller, Extent larger) throws OperationFailedException Description copied from class:BoxAligner
- Specified by:
alignAfterCheck
in classBoxAligner
- Parameters:
smaller
- the smaller bounding-box, relative to the minimum-corner oflarger
. Often this is(0, 0, 0)
if it sits at the minimum corner oflarger
.larger
- the larger bounding-box absolute coordinates.- Returns:
- absolute coordinates for
smaller
, while remaining insidelarger
. - Throws:
OperationFailedException
- if an unrecognized parameter or illegal state exists preventing successful alignment.
-
alignAfterCheck
protected BoundingBox alignAfterCheck(Extent smaller, BoundingBox larger) throws OperationFailedException Description copied from class:BoxAligner
- Specified by:
alignAfterCheck
in classBoxAligner
- Parameters:
smaller
- the smaller bounding-box, relative to the minimum-corner oflarger
. Often this is(0, 0, 0)
if it sits at the minimum corner oflarger
.larger
- the larger bounding-box absolute coordinates.- Returns:
- absolute coordinates for
smaller
, while remaining insidelarger
. - Throws:
OperationFailedException
- if an unrecognized parameter or illegal state exists preventing successful alignment.
-
isPreserveAspectRatio
public boolean isPreserveAspectRatio()Whether to preserve the aspect-ratio of the smaller image when growing. -
setPreserveAspectRatio
public void setPreserveAspectRatio(boolean preserveAspectRatio) Whether to preserve the aspect-ratio of the smaller image when growing. -
getAlign
How to align the box after it is grown, as much as possible. -
setAlign
How to align the box after it is grown, as much as possible.
-