C# Class CSJ2K.j2k.image.invcomptransf.InvCompTransf

This class apply inverse component transformations to the tiles depending on specification read from the codestream header. These transformations can be used to improve compression efficiency but are not related to colour transforms used to map colour values for display purposes. JPEG 2000 part I defines 2 component transformations: RCT (Reversible Component Transformation) and ICT (Irreversible Component Transformation).
Inheritance: CSJ2K.j2k.image.ImgDataAdapter, BlkImgDataSrc
Show file Open project: cureos/csj2k Class Usage Examples

Public Methods

Method Description
InvCompTransf ( BlkImgDataSrc imgSrc, DecoderSpecs decSpec, int utdepth, CSJ2K.j2k.util.ParameterList pl ) : System

Constructs a new ForwCompTransf object that operates on the specified source of image data.

ToString ( ) : System.String

Returns a string with a descriptive text of which inverse component transformation is used. This can be either "Inverse RCT" or "Inverse ICT" or "No component transformation" depending on the current tile.

calcMixedBitDepths ( int utdepth, int ttype, int tdepth ) : int[]

Calculates the bitdepths of the transformed components, given the bitdepth of the un-transformed components and the component tranformation type.

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

Apply inverse component transformation associated with the current tile. If no component transformation has been requested by the user, data are not modified.

This method calls the getInternCompData() method, but respects the definitions of the getCompData() method defined in the BlkImgDataSrc interface.

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.

This default implementation assumes that the number of fractional bits is not modified by the component mixer.

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

Apply the inverse component transformation associated with the current tile. If no component transformation has been requested by the user, data are not modified. Else, appropriate method is called (invRCT or invICT).

getNomRangeBits ( int c ) : int

Returns the number of bits, referred to as the "range bits", corresponding to the nominal range of the data in the specified component. If this number is b then for unsigned data the nominal range is between 0 and 2^b-1, and for signed data it is between -2^(b-1) and 2^(b-1)-1.

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). An NoNextElementException is thrown if the current tile is the last one (i.e. there is no next tile).

This default implementation just advances to the next tile in the source and re-initializes properly component transformation variables.

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.

This default implementation changes the tile in the source and re-initializes properly component transformation variables..

Private Methods

Method Description
invICT ( CSJ2K.j2k.image.DataBlk blk, int c ) : CSJ2K.j2k.image.DataBlk

Apply inverse irreversible component transformation to obtain requested component from specified block of data. Whatever the type of requested DataBlk, it always returns a DataBlkFloat.

invRCT ( CSJ2K.j2k.image.DataBlk blk, int c ) : CSJ2K.j2k.image.DataBlk

Apply inverse component transformation to obtain requested component from specified block of data. Whatever the type of requested DataBlk, it always returns a DataBlkInt.

Method Details

InvCompTransf() public method

Constructs a new ForwCompTransf object that operates on the specified source of image data.
public InvCompTransf ( BlkImgDataSrc imgSrc, DecoderSpecs decSpec, int utdepth, CSJ2K.j2k.util.ParameterList pl ) : System
imgSrc BlkImgDataSrc The source from where to get the data to be /// transformed /// ///
decSpec CSJ2K.j2k.decoder.DecoderSpecs The decoder specifications /// ///
utdepth int The bit depth of the un-transformed components /// ///
pl CSJ2K.j2k.util.ParameterList The command line optinons of the decoder /// ///
return System

ToString() public method

Returns a string with a descriptive text of which inverse component transformation is used. This can be either "Inverse RCT" or "Inverse ICT" or "No component transformation" depending on the current tile.
public ToString ( ) : System.String
return System.String

calcMixedBitDepths() public static method

Calculates the bitdepths of the transformed components, given the bitdepth of the un-transformed components and the component tranformation type.
public static calcMixedBitDepths ( int utdepth, int ttype, int tdepth ) : int[]
utdepth int The bitdepth of each un-transformed component /// ///
ttype int The type ID of the inverse component tranformation /// ///
tdepth int If not null the results are stored in this /// array, otherwise a new array is allocated and returned. /// ///
return int[]

close() public method

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

getCompData() public method

Apply inverse component transformation associated with the current tile. If no component transformation has been requested by the user, data are not modified.

This method calls the getInternCompData() method, but respects the definitions of the getCompData() method defined in the BlkImgDataSrc interface.

public getCompData ( CSJ2K.j2k.image.DataBlk blk, int c ) : CSJ2K.j2k.image.DataBlk
blk CSJ2K.j2k.image.DataBlk Determines the rectangular area to return, and the /// data is returned in this object. /// ///
c int Index of the output component. /// ///
return CSJ2K.j2k.image.DataBlk

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.

This default implementation assumes that the number of fractional bits is not modified by the component mixer.

public getFixedPoint ( int c ) : int
c int The index of the component. /// ///
return int

getInternCompData() public method

Apply the inverse component transformation associated with the current tile. If no component transformation has been requested by the user, data are not modified. Else, appropriate method is called (invRCT or invICT).
public getInternCompData ( CSJ2K.j2k.image.DataBlk blk, int c ) : CSJ2K.j2k.image.DataBlk
blk CSJ2K.j2k.image.DataBlk Determines the rectangular area to return. /// ///
c int Index of the output component. /// ///
return CSJ2K.j2k.image.DataBlk

getNomRangeBits() public method

Returns the number of bits, referred to as the "range bits", corresponding to the nominal range of the data in the specified component. If this number is b then for unsigned data the nominal range is between 0 and 2^b-1, and for signed data it is between -2^(b-1) and 2^(b-1)-1.
public getNomRangeBits ( int c ) : int
c int The index of the component. /// ///
return int

isOrigSigned() public method

Returns true if the data read was originally signed in the specified component, false if not.
public 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). An NoNextElementException is thrown if the current tile is the last one (i.e. there is no next tile).

This default implementation just advances to the next tile in the source and re-initializes properly component transformation variables.

public nextTile ( ) : void
return void

setTile() public method

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

This default implementation changes the tile in the source and re-initializes properly component transformation variables..

public setTile ( int x, int y ) : void
x int The horizontal index of the tile. /// ///
y int The vertical index of the new tile. /// /// ///
return void