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
Afficher le fichier Open project: cureos/csj2k

Protected Properties

Свойство Type Description
h int
nc int
w int

Méthodes publiques

Méthode 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 méthode

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
Résultat void

getCompData() public abstract méthode

public abstract getCompData ( CSJ2K.j2k.image.DataBlk blk, int c ) : CSJ2K.j2k.image.DataBlk
blk CSJ2K.j2k.image.DataBlk
c int
Résultat CSJ2K.j2k.image.DataBlk

getCompImgHeight() public méthode

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. /// ///
Résultat int

getCompImgWidth() public méthode

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. /// ///
Résultat int

getCompSubsX() public méthode

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) /// ///
Résultat int

getCompSubsY() public méthode

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) /// ///
Résultat int

getCompULX() public méthode

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. /// ///
Résultat int

getCompULY() public méthode

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. /// ///
Résultat int

getFixedPoint() public abstract méthode

public abstract getFixedPoint ( int c ) : int
c int
Résultat int

getInternCompData() public abstract méthode

public abstract getInternCompData ( CSJ2K.j2k.image.DataBlk blk, int c ) : CSJ2K.j2k.image.DataBlk
blk CSJ2K.j2k.image.DataBlk
c int
Résultat CSJ2K.j2k.image.DataBlk

getNomRangeBits() public abstract méthode

public abstract getNomRangeBits ( int c ) : int
c int
Résultat int

getNumTiles() public méthode

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. /// ///
Résultat Coord

getNumTiles() public méthode

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

getTile() public méthode

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. /// ///
Résultat Coord

getTileCompHeight() public méthode

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. /// ///
Résultat int

getTileCompWidth() public méthode

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. /// ///
Résultat int

isOrigSigned() public abstract méthode

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. /// ///
Résultat bool

nextTile() public méthode

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
Résultat void

setTile() public méthode

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. /// ///
Résultat void

Property Details

h protected_oe property

The height of the image
protected int h
Résultat int

nc protected_oe property

The number of components in the image
protected int nc
Résultat int

w protected_oe property

The width of the image
protected int w
Résultat int