C# Class CSJ2K.j2k.wavelet.analysis.ForwWTFull

This class implements the ForwardWT abstract class with the full-page approach to be used either with integer or floating-point filters
Inheritance: ForwardWT
Mostra file Open project: cureos/csj2k

Public Methods

Method Description
ForwWTFull ( BlkImgDataSrc src, CSJ2K.j2k.encoder.EncoderSpecs encSpec, int cb0x, int cb0y ) : System

Initializes this object with the given source of image data and with all the decompositon parameters

getAnSubbandTree ( int t, int c ) : SubbandAn

Returns a reference to the subband tree structure representing the subband decomposition for the specified tile-component of the source.

getDataType ( int t, int c ) : int

Return the data type of this CBlkWTDataSrc. Its value should be either DataBlk.TYPE_INT or DataBlk.TYPE_FLOAT but can change according to the current tile-component.

getDecomp ( int t, int c ) : int

Returns the wavelet tree decomposition. Actually JPEG 2000 part 1 only supports WT_DECOMP_DYADIC decomposition.

getDecompLevels ( int t, int c ) : int

Returns the number of decomposition levels that are applied to the LL band, in the specified tile-component. A value of 0 means that no wavelet transform is applied.

getFixedPoint ( int c ) : int

Returns the position of the fixed point in the specified component. 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.

getHorAnWaveletFilters ( int t, int c ) : CSJ2K.j2k.wavelet.analysis.AnWTFilter[]

Returns the horizontal analysis wavelet filters used in each level, for the specified component and tile. The first element in the array is the filter used to obtain the lowest resolution (resolution level 0) subbands (i.e. lowest frequency LL subband), the second element is the one used to generate the resolution level 1 subbands, and so on. If there are less elements in the array than the number of resolution levels, then the last one is assumed to repeat itself.

The returned filters are applicable only to the specified component and in the current tile.

The resolution level of a subband is the resolution level to which a subband contributes, which is different from its decomposition level.

getImplementationType ( int c ) : int

Returns the implementation type of this wavelet transform, WT_IMPL_FULL (full-page based transform). All components return the same.

getNextCodeBlock ( int c, CSJ2K.j2k.wavelet.analysis.CBlkWTData cblk ) : CSJ2K.j2k.wavelet.analysis.CBlkWTData

Returns the next code-block in the current tile for the specified component, as a copy (see below). The order in which code-blocks are returned is not specified. However each code-block is returned only once and all code-blocks will be returned if the method is called 'N' times, where 'N' is the number of code-blocks in the tile. After all the code-blocks have been returned for the current tile calls to this method will return 'null'.

When changing the current tile (through 'setTile()' or 'nextTile()') this method will always return the first code-block, as if this method was never called before for the new current tile.

The data returned by this method is always a copy of the internal data of this object, and it can be modified "in place" without any problems after being returned. The 'offset' of the returned data is 0, and the 'scanw' is the same as the code-block width. The 'magbits' of the returned data is not set by this method and should be ignored. See the 'CBlkWTData' class.

The 'ulx' and 'uly' members of the returned 'CBlkWTData' object contain the coordinates of the top-left corner of the block, with respect to the tile, not the subband.

getNextInternCodeBlock ( int c, CSJ2K.j2k.wavelet.analysis.CBlkWTData cblk ) : CSJ2K.j2k.wavelet.analysis.CBlkWTData

Returns the next code-block in the current tile for the specified component. The order in which code-blocks are returned is not specified. However each code-block is returned only once and all code-blocks will be returned if the method is called 'N' times, where 'N' is the number of code-blocks in the tile. After all the code-blocks have been returned for the current tile calls to this method will return 'null'.

When changing the current tile (through 'setTile()' or 'nextTile()') this method will always return the first code-block, as if this method was never called before for the new current tile.

The data returned by this method is the data in the internal buffer of this object, and thus can not be modified by the caller. The 'offset' and 'scanw' of the returned data have, in general, some non-zero value. The 'magbits' of the returned data is not set by this method and should be ignored. See the 'CBlkWTData' class.

The 'ulx' and 'uly' members of the returned 'CBlkWTData' object contain the coordinates of the top-left corner of the block, with respect to the tile, not the subband.

getVertAnWaveletFilters ( int t, int c ) : CSJ2K.j2k.wavelet.analysis.AnWTFilter[]

Returns the vertical analysis wavelet filters used in each level, for the specified component and tile. The first element in the array is the filter used to obtain the lowest resolution (resolution level 0) subbands (i.e. lowest frequency LL subband), the second element is the one used to generate the resolution level 1 subbands, and so on. If there are less elements in the array than the number of resolution levels, then the last one is assumed to repeat itself.

