public class Grow extends BoxAligner
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 and Description |
---|
Grow() |
Grow(boolean preserveAspectRatio)
Create to preserve the aspect-ratio or not.
|
Grow(boolean preserveAspectRatio,
Align align) |
Modifier and Type | Method and Description |
---|---|
protected BoundingBox |
alignAfterCheck(BoundingBox smaller,
BoundingBox larger)
|
protected BoundingBox |
alignAfterCheck(Extent smaller,
BoundingBox larger)
|
protected BoundingBox |
alignAfterCheck(Extent smaller,
Extent larger)
|
Align |
getAlign()
How to align the box after it is grown, as much as possible.
|
boolean |
isPreserveAspectRatio()
Whether to preserve the aspect-ratio of the smaller image when growing.
|
void |
setAlign(Align align)
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.
|
align, align, align
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public Grow(boolean preserveAspectRatio)
preserveAspectRatio
- whether to preserve the aspect-ratio of the smaller image when
growing.public Grow()
public Grow(boolean preserveAspectRatio, Align align)
protected BoundingBox alignAfterCheck(BoundingBox smaller, BoundingBox larger) throws OperationFailedException
BoxAligner
alignAfterCheck
in class BoxAligner
smaller
- the smaller bounding-box, relative to the minimum-corner of larger
. Often this is (0, 0, 0)
if it sits at the minimum corner of larger
.larger
- the larger bounding-box absolute coordinates.smaller
, while remaining inside larger
.OperationFailedException
- if an unrecognized parameter or illegal state exists
preventing successful alignment.protected BoundingBox alignAfterCheck(Extent smaller, Extent larger) throws OperationFailedException
BoxAligner
alignAfterCheck
in class BoxAligner
smaller
- the smaller bounding-box, relative to the minimum-corner of larger
. Often this is (0, 0, 0)
if it sits at the minimum corner of larger
.larger
- the larger bounding-box absolute coordinates.smaller
, while remaining inside larger
.OperationFailedException
- if an unrecognized parameter or illegal state exists
preventing successful alignment.protected BoundingBox alignAfterCheck(Extent smaller, BoundingBox larger) throws OperationFailedException
BoxAligner
alignAfterCheck
in class BoxAligner
smaller
- the smaller bounding-box, relative to the minimum-corner of larger
. Often this is (0, 0, 0)
if it sits at the minimum corner of larger
.larger
- the larger bounding-box absolute coordinates.smaller
, while remaining inside larger
.OperationFailedException
- if an unrecognized parameter or illegal state exists
preventing successful alignment.public boolean isPreserveAspectRatio()
public void setPreserveAspectRatio(boolean preserveAspectRatio)
public Align getAlign()
public void setAlign(Align align)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.