C# Класс CSJ2K.j2k.codestream.reader.BitstreamReaderAgent

This is the generic interface for bit stream reader agents. A bit stream reader agent is an entity that allows reading from a bit stream and requesting compressed code-blocks. It can be a simple file reader, or a network connection, or anything else.

The bit stream reader agent allows to make request for compressed block data in any order. The amount of data returned would normally depend on the data available at the time of the request, be it from a file or from a network connection.

The bit stream reader agent has the notion of a current tile, and coordinates are relative to the current tile, where applicable.

Resolution level 0 is the lowest resolution level, i.e. the LL subband alone.

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

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

Свойство Тип Описание
anbytes int
arate float
ax int
ay int
ctX int
ctY int
culx int[]
culy int[]
decSpec CSJ2K.j2k.decoder.DecoderSpecs
derived bool[]
gb int[]
hd HeaderDecoder
imgH int
imgW int
mdl int[]
nc int
nt int
ntH int
ntW int
ntX int
ntY int
offX int[]
offY int[]
params_Renamed CSJ2K.j2k.quantization.dequantizer.StdDequantizerParams[]
px int
py int
subbTrees CSJ2K.j2k.wavelet.synthesis.SubbandSyn[]
targetRes int
tnbytes int
trate float

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

Метод Описание
createInstance ( RandomAccessIO in_Renamed, HeaderDecoder hd, CSJ2K.j2k.util.ParameterList pl, DecoderSpecs decSpec, bool cdstrInfo, HeaderInfo hi ) : BitstreamReaderAgent

Creates a bit stream reader of the correct type that works on the provided RandomAccessIO, with the special parameters from the parameter list.

getCodeBlock ( int param1, int param2, int param3, CSJ2K param4, int param5, int param6, CSJ2K param7 ) : CSJ2K.j2k.entropy.decoder.DecLyrdCBlk
getCompImgHeight ( int c, int rl ) : int

Returns the height in pixels of the specified component in the overall image, for the given (component) resolution level.

Note: Component resolution level indexes may differ from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of same component of each tile.

Example: For an image (2 tiles) with 1 component (tile 0 having 2 decomposition levels and tile 1 having 3 decomposition levels), the first tile(-component) has 3 resolution levels and the second one has 4 resolution levels, whereas the component has only 3 resolution levels available.

getCompImgWidth ( int c, int rl ) : int

Returns the width in pixels of the specified component in the overall image, for the given (component) resolution level.

Note: Component resolution level indexes may differ from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of same component of each tile.

Example: For an image (2 tiles) with 1 component (tile 0 having 2 decomposition levels and tile 1 having 3 decomposition levels), the first tile(-component) has 3 resolution levels and the second one has 4 resolution levels, whereas the component has only 3 resolution levels available.

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.

getImgHeight ( int rl ) : int

Returns the overall height of the image in pixels, for the given resolution level. This is the image's height without accounting for any component subsampling or tiling.

Note: Image resolution level indexes may differ from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of each component of each tile.

Example: For an image (1 tile) with 2 components (component 0 having 2 decomposition levels and component 1 having 3 decomposition levels), the first (tile-) component has 3 resolution levels and the second one has 4 resolution levels, whereas the image has only 3 resolution levels available.

getImgULX ( int rl ) : int

Returns the horizontal coordinate of the image origin, the top-left corner, in the canvas system, on the reference grid at the specified resolution level.

Note: Image resolution level indexes may differ from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of each component of each tile.

Example: For an image (1 tile) with 2 components (component 0 having 2 decomposition levels and component 1 having 3 decomposition levels), the first (tile-) component has 3 resolution levels and the second one has 4 resolution levels, whereas the image has only 3 resolution levels available.

getImgULY ( int rl ) : int

Returns the vertical coordinate of the image origin, the top-left corner, in the canvas system, on the reference grid at the specified resolution level.

Note: Image resolution level indexes may differ from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of each component of each tile.

Example: For an image (1 tile) with 2 components (component 0 having 2 decomposition levels and component 1 having 3 decomposition levels), the first (tile-) component has 3 resolution levels and the second one has 4 resolution levels, whereas the image has only 3 resolution levels available.

getImgWidth ( int rl ) : int

Returns the overall width of the image in pixels, for the given (image) resolution level. This is the image's width without accounting for any component subsampling or tiling.

