I - input primitive array type, e.g., float[]O - output primitive array type, e.g., float[]public abstract class AbstractDimensionlessBlockProcessor<I,O> extends Object implements BlockProcessor<I,O>
BlockProcessor to simplify implementations.
This is intented as a base class for BlockProcessor with an adaptable
number of dimensions (such as converters). For BlockProcessor with a
fixed number of source dimensions, see AbstractBlockProcessor.
getSourcePos(), getSourceSize(), and getSourceInterval() are implemented to
return the protected fields long[] sourcePos and int[] sourceSize}. The protected} method int sourceLength()}
can be used to get the number of elements in the source interval.
getSourceBuffer() is implemented
according to the sourcePrimitiveType specified at construction.
| Modifier and Type | Field and Description |
|---|---|
protected long[] |
sourcePos |
protected int[] |
sourceSize |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDimensionlessBlockProcessor(AbstractDimensionlessBlockProcessor<I,O> proc) |
protected |
AbstractDimensionlessBlockProcessor(PrimitiveType sourcePrimitiveType) |
| Modifier and Type | Method and Description |
|---|---|
I |
getSourceBuffer()
Get a
src array of sufficient size. |
Interval |
getSourceInterval() |
long[] |
getSourcePos() |
int[] |
getSourceSize() |
void |
setTargetInterval(Interval interval) |
protected int |
sourceLength() |
protected boolean |
updateNumSourceDimsensions(int n)
Re-allocates
sourcePos and sourceSize arrays if they do
not already exist and have length==n. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitandThen, compute, independentCopy, setTargetIntervalprotected AbstractDimensionlessBlockProcessor(PrimitiveType sourcePrimitiveType)
protected AbstractDimensionlessBlockProcessor(AbstractDimensionlessBlockProcessor<I,O> proc)
public void setTargetInterval(Interval interval)
setTargetInterval in interface BlockProcessor<I,O>protected boolean updateNumSourceDimsensions(int n)
sourcePos and sourceSize arrays if they do
not already exist and have length==n.n - new number of source dimensionstrue if sourcePos and sourceSize arrays were re-allocatedprotected int sourceLength()
public long[] getSourcePos()
getSourcePos in interface BlockProcessor<I,O>public int[] getSourceSize()
getSourceSize in interface BlockProcessor<I,O>public Interval getSourceInterval()
getSourceInterval in interface BlockProcessor<I,O>public I getSourceBuffer()
BlockProcessorsrc array of sufficient size.
Consecutive calls may return the same array, but don't have to.
getSourceBuffer in interface BlockProcessor<I,O>Copyright © 2009–2024 ImgLib2. All rights reserved.