C# Class CSJ2K.j2k.image.input.ImgReader

This is the generic interface to be implemented by all image file (or other resource) readers for different image file formats.

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.

This class sets the image origin to (0,0). All default implementations of the methods assume this.

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.

Inheritance: BlkImgDataSrc
显示文件 Open project: cureos/csj2k

Protected Properties

Property Type Description
h int
nc int
w int

Public Methods

Method Description
close ( ) : void

Closes the underlying file or network connection from where the image data is being read.

getCompData ( CSJ2K.j2k.image.DataBlk blk, int c ) : CSJ2K.j2k.image.DataBlk
getCompImgHeight ( int c ) : 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 c ) : 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 c ) : 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 c ) : 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 c ) : int

Returns the horizontal coordinate of the upper-left corner of the specified component in the current tile.

getCompULY ( int c ) : int

Returns the vertical coordinate of the upper-left corner of the specified component in the current tile.

getFixedPoint ( int c ) : int
getInternCompData ( CSJ2K.j2k.image.DataBlk blk, int c ) : CSJ2K.j2k.image.DataBlk
getNomRangeBits ( int c ) : int
getNumTiles ( Coord co ) : Coord

Returns the number of tiles in the horizontal and vertical directions. This default implementation assumes no tiling, so (1,1) is always returned.

getNumTiles ( ) : int

Returns the total number of tiles in the image. This default implementation assumes no tiling, so 1 is always returned.

getTile ( Coord co ) : Coord

Returns the coordinates of the current tile. This default implementation assumes no-tiling, so (0,0) is returned.

getTileCompHeight ( int t, int c ) : 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 t, int c ) : 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 c ) : bool

Returns true if the data read was originally signed in the specified component, false if not.

nextTile ( ) : void

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 x, int y ) : void

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.

Method Details

close() public abstract method

Closes the underlying file or network connection from where the image data is being read.
If an I/O error occurs. ///
public abstract close ( ) : void
return void

getCompData() public abstract method

public abstract getCompData ( CSJ2K.j2k.image.DataBlk blk, int c ) : CSJ2K.j2k.image.DataBlk
blk CSJ2K.j2k.image.DataBlk
c int
return CSJ2K.j2k.image.DataBlk

getCompImgHeight() public method

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).
public getCompImgHeight ( int c ) : int
c int The index of the component, from 0 to C-1. /// ///
return int

getCompImgWidth() public method

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).
public getCompImgWidth ( int c ) : int
c int The index of the component, from 0 to C-1. /// ///
return int

getCompSubsX() public method

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.
public getCompSubsX ( int c ) : int
c int The index of the component (between 0 and C-1) /// ///
return int

getCompSubsY() public method

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.
public getCompSubsY ( int c ) : int
c int The index of the component (between 0 and C-1) /// ///
return int

getCompULX() public method

Returns the horizontal coordinate of the upper-left corner of the specified component in the current tile.
public getCompULX ( int c ) : int
c int The component index. /// ///
return int

getCompULY() public method

Returns the vertical coordinate of the upper-left corner of the specified component in the current tile.
public getCompULY ( int c ) : int
c int The component index. /// ///
return int

getFixedPoint() public abstract method

public abstract getFixedPoint ( int c ) : int
c int
return int

getInternCompData() public abstract method

public abstract getInternCompData ( CSJ2K.j2k.image.DataBlk blk, int c ) : CSJ2K.j2k.image.DataBlk
blk CSJ2K.j2k.image.DataBlk
c int
return CSJ2K.j2k.image.DataBlk

getNomRangeBits() public abstract method

public abstract getNomRangeBits ( int c ) : int
c int
return int

getNumTiles() public method

Returns the number of tiles in the horizontal and vertical directions. This default implementation assumes no tiling, so (1,1) is always returned.
public getNumTiles ( Coord co ) : Coord
co Coord If not null this object is used to return the information. If /// null a new one is created and returned. /// ///
return Coord

getNumTiles() public method

Returns the total number of tiles in the image. This default implementation assumes no tiling, so 1 is always returned.
public getNumTiles ( ) : int
return int

getTile() public method

Returns the coordinates of the current tile. This default implementation assumes no-tiling, so (0,0) is returned.
public getTile ( Coord co ) : Coord
co Coord If not null this object is used to return the information. If /// null a new one is created and returned. /// ///
return Coord

getTileCompHeight() public method

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).
public getTileCompHeight ( int t, int c ) : int
t int The tile index /// ///
c int The index of the component, from 0 to C-1. /// ///
return int

getTileCompWidth() public method

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).
public getTileCompWidth ( int t, int c ) : int
t int Tile index /// ///
c int The index of the component, from 0 to C-1. /// ///
return int

isOrigSigned() public abstract method

Returns true if the data read was originally signed in the specified component, false if not.
public abstract isOrigSigned ( int c ) : bool
c int The index of the component, from 0 to C-1. /// ///
return bool

nextTile() public method

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.
public nextTile ( ) : void
return void

setTile() public method

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.
public setTile ( int x, int y ) : void
x int The horizontal coordinate of the tile. /// ///
y int The vertical coordinate of the new tile. /// ///
return void

Property Details

h protected_oe property

The height of the image
protected int h
return int

nc protected_oe property

The number of components in the image
protected int nc
return int

w protected_oe property

The width of the image
protected int w
return int