Note: Image resolution level indexes may differ from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of each component of each tile.

Example: For an image (1 tile) with 2 components (component 0 having 2 decomposition levels and component 1 having 3 decomposition levels), the first (tile-) component has 3 resolution levels and the second one has 4 resolution levels, whereas the image has only 3 resolution levels available.

getNumTiles ( Coord co ) : Coord

Returns the number of tiles in the horizontal and vertical directions.

getNumTiles ( ) : int

Returns the total number of tiles in the image.

getPPX ( int t, int c, int rl ) : int

Returns the precinct partition width for the specified tile-component and (tile-component) resolution level.

getPPY ( int t, int c, int rl ) : int

Returns the precinct partition height for the specified tile-component and (tile-component) resolution level.

getResULX ( int c, int rl ) : int

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

getResULY ( int c, int rl ) : int

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

getSynSubbandTree ( int t, int c ) : CSJ2K.j2k.wavelet.synthesis.SubbandSyn

Returns the subband tree, for the specified tile-component. This method returns the root element of the subband tree structure, see Subband and SubbandSyn. The tree comprises all the available resolution levels.

Note: this method is not able to return subband tree for a tile different than the current one.

The number of magnitude bits ('magBits' member variable) for each subband is not initialized.

getTile ( Coord co ) : Coord

Returns the indexes of the current tile. These are the horizontal and vertical indexes of the current tile.

getTileCompHeight ( int t, int c, int rl ) : int

Returns the height in pixels of the specified tile-component for the given (tile-component) resolution level.

getTileCompWidth ( int t, int c, int rl ) : int

Returns the width in pixels of the specified tile-component for the given (tile-component) resolution level.

getTileHeight ( int rl ) : int

Returns the overall height of the current tile in pixels, for the given resolution level. This is the tile's height without accounting for any component subsampling.

Note: Tile resolution level indexes may be different from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of each component of the tile.

For an image (1 tile) with 2 components (component 0 having 2 decomposition levels and component 1 having 3 decomposition levels), the first (tile-)component has 3 resolution levels and the second one has 4 resolution levels, whereas the tile has only 3 resolution levels available.

getTileWidth ( int rl ) : int

Returns the overall width of the current tile in pixels for the given (tile) resolution level. This is the tile's width without accounting for any component subsampling.

Note: Tile resolution level indexes may be different from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of each component of the tile.

For an image (1 tile) with 2 components (component 0 having 2 decomposition levels and component 1 having 3 decomposition levels), the first (tile-)component has 3 resolution levels and the second one has 4 resolution levels, whereas the tile has only 3 resolution levels available.

nextTile ( ) : void

Advances to the next tile, in standard scan-line order (by rows then columns). An NoNextElementException is thrown if the current tile is the last one (i.e. there is no next tile).

setTile ( int x, int y ) : void

Changes the current tile, given the new indexes. An IllegalArgumentException is thrown if the indexes do not correspond to a valid tile.

Защищенные методы

Метод Описание
BitstreamReaderAgent ( HeaderDecoder hd, DecoderSpecs decSpec ) : System

Initializes members of this class. This constructor takes a HeaderDecoder object. This object must be initialized by the constructor of the implementing class from the header of the bit stream.

initSubbandsFields ( int c, CSJ2K.j2k.wavelet.synthesis.SubbandSyn sb ) : void

Initialises subbands fields, such as number of code-blocks, code-blocks dimension and number of magnitude bits, in the subband tree. The nominal code-block width/height depends on the precincts dimensions if used. The way the number of magnitude bits is computed depends on the quantization type (reversible, derived, expounded).

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

BitstreamReaderAgent() защищенный Метод

Initializes members of this class. This constructor takes a HeaderDecoder object. This object must be initialized by the constructor of the implementing class from the header of the bit stream.
protected BitstreamReaderAgent ( HeaderDecoder hd, DecoderSpecs decSpec ) : System
hd HeaderDecoder The decoded header of the bit stream from where to initialize /// the values. /// ///
decSpec CSJ2K.j2k.decoder.DecoderSpecs The decoder specifications /// ///
Результат System

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

