Package nom.tam.image.compression
Class CompressedImageTiler
java.lang.Object
nom.tam.image.compression.CompressedImageTiler
- All Implemented Interfaces:
ImageTiler
Class to extract individually compressed tiles from a compressed image. This class supports the FITS 3.0 standard and
up, and will stream the results to a provided
ArrayDataOutput
.- See Also:
-
Constructor Summary
ConstructorDescriptionCompressedImageTiler
(CompressedImageHDU compressedImageHDU) Only constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the entire image reconstructed from the available tiles.getTile
(int[] corners, int[] lengths) Returns a tile from the image of the specified size at the specified location.void
Fills the supplied array or output stream with the data from an image tile of the specified size at the specified location.void
Fills the supplied array our output stream with the sparsely sampled data from an image tile of the specified size at the specified location.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nom.tam.image.ImageTiler
getTile
-
Constructor Details
-
CompressedImageTiler
Only constructor. This will pull commonly accessed elements (header, data) from the HDU.- Parameters:
compressedImageHDU
- The compressed Image HDU.
-
-
Method Details
-
getCompleteImage
Description copied from interface:ImageTiler
Returns the entire image reconstructed from the available tiles.- Specified by:
getCompleteImage
in interfaceImageTiler
- Returns:
- the complete reconstructed image from the available tiles, as a Java array. This may be an
array of promitives (such as
float[][]
) for images, or anObject[]
for binary tables. - Throws:
IOException
- if there was an error accessing the tile data from the input.- See Also:
-
getTile
Description copied from interface:ImageTiler
Fills the supplied array or output stream with the data from an image tile of the specified size at the specified location.- Specified by:
getTile
in interfaceImageTiler
- Parameters:
output
- A one-dimensional output array or stream. Data not within the valid limits of the image will be left unchanged. For an array, the length should be the product of lengths. Optionally provide anArrayDataOutput
to stream out data and not fill memory; useful for web applications.corners
- the pixels indices where the tile starts in the full image. The array =hould contain a value for each image dimension.lengths
- the tile size in pixels. The array =hould contain a value for each image dimension. For the supported 2D tiles, the values beyond the first two entries should be set to 1.- Throws:
IOException
- if there was an error writing the tile to the output.- See Also:
-
getTile
Description copied from interface:ImageTiler
Fills the supplied array our output stream with the sparsely sampled data from an image tile of the specified size at the specified location.- Specified by:
getTile
in interfaceImageTiler
- Parameters:
output
- A one-dimensional output array or stream. Data not within the valid limits of the image will be left unchanged. For an array, the length should be the product of lengths. Optionally provide anArrayDataOutput
to stream out data and not fill memory; useful for web applications.corners
- the pixels indices where the tile starts in the full image. The array =hould contain a value for each image dimension.lengths
- the tile size in pixels. The array =hould contain a value for each image dimension. For the supported 2D tiles, the values beyond the first two entries should be set to 1.steps
- the sampling frequency of the original image, in pixels. The array =hould contain a value for each image dimension.- Throws:
IOException
- if there was an error writing the tile to the output.- See Also:
-
getTile
Description copied from interface:ImageTiler
Returns a tile from the image of the specified size at the specified location. An image tile is returned as a one-dimensional array although the image will normally be multidimensional.- Specified by:
getTile
in interfaceImageTiler
- Parameters:
corners
- the pixels indices where the tile starts in the full image. The array =hould contain a value for each image dimension.lengths
- the tile size in pixels. The array should contain a value for each image dimension. For the supported 2D tiles, the values beyond the first two entries should be set to 1.- Returns:
- a Java array containing data for the requested tile. This will always be a flattened 1D array, even if the image is multidimensional
- Throws:
IOException
- if there was an error accessing the tile data from the input.- See Also:
-