Package nom.tam.image.tile.operation
Class AbstractTiledImageOperation<OPERATION extends ITileOperation>
java.lang.Object
nom.tam.image.tile.operation.AbstractTiledImageOperation<OPERATION>
- Type Parameters:
OPERATION
- The generic type of tile operation that handles parallel processing
- All Implemented Interfaces:
ITiledImageOperation
- Direct Known Subclasses:
TiledImageCompressionOperation
public abstract class AbstractTiledImageOperation<OPERATION extends ITileOperation>
extends Object
implements ITiledImageOperation
A base implementation of 2D image tile compression.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Returns the element type of the image (and hence tile).int
int
Returns the actual with of the image which is to be tile (de)compressed.protected int
getNAxes()
protected int
protected int[]
Returns the reference to the tile dimensions array.getTileOperation
(int i) Returns the operation that handles the parallel processing of specific tiles.protected OPERATION[]
protected boolean
hasAxes()
protected boolean
void
setAxes
(int[] axes) Sets the image dimensions, in Java array index order.protected void
setBaseType
(ElementType<Buffer> baseType) void
setTileAxes
(int[] value) Sets the tile dimension.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nom.tam.image.tile.operation.ITiledImageOperation
compressOptions, getCompressedWholeArea, getCompressorControl, getGzipCompressorControl
-
Constructor Details
-
AbstractTiledImageOperation
-
-
Method Details
-
getBaseType
Description copied from interface:ITiledImageOperation
Returns the element type of the image (and hence tile).- Specified by:
getBaseType
in interfaceITiledImageOperation
- Returns:
- the FITS element type used in this tile.
-
getBufferSize
public int getBufferSize() -
getImageWidth
public int getImageWidth()Description copied from interface:ITiledImageOperation
Returns the actual with of the image which is to be tile (de)compressed.- Specified by:
getImageWidth
in interfaceITiledImageOperation
- Returns:
- The width of the full image in pixels.
-
getTileOperation
Description copied from interface:ITiledImageOperation
Returns the operation that handles the parallel processing of specific tiles. Each tile can be processed by a dedicated thread, with many tiles processing in parallel at the same time.- Specified by:
getTileOperation
in interfaceITiledImageOperation
- Parameters:
i
- the sequential (flattened) index of the specific tile- Returns:
- the operation instance that handles the parallel processing of that particular tiles.
-
setAxes
public void setAxes(int[] axes) Sets the image dimensions, in Java array index order.- Parameters:
axes
- Image dimensions in Java array index order (x is last!).
-
setTileAxes
Sets the tile dimension. Here the dimensions are in Java array index order, that is the x-dimension (width of tile) is last!
Note, that because tile compression is essentially 2D, the tile sizes in higher dimensions will be forced to 1, even if specified otherwise by the argument (see FITSIO convention).
- Parameters:
value
- The tile dimensions in Java array index order (x is last!). Only up to the last 2 components are considered. The rest will be assumed to have values equals to 1.- Throws:
FitsException
- If the leading dimensions (before the last 2) have sizes not equal to 1
-
hasAxes
protected boolean hasAxes() -
hasTileAxes
protected boolean hasTileAxes() -
createTiles
- Throws:
FitsException
-
getNAxes
protected int getNAxes() -
getNumberOfTileOperations
protected int getNumberOfTileOperations() -
getTileAxes
protected int[] getTileAxes()Returns the reference to the tile dimensions array. The dimensions are stored in Java array index order, i.e., the x-dimension (width) is last.- Returns:
- The tile dimensions in Java array index order (x is last!).
-
getTileOperations
-
setBaseType
-