Package nom.tam.image.tile.operation
Class AbstractTileOperation
- java.lang.Object
-
- nom.tam.image.tile.operation.AbstractTileOperation
-
- All Implemented Interfaces:
java.lang.Runnable,ITileOperation
- Direct Known Subclasses:
TileCompressionOperation
public abstract class AbstractTileOperation extends java.lang.Object implements java.lang.Runnable, ITileOperation
-
-
Field Summary
Fields Modifier and Type Field Description private TileAreaareaprivate java.util.concurrent.Future<?>futureprivate TileBuffertileBufferprivate ITiledImageOperationtiledImageOperationprivate inttileIndex
-
Constructor Summary
Constructors Constructor Description AbstractTileOperation(ITiledImageOperation operation, int tileIndex, TileArea area)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(java.util.concurrent.ExecutorService threadPool)TileAreagetArea()protected PrimitiveType<java.nio.Buffer>getBaseType()intgetPixelSize()protected ITileOperationgetPreviousTileOperation()protected TileBuffergetTileBuffer()protected ITiledImageOperationgetTiledImageOperation()intgetTileIndex()ITileOperationsetDimensions(int dataOffset, int width, int height)protected voidsetTileBuffer(TileBuffer tileBuffer)voidsetWholeImageBuffer(java.nio.Buffer buffer)set the buffer that describes the whole image and let the tile create a slice of it from the position where the tile starts in the whole image.voidwaitForResult()Wait for the result of the tile processing.
-
-
-
Field Detail
-
tiledImageOperation
private final ITiledImageOperation tiledImageOperation
-
future
private java.util.concurrent.Future<?> future
-
tileBuffer
private TileBuffer tileBuffer
-
tileIndex
private final int tileIndex
-
area
private final TileArea area
-
-
Constructor Detail
-
AbstractTileOperation
public AbstractTileOperation(ITiledImageOperation operation, int tileIndex, TileArea area)
-
-
Method Detail
-
execute
public void execute(java.util.concurrent.ExecutorService threadPool)
-
getArea
public TileArea getArea()
-
getPixelSize
public int getPixelSize()
- Returns:
- the number of pixels in this tile.
-
getTileIndex
public int getTileIndex()
-
setWholeImageBuffer
public void setWholeImageBuffer(java.nio.Buffer buffer)
set the buffer that describes the whole image and let the tile create a slice of it from the position where the tile starts in the whole image. Attention this method is not thread-safe because it changes the position of the buffer parameter.- Parameters:
buffer- the buffer that describes the whole image.
-
waitForResult
public void waitForResult()
Wait for the result of the tile processing.- Specified by:
waitForResultin interfaceITileOperation
-
getBaseType
protected PrimitiveType<java.nio.Buffer> getBaseType()
-
getPreviousTileOperation
protected ITileOperation getPreviousTileOperation()
-
getTileBuffer
protected TileBuffer getTileBuffer()
-
getTiledImageOperation
protected ITiledImageOperation getTiledImageOperation()
-
setDimensions
public ITileOperation setDimensions(int dataOffset, int width, int height)
- Specified by:
setDimensionsin interfaceITileOperation
-
setTileBuffer
protected void setTileBuffer(TileBuffer tileBuffer)
-
-