[]
This is the generic interface to be implemented by all image file (or other resource) readers for different image file formats.
<p>An ImgReader behaves as an ImgData object. Whenever image data is
requested through the getInternCompData() or getCompData() methods, the
image data will be read (if it is not buffered) and returned. Implementing
classes should not buffer large amounts of data, so as to reduce memory
usage.</p><p>This class sets the image origin to (0,0). All default implementations
of the methods assume this.</p><p>This class provides default implementations of many methods. These
default implementations assume that there is no tiling (i.e., the only tile
is the entire image), that the image origin is (0,0) in the canvas system
and that there is no component subsampling (all components are the same
size), but they can be overloaded by the implementating class if need
be.</p>
public abstract class ImgReader : BlkImgDataSrc, ImgData
Name | Description |
---|---|
ImgReader() |
Name | Description |
---|---|
h | The height of the image |
nc | The number of components in the image |
w | The width of the image |
Name | Description |
---|---|
ImgHeight | Returns the overall height of the image in pixels. This is the image's height without accounting for any component subsampling or tiling. The value of h is returned. |
ImgULX | Returns the horizontal coordinate of the image origin, the top-left corner, in the canvas system, on the reference grid. |
ImgULY | Returns the vertical coordinate of the image origin, the top-left corner, in the canvas system, on the reference grid. |
ImgWidth | Returns the overall width of the image in pixels. This is the image's width without accounting for any component subsampling or tiling. The value of w is returned. |
NomTileHeight | Returns the nominal tiles height |
NomTileWidth | Returns the nominal tiles width |
NumComps | Returns the number of components in the image. The value of nc is returned. |
TileHeight | Returns the overall height of the current tile in pixels, assuming there is no-tiling. Since no-tiling is assumed this is the same as the width of the image. The value of h is returned. |
TileIdx | Returns the index of the current tile, relative to a standard scan-line order. This default implementations assumes no tiling, so 0 is always returned. |
TilePartULX | Returns the horizontal tile partition offset in the reference grid |
TilePartULY | Returns the vertical tile partition offset in the reference grid |
TileWidth | Returns the width of the current tile in pixels, assuming there is no-tiling. Since no-tiling is assumed this is the same as the width of the image. The value of w is returned. |
Name | Description |
---|---|
close() | Closes the underlying file or network connection from where the image data is being read. |
getCompData(DataBlk, int) | |
getCompImgHeight(int) | Returns the height in pixels of the specified component in the overall image. This default implementation assumes no component, or component, subsampling (i.e. all components have the same dimensions in pixels). |
getCompImgWidth(int) | Returns the width in pixels of the specified component in the overall image. This default implementation assumes no component, or component, subsampling (i.e. all components have the same dimensions in pixels). |
getCompSubsX(int) | Returns the component subsampling factor in the horizontal direction, for the specified component. This is, approximately, the ratio of dimensions between the reference grid and the component itself, see the 'ImgData' interface desription for details. |
getCompSubsY(int) | Returns the component subsampling factor in the vertical direction, for the specified component. This is, approximately, the ratio of dimensions between the reference grid and the component itself, see the 'ImgData' interface desription for details. |
getCompULX(int) | Returns the horizontal coordinate of the upper-left corner of the specified component in the current tile. |
getCompULY(int) | Returns the vertical coordinate of the upper-left corner of the specified component in the current tile. |
getFixedPoint(int) | Returns the position of the fixed point in the specified component, or equivalently the number of fractional bits. This is the position of the least significant integral (i.e. non-fractional) bit, which is equivalent to the number of fractional bits. For instance, for fixed-point values with 2 fractional bits, 2 is returned. For floating-point data this value does not apply and 0 should be returned. Position 0 is the position of the least significant bit in the data. |
getInternCompData(DataBlk, int) | |
getNomRangeBits(int) | |
getNumTiles() | Returns the total number of tiles in the image. This default implementation assumes no tiling, so 1 is always returned. |
getNumTiles(Coord) | Returns the number of tiles in the horizontal and vertical directions. This default implementation assumes no tiling, so (1,1) is always returned. |
getTile(Coord) | Returns the coordinates of the current tile. This default implementation assumes no-tiling, so (0,0) is returned. |
getTileCompHeight(int, int) | Returns the height in pixels of the specified tile-component. This default implementation assumes no tiling and no component subsampling (i.e., all components, or components, have the same dimensions in pixels). |
getTileCompWidth(int, int) | Returns the width in pixels of the specified tile-component. This default implementation assumes no tiling and no component subsampling (i.e., all components, or components, have the same dimensions in pixels). |
isOrigSigned(int) | Returns true if the data read was originally signed in the specified component, false if not. |
nextTile() | Advances to the next tile, in standard scan-line order (by rows then columns). A NoNextElementException is thrown if the current tile is the last one (i.e. there is no next tile). This default implementation assumes no tiling, so NoNextElementException() is always thrown. |
setTile(int, int) | Changes the current tile, given the new coordinates. An IllegalArgumentException is thrown if the coordinates do not correspond to a valid tile. This default implementation assumes no tiling so the only valid arguments are x=0, y=0. |