Package nom.tam.image.compression.tile
Class TileCompressor
java.lang.Object
nom.tam.image.tile.operation.AbstractTileOperation
nom.tam.image.compression.tile.TileCompressor
- All Implemented Interfaces:
Runnable,ITileOperation
(for internal use) A parallel operation for compressing a specific image or binary table tile. Each instance
will be processed in a single thread, but operations on separate tiles can be (and will be) processed in parallel.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ByteBufferprotected intprotected nom.tam.image.compression.tile.TileCompressionTypeprotected ICompressOption -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTileCompressor(TiledImageCompressionOperation array, int tileIndex, TileArea area) Creates a new tile compressor for a specific tile in the image. -
Method Summary
Modifier and TypeMethodDescriptionprotected NullPixelMaskPreservercreateImageNullPixelMask(ImageNullPixelMask imageNullPixelMask) protected voidforceNoLoss(boolean value) should the data of this tile be forced to case no data loss.protected byte[]protected ByteBufferprotected nom.tam.image.compression.tile.TileCompressionTypeprotected ICompressorControlprotected ICompressorControlprotected nom.tam.image.compression.tile.TileCompressionOperationvoidrun()protected nom.tam.image.compression.tile.TileCompressionOperationsetCompressed(Object data, nom.tam.image.compression.tile.TileCompressionType type) protected nom.tam.image.compression.tile.TileCompressionOperationsetCompressedOffset(int value) nom.tam.image.compression.tile.TileCompressionOperationsetDimensions(int dataOffset, int width, int height) Specifies the location of the tile in the serialized buffer.protected voidsetWholeImageCompressedBuffer(ByteBuffer compressed) set the buffer that describes the whole compressed image and let the tile create a slice of it from the position where the tile starts in the whole image.toString()Methods inherited from class nom.tam.image.tile.operation.AbstractTileOperation
execute, getArea, getBaseType, getPixelSize, getPreviousTileOperation, getTileBuffer, getTiledImageOperation, getTileIndex, setTileBuffer, setWholeImageBuffer, waitForResultMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface nom.tam.image.tile.operation.ITileOperation
waitForResult
-
Field Details
-
compressedData
-
compressedOffset
protected int compressedOffset -
compressionType
protected nom.tam.image.compression.tile.TileCompressionType compressionType -
tileOptions
-
-
Constructor Details
-
TileCompressor
Creates a new tile compressor for a specific tile in the image.- Parameters:
array- the class that handles the compression of the entire image via parallel processing tiles.tileIndex- the sequential index of the specific tilearea- the location and size of the time in the complete image
-
-
Method Details
-
run
public void run() -
createImageNullPixelMask
-
forceNoLoss
protected void forceNoLoss(boolean value) should the data of this tile be forced to case no data loss. This information is not relevant in all cases that it is ignored by default.- Parameters:
value- the value to set.
-
toString
-
getCompressedData
protected byte[] getCompressedData() -
getCompressedWholeArea
-
getCompressionType
protected nom.tam.image.compression.tile.TileCompressionType getCompressionType() -
getCompressorControl
-
getGzipCompressorControl
-
initTileOptions
protected nom.tam.image.compression.tile.TileCompressionOperation initTileOptions() -
setCompressed
protected nom.tam.image.compression.tile.TileCompressionOperation setCompressed(Object data, nom.tam.image.compression.tile.TileCompressionType type) -
setCompressedOffset
protected nom.tam.image.compression.tile.TileCompressionOperation setCompressedOffset(int value) -
setDimensions
public nom.tam.image.compression.tile.TileCompressionOperation setDimensions(int dataOffset, int width, int height) Description copied from interface:ITileOperationSpecifies the location of the tile in the serialized buffer.- Specified by:
setDimensionsin interfaceITileOperation- Overrides:
setDimensionsin classAbstractTileOperation- Parameters:
dataOffset- the byte offset at which the tile data begins.width- the width of the tile in pixels.height- the tile height in pixels.- Returns:
- itself.
-
setWholeImageCompressedBuffer
set the buffer that describes the whole compressed 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. This buffer is just as big as the image buffer but will be reduced to the needed size as a last step of the Compression.- Parameters:
compressed- the buffer that describes the whole image.
-