Creates a bit stream reader of the correct type that works on the provided RandomAccessIO, with the special parameters from the parameter list.
If an I/O error occurs while reading initial /// data from the bit stream. /// If an unrecognised bit stream /// reader option is present. /// ///
public static createInstance ( RandomAccessIO in_Renamed, HeaderDecoder hd, CSJ2K.j2k.util.ParameterList pl, DecoderSpecs decSpec, bool cdstrInfo, HeaderInfo hi ) : BitstreamReaderAgent
in_Renamed RandomAccessIO
hd HeaderDecoder Header of the codestream. /// ///
pl CSJ2K.j2k.util.ParameterList The parameter list containing parameters applicable to the /// bit stream read (other parameters may also be present). /// ///
decSpec CSJ2K.j2k.decoder.DecoderSpecs The decoder specifications /// ///
cdstrInfo bool Whether or not to print information found in /// codestream. /// ///
hi CSJ2K.j2k.codestream.HeaderInfo Reference to the HeaderInfo instance. /// ///
Результат BitstreamReaderAgent

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

public abstract getCodeBlock ( int param1, int param2, int param3, CSJ2K param4, int param5, int param6, CSJ2K param7 ) : CSJ2K.j2k.entropy.decoder.DecLyrdCBlk
param1 int
param2 int
param3 int
param4 CSJ2K
param5 int
param6 int
param7 CSJ2K
Результат CSJ2K.j2k.entropy.decoder.DecLyrdCBlk

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

Returns the height in pixels of the specified component in the overall image, for the given (component) resolution level.

Note: Component resolution level indexes may differ from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of same component of each tile.

Example: For an image (2 tiles) with 1 component (tile 0 having 2 decomposition levels and tile 1 having 3 decomposition levels), the first tile(-component) has 3 resolution levels and the second one has 4 resolution levels, whereas the component has only 3 resolution levels available.

public getCompImgHeight ( int c, int rl ) : int
c int The index of the component, from 0 to N-1. /// ///
rl int The resolution level, from 0 to L. /// ///
Результат int

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

Returns the width in pixels of the specified component in the overall image, for the given (component) resolution level.

Note: Component resolution level indexes may differ from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of same component of each tile.

Example: For an image (2 tiles) with 1 component (tile 0 having 2 decomposition levels and tile 1 having 3 decomposition levels), the first tile(-component) has 3 resolution levels and the second one has 4 resolution levels, whereas the component has only 3 resolution levels available.

public getCompImgWidth ( int c, int rl ) : int
c int The index of the component, from 0 to N-1. /// ///
rl int The resolution level, from 0 to L. /// ///
Результат 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 N-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

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

Returns the overall height of the image in pixels, for the given resolution level. This is the image's height without accounting for any component subsampling or tiling.

Note: Image resolution level indexes may differ from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of each component of each tile.

Example: For an image (1 tile) with 2 components (component 0 having 2 decomposition levels and component 1 having 3 decomposition levels), the first (tile-) component has 3 resolution levels and the second one has 4 resolution levels, whereas the image has only 3 resolution levels available.

public getImgHeight ( int rl ) : int
rl int The image resolution level, from 0 to L. /// ///
Результат int

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

Returns the horizontal coordinate of the image origin, the top-left corner, in the canvas system, on the reference grid at the specified resolution level.

Note: Image resolution level indexes may differ from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of each component of each tile.

Example: For an image (1 tile) with 2 components (component 0 having 2 decomposition levels and component 1 having 3 decomposition levels), the first (tile-) component has 3 resolution levels and the second one has 4 resolution levels, whereas the image has only 3 resolution levels available.

public getImgULX ( int rl ) : int
rl int The resolution level, from 0 to L. /// ///
Результат int

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

Returns the vertical coordinate of the image origin, the top-left corner, in the canvas system, on the reference grid at the specified resolution level.

Note: Image resolution level indexes may differ from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of each component of each tile.

Example: For an image (1 tile) with 2 components (component 0 having 2 decomposition levels and component 1 having 3 decomposition levels), the first (tile-) component has 3 resolution levels and the second one has 4 resolution levels, whereas the image has only 3 resolution levels available.

public getImgULY ( int rl ) : int
rl int The resolution level, from 0 to L. /// ///
Результат int

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

Returns the overall width of the image in pixels, for the given (image) resolution level. This is the image's width without accounting for any component subsampling or tiling.

