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 TileArea
area
private java.util.concurrent.Future<?>
future
private TileBuffer
tileBuffer
private ITiledImageOperation
tiledImageOperation
private int
tileIndex
-
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 void
execute(java.util.concurrent.ExecutorService threadPool)
TileArea
getArea()
protected PrimitiveType<java.nio.Buffer>
getBaseType()
int
getPixelSize()
protected ITileOperation
getPreviousTileOperation()
protected TileBuffer
getTileBuffer()
protected ITiledImageOperation
getTiledImageOperation()
int
getTileIndex()
ITileOperation
setDimensions(int dataOffset, int width, int height)
protected void
setTileBuffer(TileBuffer tileBuffer)
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.void
waitForResult()
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:
waitForResult
in 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:
setDimensions
in interfaceITileOperation
-
setTileBuffer
protected void setTileBuffer(TileBuffer tileBuffer)
-
-