public abstract class StandardImageTiler extends Object implements ImageTiler
| Constructor and Description |
|---|
StandardImageTiler(RandomAccess f,
long fileOffset,
int[] dims,
Class<?> base)
Create a tiler.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
fillFileData(Object output,
int delta,
int outputOffset,
int segment)
File a tile segment from a file.
|
protected void |
fillMemData(Object data,
int[] posits,
int length,
Object output,
int outputOffset,
int dim)
Fill a single segment from memory.
|
protected void |
fillTile(Object data,
Object o,
int[] newDims,
int[] corners,
int[] lengths)
Fill the subset.
|
Object |
getCompleteImage()
Read the entire image into a multidimensional array.
|
protected abstract Object |
getMemoryImage()
See if we can get the image data from memory.
|
static int |
getOffset(int[] dims,
int[] pos) |
Object |
getTile(int[] corners,
int[] lengths)
Get a subset of the image.
|
void |
getTile(Object outArray,
int[] corners,
int[] lengths)
Get a tile, filling in a prespecified array.
|
protected static boolean |
incrementPosition(int[] start,
int[] current,
int[] lengths)
Increment the offset within the position array.
|
public StandardImageTiler(RandomAccess f, long fileOffset, int[] dims, Class<?> base)
f - The random access device from which image data may be read.
This may be null if the tile information is available from
memory.fileOffset - The file offset within the RandomAccess device at which the
data begins.dims - The actual dimensions of the image.base - The base class (should be a primitive type) of the image.public static int getOffset(int[] dims,
int[] pos)
dims - The dimensions of the array.pos - The index requested.protected static boolean incrementPosition(int[] start,
int[] current,
int[] lengths)
start - The starting corner values.current - The current offsets.lengths - The desired dimensions of the subset.true if the current array was changedprotected void fillFileData(Object output, int delta, int outputOffset, int segment) throws IOException
output - The output tile.delta - The offset from the beginning of the image in bytes.outputOffset - The index into the output array.segment - The number of elements to be read for this segment.IOException - if the underlying stream failedprotected void fillMemData(Object data, int[] posits, int length, Object output, int outputOffset, int dim)
data - The in-memory image data.posits - The current position for which data is requested.length - The size of the segments.output - The output tile.outputOffset - The current offset into the output tile.dim - The current dimension beingprotected void fillTile(Object data, Object o, int[] newDims, int[] corners, int[] lengths) throws IOException
data - The memory-resident data image. This may be null if the image
is to be read from a file. This should be a multi-dimensional
primitive array.o - The tile to be filled. This is a simple primitive array.newDims - The dimensions of the full image.corners - The indices of the corner of the image.lengths - The dimensions of the subset.IOException - if the underlying stream failedpublic Object getCompleteImage() throws IOException
getCompleteImage in interface ImageTilerIOException - if the underlying stream failedprotected abstract Object getMemoryImage()
public Object getTile(int[] corners, int[] lengths) throws IOException
getTile in interface ImageTilercorners - The starting corner (using 0 as the start) for the image.lengths - The length requested in each dimension.IOException - if the underlying stream failedpublic void getTile(Object outArray, int[] corners, int[] lengths) throws IOException
getTile in interface ImageTileroutArray - The output tile array. A one-dimensional array. Data not
within the valid limits of the image will be left unchanged.
The length of this array should be the product of lengths.corners - The corners of the tile.lengths - The dimensions of the tile.IOException - if the underlying stream failedCopyright © 1996–2016 nom-tam-fits. All rights reserved.