The returned filters are applicable only to the specified component and in the current tile.

The resolution level of a subband is the resolution level to which a subband contributes, which is different from its decomposition level.

isReversible ( int t, int c ) : bool

Returns the reversibility of the wavelet transform for the specified component and tile. A wavelet transform is reversible when it is suitable for lossless and lossy-to-lossless compression.

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).

This method resets the 'subbTrees' array, and recalculates the values of the 'reversible' array. It also resets the decomposed component buffers.

setTile ( int x, int y ) : void

Changes the current tile, given the new coordinates.

This method resets the 'subbTrees' array, and recalculates the values of the 'reversible' array. It also resets the decomposed component buffers.

Private Methods

Method Description
getNextSubband ( int c ) : SubbandAn

Returns the next subband that will be used to get the next code-block to return by the getNext[Intern]CodeBlock method.

initSubbandsFields ( int t, int c, Subband sb ) : void

Initialises subbands fields, such as number of code-blocks and code-blocks dimension, in the subband tree. The nominal code-block width/height depends on the precincts dimensions if used.

wavelet2DDecomposition ( CSJ2K.j2k.image.DataBlk band, SubbandAn subband, int c ) : void

Performs the 2D forward wavelet transform on a subband of the initial band. This method will successively perform 1D filtering steps on all lines and then all columns of the subband. In this class only filters with floating point implementations can be used.

waveletTreeDecomposition ( CSJ2K.j2k.image.DataBlk band, SubbandAn subband, int c ) : void

Performs the forward wavelet transform on the whole band. It iteratively decomposes the subbands from the top node to the leaves.

Method Details

ForwWTFull() public method

Initializes this object with the given source of image data and with all the decompositon parameters
public ForwWTFull ( BlkImgDataSrc src, CSJ2K.j2k.encoder.EncoderSpecs encSpec, int cb0x, int cb0y ) : System
src BlkImgDataSrc From where the image data should be obtained. /// ///
encSpec CSJ2K.j2k.encoder.EncoderSpecs The encoder specifications /// ///
cb0x int The horizontal coordinate of the code-block partition /// origin on the reference grid. /// ///
cb0y int The vertical coordinate of the code-block partition origin /// on the reference grid. /// ///
return System

getAnSubbandTree() public method

Returns a reference to the subband tree structure representing the subband decomposition for the specified tile-component of the source.
public getAnSubbandTree ( int t, int c ) : SubbandAn
t int The index of the tile. /// ///
c int The index of the component. /// ///
return SubbandAn

getDataType() public method

Return the data type of this CBlkWTDataSrc. Its value should be either DataBlk.TYPE_INT or DataBlk.TYPE_FLOAT but can change according to the current tile-component.
public getDataType ( int t, int c ) : int
t int The index of the tile for which to return the data type. /// ///
c int The index of the component for which to return the data type. /// ///
return int

getDecomp() public method

Returns the wavelet tree decomposition. Actually JPEG 2000 part 1 only supports WT_DECOMP_DYADIC decomposition.
public getDecomp ( int t, int c ) : int
t int The tile-index /// ///
c int The index of the component. /// ///
return int

getDecompLevels() public method

Returns the number of decomposition levels that are applied to the LL band, in the specified tile-component. A value of 0 means that no wavelet transform is applied.
public getDecompLevels ( int t, int c ) : int
t int The tile index /// ///
c int The index of the component. /// ///
return int

getFixedPoint() public method

Returns the position of the fixed point in the specified component. 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.
public getFixedPoint ( int c ) : int
c int The index of the component. /// ///
return int

getHorAnWaveletFilters() public method

Returns the horizontal analysis wavelet filters used in each level, for the specified component and tile. The first element in the array is the filter used to obtain the lowest resolution (resolution level 0) subbands (i.e. lowest frequency LL subband), the second element is the one used to generate the resolution level 1 subbands, and so on. If there are less elements in the array than the number of resolution levels, then the last one is assumed to repeat itself.

The returned filters are applicable only to the specified component and in the current tile.

The resolution level of a subband is the resolution level to which a subband contributes, which is different from its decomposition level.

public getHorAnWaveletFilters ( int t, int c ) : CSJ2K.j2k.wavelet.analysis.AnWTFilter[]
t int The index of the tile for which to return the filters. /// ///
c int The index of the component for which to return the filters. /// ///
return CSJ2K.j2k.wavelet.analysis.AnWTFilter[]

getImplementationType() public method

