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 Details

    • AbstractTiledImageOperation

      public AbstractTiledImageOperation(Class<OPERATION> operationClass)
  • Method Details

    • getBaseType

      public ElementType<Buffer> getBaseType()
      Description copied from interface: ITiledImageOperation
      Returns the element type of the image (and hence tile).
      Specified by:
      getBaseType in interface ITiledImageOperation
      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 interface ITiledImageOperation
      Returns:
      The width of the full image in pixels.
    • getTileOperation

      public OPERATION getTileOperation(int i)
      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 interface ITiledImageOperation
      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

      public void setTileAxes(int[] value) throws FitsException

      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

      protected void createTiles(ITileOperationInitialisation<OPERATION> init) throws FitsException
      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

      protected OPERATION[] getTileOperations()
    • setBaseType

      protected void setBaseType(ElementType<Buffer> baseType)