public abstract class BoxAligner extends AnchorBean<BoxAligner>
BoundingBox
to fit inside a larger BoundingBox
.
The smaller box may also be identically sized as the larger.
This is useful for implementing different methods for aligning / growing a smaller image to occupy a larger space. But it is not specific to images, and can be applied to any bounding-boxes.
Growth never occurs in the z-dimension, and the size in this dimension should be equal for
both smaller
and larger
.
Constructor and Description |
---|
BoxAligner() |
Modifier and Type | Method and Description |
---|---|
BoundingBox |
align(BoundingBox smaller,
BoundingBox larger)
|
BoundingBox |
align(Extent smaller,
BoundingBox larger)
|
BoundingBox |
align(Extent smaller,
Extent larger)
|
protected abstract BoundingBox |
alignAfterCheck(BoundingBox smaller,
BoundingBox larger)
|
protected abstract BoundingBox |
alignAfterCheck(Extent smaller,
BoundingBox larger)
|
protected abstract BoundingBox |
alignAfterCheck(Extent smaller,
Extent larger)
|
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public BoundingBox align(BoundingBox smaller, BoundingBox larger) throws OperationFailedException
BoundingBox
to use for smaller
BoundingBox
so that it
fits inside larger
BoundingBox
.
The position and size of smaller
and larger
must be identical in the
z-dimension.
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 the z-dimensions are not equal, or if an unrecognized
parameter or illegal state exists preventing successful alignment.public BoundingBox align(Extent smaller, Extent larger) throws OperationFailedException
BoundingBox
to use for a smaller
Extent
so that it fits
inside larger
Extent
.
The position and size of smaller
and larger
must be identical in the
z-dimension.
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 the z-dimensions are not equal, or if an unrecognized
parameter or illegal state exists preventing successful alignment.public BoundingBox align(Extent smaller, BoundingBox larger) throws OperationFailedException
BoundingBox
to use for a smaller
Extent
so that it fits
inside larger
BoundingBox
.
The position and size of smaller
and larger
must be identical in the
z-dimension.
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 the z-dimensions are not equal, or if an unrecognized
parameter or illegal state exists preventing successful alignment.protected abstract BoundingBox alignAfterCheck(BoundingBox smaller, BoundingBox larger) throws OperationFailedException
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 abstract BoundingBox alignAfterCheck(Extent smaller, Extent larger) throws OperationFailedException
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 abstract BoundingBox alignAfterCheck(Extent smaller, BoundingBox larger) throws OperationFailedException
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.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.