Note: Image resolution level indexes may differ from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of each component of each tile.

Example: For an image (1 tile) with 2 components (component 0 having 2 decomposition levels and component 1 having 3 decomposition levels), the first (tile-) component has 3 resolution levels and the second one has 4 resolution levels, whereas the image has only 3 resolution levels available.

public getImgWidth ( int rl ) : int
rl int The image resolution level. /// ///
Результат int

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

Returns the number of tiles in the horizontal and vertical directions.
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.
public getNumTiles ( ) : int
Результат int

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

Returns the precinct partition width for the specified tile-component and (tile-component) resolution level.
public getPPX ( int t, int c, int rl ) : int
t int the tile index /// ///
c int The index of the component (between 0 and N-1) /// ///
rl int The resolution level, from 0 to L. /// ///
Результат int

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

Returns the precinct partition height for the specified tile-component and (tile-component) resolution level.
public getPPY ( int t, int c, int rl ) : int
t int The tile index /// ///
c int The index of the component (between 0 and N-1) /// ///
rl int The resolution level, from 0 to L. /// ///
Результат int

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

Returns the horizontal coordinate of the upper-left corner of the specified resolution in the given component of the current tile.
public getResULX ( int c, int rl ) : int
c int The component index. /// ///
rl int The resolution level index. /// ///
Результат int

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

Returns the vertical coordinate of the upper-left corner of the specified component in the given component of the current tile.
public getResULY ( int c, int rl ) : int
c int The component index. /// ///
rl int The resolution level index. /// ///
Результат int

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

Returns the subband tree, for the specified tile-component. This method returns the root element of the subband tree structure, see Subband and SubbandSyn. The tree comprises all the available resolution levels.

Note: this method is not able to return subband tree for a tile different than the current one.

The number of magnitude bits ('magBits' member variable) for each subband is not initialized.

public getSynSubbandTree ( int t, int c ) : CSJ2K.j2k.wavelet.synthesis.SubbandSyn
t int The tile index /// ///
c int The index of the component, from 0 to C-1. /// ///
Результат CSJ2K.j2k.wavelet.synthesis.SubbandSyn

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

Returns the indexes of the current tile. These are the horizontal and vertical indexes of the current tile.
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 for the given (tile-component) resolution level.
public getTileCompHeight ( int t, int c, int rl ) : int
t int The tile index. /// ///
c int The index of the component, from 0 to N-1. /// ///
rl int The resolution level, from 0 to L. /// ///
Результат int

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

Returns the width in pixels of the specified tile-component for the given (tile-component) resolution level.
public getTileCompWidth ( int t, int c, int rl ) : int
t int The tile index /// ///
c int The index of the component, from 0 to N-1. /// ///
rl int The resolution level, from 0 to L. /// ///
Результат int

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

Returns the overall height of the current tile in pixels, for the given resolution level. This is the tile's height without accounting for any component subsampling.

Note: Tile resolution level indexes may be different from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of each component of the tile.

For an image (1 tile) with 2 components (component 0 having 2 decomposition levels and component 1 having 3 decomposition levels), the first (tile-)component has 3 resolution levels and the second one has 4 resolution levels, whereas the tile has only 3 resolution levels available.

public getTileHeight ( int rl ) : int
rl int The (tile) resolution level. /// ///
Результат int

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

Returns the overall width of the current tile in pixels for the given (tile) resolution level. This is the tile's width without accounting for any component subsampling.

Note: Tile resolution level indexes may be different from tile-component resolution index. They are indeed indexed starting from the lowest number of decomposition levels of each component of the tile.

For an image (1 tile) with 2 components (component 0 having 2 decomposition levels and component 1 having 3 decomposition levels), the first (tile-)component has 3 resolution levels and the second one has 4 resolution levels, whereas the tile has only 3 resolution levels available.

public getTileWidth ( int rl ) : int
rl int The (tile) resolution level. /// ///
Результат int

initSubbandsFields() защищенный Метод

Initialises subbands fields, such as number of code-blocks, code-blocks dimension and number of magnitude bits, in the subband tree. The nominal code-block width/height depends on the precincts dimensions if used. The way the number of magnitude bits is computed depends on the quantization type (reversible, derived, expounded).
protected initSubbandsFields ( int c, CSJ2K.j2k.wavelet.synthesis.SubbandSyn sb ) : void
c int The component index /// ///
sb CSJ2K.j2k.wavelet.synthesis.SubbandSyn The subband tree to be initialised. /// ///
Результат void

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

