C# Класс CSJ2K.j2k.image.forwcomptransf.ForwCompTransf

This class apply component transformations to the tiles depending on user specifications. 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).
Наследование: CSJ2K.j2k.image.ImgDataAdapter, BlkImgDataSrc
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
ForwCompTransf ( BlkImgDataSrc imgSrc, CSJ2K.j2k.encoder.EncoderSpecs encSpec ) : 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 forward component transformation is used. This can be either "Forward RCT" or "Forward ICT" or "No component transformation" depending on the current tile.

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

Calculates the bitdepths of the transformed components, given the bitdepth of the un-transformed components and the component transformation 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 forward 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 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 (forwRCT or forwICT).

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 and in the current tile. 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. Note that this value can be affected by the multiple component transform.

isOrigSigned ( int c ) : bool

Returns true if the data read was originally signed in the specified component, false if not.

nextTile ( ) : void

Goes to the next tile, in standard scan-line order (by rows then by 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..

Приватные методы

Метод Описание
forwICT ( CSJ2K.j2k.image.DataBlk blk, int c ) : CSJ2K.j2k.image.DataBlk

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

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

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

initForwICT ( ) : void

Initialize some variables used with ICT. It must be called, at least, at the beginning of a new tile.

initForwRCT ( ) : void

Initialize some variables used with RCT. It must be called, at least, at the beginning of each new tile.

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

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

Constructs a new ForwCompTransf object that operates on the specified source of image data.
public ForwCompTransf ( BlkImgDataSrc imgSrc, CSJ2K.j2k.encoder.EncoderSpecs encSpec ) : System
imgSrc BlkImgDataSrc The source from where to get the data to be transformed /// ///
encSpec CSJ2K.j2k.encoder.EncoderSpecs The encoder specifications /// ///
Результат System

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

Returns a string with a descriptive text of which forward component transformation is used. This can be either "Forward RCT" or "Forward ICT" or "No component transformation" depending on the current tile.
public ToString ( ) : System.String
Результат System.String

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

Calculates the bitdepths of the transformed components, given the bitdepth of the un-transformed components and the component transformation type.
public static calcMixedBitDepths ( int ntdepth, int ttype, int tdepth ) : int[]
ntdepth int The bitdepth of each non-transformed components. /// ///
ttype int The type ID of the component transformation. /// ///
tdepth int If not null the results are stored in this array, /// otherwise a new array is allocated and returned. /// ///
Результат int[]

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

Closes the underlying file or network connection from where the image data is being read.
If an I/O error occurs. ///
public close ( ) : void
Результат void

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

Apply forward 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. /// ///
Результат CSJ2K.j2k.image.DataBlk

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

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

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

Apply the 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 (forwRCT or forwICT).
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. /// ///
Результат CSJ2K.j2k.image.DataBlk

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

Returns the number of bits, referred to as the "range bits", corresponding to the nominal range of the data in the specified component and in the current tile. 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. Note that this value can be affected by the multiple component transform.
public getNomRangeBits ( int c ) : int
c int The index of the component. /// ///
Результат int

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

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

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

Goes to the next tile, in standard scan-line order (by rows then by 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
Результат void

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

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