C# Класс 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.

Наследование: BlkImgDataSrc
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
h int
nc int
w int

Открытые методы

Метод Описание
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.

Описание методов

close() публичный абстрактный Метод

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
Результат void

getCompData() публичный абстрактный Метод

public abstract getCompData ( CSJ2K.j2k.image.DataBlk blk, int c ) : CSJ2K.j2k.image.DataBlk
blk CSJ2K.j2k.image.DataBlk
c int
Результат CSJ2K.j2k.image.DataBlk

getCompImgHeight() публичный Метод

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. /// ///
Результат int

getCompImgWidth() публичный Метод

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. /// ///
Результат int

getCompSubsX() публичный Метод

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) /// ///
Результат int

getCompSubsY() публичный Метод

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) /// ///
Результат int

getCompULX() публичный Метод

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. /// ///
Результат int

getCompULY() публичный Метод

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. /// ///
Результат int

getFixedPoint() публичный абстрактный Метод

public abstract getFixedPoint ( int c ) : int
c int
Результат int

getInternCompData() публичный абстрактный Метод

public abstract getInternCompData ( CSJ2K.j2k.image.DataBlk blk, int c ) : CSJ2K.j2k.image.DataBlk
blk CSJ2K.j2k.image.DataBlk
c int
Результат CSJ2K.j2k.image.DataBlk

getNomRangeBits() публичный абстрактный Метод

public abstract getNomRangeBits ( int c ) : int
c int
Результат int

getNumTiles() публичный Метод

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. /// ///
Результат Coord

getNumTiles() публичный Метод

Returns the total number of tiles in the image. This default implementation assumes no tiling, so 1 is always returned.
public getNumTiles ( ) : int
Результат int

getTile() публичный Метод

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. /// ///
Результат Coord

getTileCompHeight() публичный Метод

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. /// ///
Результат int

getTileCompWidth() публичный Метод

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. /// ///
Результат int

isOrigSigned() публичный абстрактный Метод

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. /// ///
Результат bool

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.
public nextTile ( ) : void
Результат void

setTile() публичный Метод

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. /// ///
Результат void

Описание свойств

h защищенное свойство

The height of the image
protected int h
Результат int

nc защищенное свойство

The number of components in the image
protected int nc
Результат int

w защищенное свойство

The width of the image
protected int w
Результат int