Advances to the next tile, in standard scan-line order (by rows then columns). An NoNextElementException is thrown if the current tile is the last one (i.e. there is no next tile).
public abstract nextTile ( ) : void
Результат void

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

Changes the current tile, given the new indexes. An IllegalArgumentException is thrown if the indexes do not correspond to a valid tile.
public abstract setTile ( int x, int y ) : void
x int The horizontal indexes the tile. /// ///
y int The vertical indexes of the new tile. /// ///
Результат void

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

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

Actual number of read bytes
protected int anbytes
Результат int

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

Actual decoding rate in bpp
protected float arate
Результат float

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

The horizontal coordinate of the image origin in the canvas system, on the reference grid.
protected int ax
Результат int

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

The vertical coordinate of the image origin in the canvas system, on the reference grid.
protected int ay
Результат int

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

The current tile horizontal index
protected int ctX
Результат int

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

The current tile vertical index
protected int ctY
Результат int

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

The horizontal coordinates of the upper-left corner of the active tile, with respect to the canvas origin, in the component hi-res grid, for each component.
protected int[] culx
Результат int[]

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

The vertical coordinates of the upper-left corner of the active tile, with respect to the canvas origin, in the component hi-res grid, for each component.
protected int[] culy
Результат int[]

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

The decoder specifications
protected DecoderSpecs,CSJ2K.j2k.decoder decSpec
Результат CSJ2K.j2k.decoder.DecoderSpecs

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

Whether or not the components in the current tile uses a derived quantization step size (only relevant in non reversible quantization mode). This field is actualized by the setTile method in FileBitstreamReaderAgent.
protected bool[] derived
Результат bool[]

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

Number of guard bits off all component in the current tile. This field is actualized by the setTile method in FileBitstreamReaderAgent.
protected int[] gb
Результат int[]

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

The decoded bit stream header
protected HeaderDecoder,CSJ2K.j2k.codestream.reader hd
Результат HeaderDecoder

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

The image width on the hi-res reference grid
protected int imgH
Результат int

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

The image width on the hi-res reference grid
protected int imgW
Результат int

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

The maximum number of decompostion levels for each component of the current tile. It means that component c has mdl[c]+1 resolution levels (indexed from 0 to mdl[c])
protected int[] mdl
Результат int[]

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

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

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

The total number of tiles
protected int nt
Результат int

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

The nominal tile height, in the hi-res reference grid
protected int ntH
Результат int

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

The nominal tile width, in the hi-res reference grid
protected int ntW
Результат int

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

The number of tile in the horizontal direction
protected int ntX
Результат int

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

The number of tiles in the vertical direction
protected int ntY
Результат int

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

The horizontal offsets of the upper-left corner of the current tile (not active tile) with respect to the canvas origin, in the component hi-res grid, for each component.
protected int[] offX
Результат int[]

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

The vertical offsets of the upper-left corner of the current tile (not active tile) with respect to the canvas origin, in the component hi-res grid, for each component.
protected int[] offY
Результат int[]

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

Dequantization parameters of all subbands and all components in the current tile. The value is actualized by the setTile method in FileBitstreamReaderAgent.
protected StdDequantizerParams[],CSJ2K.j2k.quantization.dequantizer params_Renamed
Результат CSJ2K.j2k.quantization.dequantizer.StdDequantizerParams[]

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

The horizontal coordinate of the tiling origin in the canvas system, on the reference grid.
protected int px
Результат int

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

The vertical coordinate of the tiling origin in the canvas system, on the reference grid.
protected int py
Результат int

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

The subband trees for each component in the current tile. Each element in the array is the root element of the subband tree for a component. The number of magnitude bits in each subband (magBits member variable) is not initialized.
protected SubbandSyn[],CSJ2K.j2k.wavelet.synthesis subbTrees
Результат CSJ2K.j2k.wavelet.synthesis.SubbandSyn[]

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

Image resolution level to generate
protected int targetRes
Результат int

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

Number of bytes targeted to be read
protected int tnbytes
Результат int

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

Target decoding rate in bpp
protected float trate
Результат float