public interface Dimensions extends EuclideanSpace
| Modifier and Type | Method and Description |
|---|---|
static boolean |
allPositive(int... dimensions)
Check whether all entries in
dimensions are positive |
static boolean |
allPositive(long... dimensions)
Check whether all entries in
dimensions are positive |
long |
dimension(int d)
Get the number of pixels in a given dimension d.
|
default void |
dimensions(long[] dimensions)
Write the number of pixels in each dimension into long[].
|
default void |
dimensions(Positionable dimensions)
Write the number of pixels in each dimension into
Positionable. |
default long[] |
dimensionsAsLongArray()
Allocates a new long array with the dimensions of this object.
|
default Point |
dimensionsAsPoint()
Allocates a new
Point with the dimensions of this object. |
static int[] |
verify(int... dimensions)
Verify that
dimensions is not null or empty, and that all
dimensions are positive. |
static long[] |
verify(long... dimensions)
Verify that
dimensions is not null or empty, and that all
dimensions are positive. |
static int[] |
verifyAllPositive(int... dimensions)
Check that all entries in
dimensions are positive |
static long[] |
verifyAllPositive(long... dimensions)
Check that all entries in
dimensions are positive |
numDimensionsdefault void dimensions(long[] dimensions)
dimensions - default void dimensions(Positionable dimensions)
Positionable.dimensions - long dimension(int d)
d - default long[] dimensionsAsLongArray()
dimensions(long[]).default Point dimensionsAsPoint()
Point with the dimensions of this object.
Please note that his method allocates a new Point each time
which introduces notable overhead in both compute and memory.
If you query it frequently, you should allocate a dedicated
Point first and reuse it with dimensions(Positionable).static boolean allPositive(long... dimensions)
dimensions are positivedimensions - dimension are positive, false
otherwisestatic boolean allPositive(int... dimensions)
dimensions are positivedimensions - dimension are positive, false
otherwisestatic long[] verifyAllPositive(long... dimensions)
throws InvalidDimensionsException
dimensions are positivedimensions - dimensionsInvalidDimensionsException - if any of dimensions is not positive (zero or
negative).static int[] verifyAllPositive(int... dimensions)
throws InvalidDimensionsException
dimensions are positivedimensions - dimensionsInvalidDimensionsException - if any of dimensions is not positive (zero or
negative).static long[] verify(long... dimensions)
throws InvalidDimensionsException
dimensions is not null or empty, and that all
dimensions are positive. Throw InvalidDimensionsException otherwise.dimensions - to be verified.dimensions if successfully verified.IllegalArgumentException - if dimensions == null or
dimensions.length == 0 or any dimensions is zero or
negative.InvalidDimensionsExceptionstatic int[] verify(int... dimensions)
throws InvalidDimensionsException
dimensions is not null or empty, and that all
dimensions are positive. Throw InvalidDimensionsException otherwise.dimensions - to be verified.dimensions if successfully verified.IllegalArgumentException - if dimensions == null or
dimensions.length == 0 or any dimensions is zero or
negative.InvalidDimensionsExceptionCopyright © 2015–2022 ImgLib2. All rights reserved.