Returns the implementation type of this wavelet transform, WT_IMPL_FULL (full-page based transform). All components return the same.
public getImplementationType ( int c ) : int
c int The index of the component. /// ///
return int

getNextCodeBlock() public method

Returns the next code-block in the current tile for the specified component, as a copy (see below). The order in which code-blocks are returned is not specified. However each code-block is returned only once and all code-blocks will be returned if the method is called 'N' times, where 'N' is the number of code-blocks in the tile. After all the code-blocks have been returned for the current tile calls to this method will return 'null'.

When changing the current tile (through 'setTile()' or 'nextTile()') this method will always return the first code-block, as if this method was never called before for the new current tile.

The data returned by this method is always a copy of the internal data of this object, and it can be modified "in place" without any problems after being returned. The 'offset' of the returned data is 0, and the 'scanw' is the same as the code-block width. The 'magbits' of the returned data is not set by this method and should be ignored. See the 'CBlkWTData' class.

The 'ulx' and 'uly' members of the returned 'CBlkWTData' object contain the coordinates of the top-left corner of the block, with respect to the tile, not the subband.

public getNextCodeBlock ( int c, CSJ2K.j2k.wavelet.analysis.CBlkWTData cblk ) : CSJ2K.j2k.wavelet.analysis.CBlkWTData
c int The component for which to return the next code-block. /// ///
cblk CSJ2K.j2k.wavelet.analysis.CBlkWTData If non-null this object will be used to return the new /// code-block. If null a new one will be allocated and returned. If the /// "data" array of the object is non-null it will be reused, if possible, /// to return the data. /// ///
return CSJ2K.j2k.wavelet.analysis.CBlkWTData

getNextInternCodeBlock() public method

Returns the next code-block in the current tile for the specified component. The order in which code-blocks are returned is not specified. However each code-block is returned only once and all code-blocks will be returned if the method is called 'N' times, where 'N' is the number of code-blocks in the tile. After all the code-blocks have been returned for the current tile calls to this method will return 'null'.

When changing the current tile (through 'setTile()' or 'nextTile()') this method will always return the first code-block, as if this method was never called before for the new current tile.

The data returned by this method is the data in the internal buffer of this object, and thus can not be modified by the caller. The 'offset' and 'scanw' of the returned data have, in general, some non-zero value. The 'magbits' of the returned data is not set by this method and should be ignored. See the 'CBlkWTData' class.

The 'ulx' and 'uly' members of the returned 'CBlkWTData' object contain the coordinates of the top-left corner of the block, with respect to the tile, not the subband.

public getNextInternCodeBlock ( int c, CSJ2K.j2k.wavelet.analysis.CBlkWTData cblk ) : CSJ2K.j2k.wavelet.analysis.CBlkWTData
c int The component for which to return the next code-block. /// ///
cblk CSJ2K.j2k.wavelet.analysis.CBlkWTData If non-null this object will be used to return the new /// code-block. If null a new one will be allocated and returned. /// ///
return CSJ2K.j2k.wavelet.analysis.CBlkWTData

getVertAnWaveletFilters() public method

Returns the vertical analysis wavelet filters used in each level, for the specified component and tile. The first element in the array is the filter used to obtain the lowest resolution (resolution level 0) subbands (i.e. lowest frequency LL subband), the second element is the one used to generate the resolution level 1 subbands, and so on. If there are less elements in the array than the number of resolution levels, then the last one is assumed to repeat itself.

The returned filters are applicable only to the specified component and in the current tile.

The resolution level of a subband is the resolution level to which a subband contributes, which is different from its decomposition level.

public getVertAnWaveletFilters ( int t, int c ) : CSJ2K.j2k.wavelet.analysis.AnWTFilter[]
t int The index of the tile for which to return the filters. /// ///
c int The index of the component for which to return the filters. /// ///
return CSJ2K.j2k.wavelet.analysis.AnWTFilter[]

isReversible() public method

Returns the reversibility of the wavelet transform for the specified component and tile. A wavelet transform is reversible when it is suitable for lossless and lossy-to-lossless compression.
public isReversible ( int t, int c ) : bool
t int The index of the tile. /// ///
c int The index of the component. /// ///
return bool

nextTile() public method

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).

This method resets the 'subbTrees' array, and recalculates the values of the 'reversible' array. It also resets the decomposed component buffers.

public nextTile ( ) : void
return void

setTile() public method

Changes the current tile, given the new coordinates.

This method resets the 'subbTrees' array, and recalculates the values of the 'reversible' array. It also resets the decomposed component buffers.

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