public interface BlockSupplier<T extends NativeType<T>> extends Typed<T>
| Modifier and Type | Method and Description |
|---|---|
default <U extends NativeType<U>> |
andThen(UnaryBlockOperator<T,U> operator)
Returns a
UnaryBlockOperator that is equivalent to applying
this, and then applying op to the result. |
default void |
copy(int[] srcPos,
Object dest,
int[] size)
Copy a block from the (
T-typed) source into primitive arrays (of
the appropriate type). |
default void |
copy(Interval interval,
Object dest)
Copy a block from the (
T-typed) source into primitive arrays (of
the appropriate type). |
void |
copy(long[] srcPos,
Object dest,
int[] size)
Copy a block from the (
T-typed) source into primitive arrays (of
the appropriate type). |
BlockSupplier<T> |
independentCopy()
Returns an instance of this
BlockSupplier that can be used
independently, e.g., in another thread or in another place in the same
pipeline. |
static <T extends NativeType<T>> |
of(RandomAccessible<T> ra)
Create a
BlockSupplier accessor for an arbitrary RandomAccessible source. |
static <T extends NativeType<T>> |
of(RandomAccessible<T> ra,
net.imglib2.blocks.PrimitiveBlocks.OnFallback onFallback)
Create a
BlockSupplier accessor for an arbitrary RandomAccessible source. |
BlockSupplier<T> |
threadSafe()
Get a thread-safe version of this
BlockSupplier. |
void copy(long[] srcPos,
Object dest,
int[] size)
T-typed) source into primitive arrays (of
the appropriate type).srcPos - min coordinate of the block to copydest - primitive array to copy into. Must correspond to T, for
example, if T is UnsignedByteType then dest must
be byte[].size - the size of the block to copydefault void copy(int[] srcPos,
Object dest,
int[] size)
T-typed) source into primitive arrays (of
the appropriate type).srcPos - min coordinate of the block to copydest - primitive array to copy into. Must correspond to T, for
example, if T is UnsignedByteType then dest must
be byte[].size - the size of the block to copydefault void copy(Interval interval, Object dest)
T-typed) source into primitive arrays (of
the appropriate type).interval - the block to copydest - primitive array to copy into. Must correspond to T, for
example, if T is UnsignedByteType then dest must
be byte[].BlockSupplier<T> threadSafe()
BlockSupplier.BlockSupplier<T> independentCopy()
BlockSupplier that can be used
independently, e.g., in another thread or in another place in the same
pipeline.default <U extends NativeType<U>> BlockSupplier<U> andThen(UnaryBlockOperator<T,U> operator)
UnaryBlockOperator that is equivalent to applying
this, and then applying op to the result.static <T extends NativeType<T>> BlockSupplier<T> of(RandomAccessible<T> ra)
BlockSupplier accessor for an arbitrary RandomAccessible source. Many View constructions (that ultimately end in
CellImg, ArrayImg, etc.) are understood and will be
handled by an optimized copier.
If the source RandomAccessible cannot be understood, a warning is
printed, and a fall-back implementation (based on LoopBuilder) is
returned.
The returned BlockSupplier is not thread-safe in general. Use
threadSafe() to obtain a thread-safe instance, e.g., BlockSupplier.of(view).threadSafe().
T - pixel typera - the sourceBlockSupplier accessor for ra.static <T extends NativeType<T>> BlockSupplier<T> of(RandomAccessible<T> ra, net.imglib2.blocks.PrimitiveBlocks.OnFallback onFallback)
BlockSupplier accessor for an arbitrary RandomAccessible source. Many View constructions (that ultimately end in
CellImg, ArrayImg, etc.) are understood and will be
handled by an optimized copier.
If the source RandomAccessible cannot be understood, a fall-back
implementation (based on LoopBuilder) has to be used. The onFallback argument specifies how to handle this case:
ACCEPT: silently accept fall-backWARN: accept fall-back, but print a warning explaining why the input ra requires fall-backFAIL: throw IllegalArgumentException explaining why the input ra requires fall-backBlockSupplier is not thread-safe in general. Use
threadSafe() to obtain a thread-safe instance, e.g., BlockSupplier.of(view).threadSafe().T - pixel typera - the sourceBlockSupplier accessor for ra.Copyright © 2009–2024 ImgLib2. All rights reserved.