C# Class CSJ2K.Color.ColorSpaceMapper

This is the base class for all modules in the colorspace and icc profiling steps of the decoding chain. It is responsible for the allocation and iniitialization of all working storage. It provides several utilities which are of generic use in preparing DataBlks for use and provides default implementations for the getCompData and getInternCompData methods.
Inheritance: CSJ2K.j2k.image.ImgDataAdapter, BlkImgDataSrc
Afficher le fichier Open project: cureos/csj2k Class Usage Examples

Protected Properties

Свойство Type Description
computed ComputedComponents
csMap ColorSpace
dataFloat float[][]
dataInt int[][]
eol System.String
fixedPtBitsArray int[]
inFloat CSJ2K.j2k.image.DataBlkFloat[]
inInt CSJ2K.j2k.image.DataBlkInt[]
maxValueArray int[]
ncomps int
pl CSJ2K.j2k.util.ParameterList
shiftValueArray int[]
src BlkImgDataSrc
srcBlk CSJ2K.j2k.image.DataBlk[]
workDataFloat float[][]
workDataInt int[][]
workFloat DataBlkFloat[]
workInt DataBlkInt[]

Méthodes publiques

Méthode Description
close ( ) : void

Closes the underlying file or network connection from where the image data is being read.

createInstance ( BlkImgDataSrc src, ColorSpace csMap ) : BlkImgDataSrc

Factory method for creating instances of this class.

getCompData ( CSJ2K.j2k.image.DataBlk out_Renamed, int c ) : CSJ2K.j2k.image.DataBlk

Returns, in the blk argument, a block of image data containing the specifed rectangular area, in the specified component. The data is returned, as a copy of the internal data, therefore the returned data can be modified "in place".

The rectangular area to return is specified by the 'ulx', 'uly', 'w' and 'h' members of the 'blk' argument, relative to the current tile. These members are not modified by this method. The 'offset' of the returned data is 0, and the 'scanw' is the same as the block's width. See the 'DataBlk' class.

This method, in general, is less efficient than the 'getInternCompData()' method since, in general, it copies the data. However if the array of returned data is to be modified by the caller then this method is preferable.

If the data array in 'blk' is 'null', then a new one is created. If the data array is not 'null' then it is reused, and it must be large enough to contain the block's data. Otherwise an 'ArrayStoreException' or an 'IndexOutOfBoundsException' is thrown by the Java system.

The returned data may have its 'progressive' attribute set. In this case the returned data is only an approximation of the "final" data.

getFixedPoint ( 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. For floating point data this value is not applicable.

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

Returns, in the blk argument, a block of image data containing the specifed rectangular area, in the specified component. The data is returned, as a reference to the internal data, if any, instead of as a copy, therefore the returned data should not be modified.

The rectangular area to return is specified by the 'ulx', 'uly', 'w' and 'h' members of the 'blk' argument, relative to the current tile. These members are not modified by this method. The 'offset' and 'scanw' of the returned data can be arbitrary. See the 'DataBlk' class.

This method, in general, is more efficient than the 'getCompData()' method since it may not copy the data. However if the array of returned data is to be modified by the caller then the other method is probably preferable.

If possible, the data in the returned 'DataBlk' should be the internal data itself, instead of a copy, in order to increase the data transfer efficiency. However, this depends on the particular implementation (it may be more convenient to just return a copy of the data). This is the reason why the returned data should not be modified.

If the data array in blk is null, then a new one is created if necessary. The implementation of this interface may choose to return the same array or a new one, depending on what is more efficient. Therefore, the data array in blk prior to the method call should not be considered to contain the returned data, a new array may have been created. Instead, get the array from blk after the method has returned.

The returned data may have its 'progressive' attribute set. In this case the returned data is only an approximation of the "final" data.

isOrigSigned ( int c ) : bool

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

Méthodes protégées

Méthode Description
ColorSpaceMapper ( BlkImgDataSrc src, ColorSpace csMap ) : System

Ctor which creates an ICCProfile for the image and initializes all data objects (input, working, and output).

copyGeometry ( CSJ2K.j2k.image.DataBlk tgt, CSJ2K.j2k.image.DataBlk src ) : void

Copy the DataBlk geometry from source to target DataBlk and assure that the target has an appropriate data buffer.

Private Methods

Méthode Description
InitBlock ( ) : void
initialize ( ) : void

General utility used by ctors

Method Details

ColorSpaceMapper() protected méthode

Ctor which creates an ICCProfile for the image and initializes all data objects (input, working, and output).
protected ColorSpaceMapper ( BlkImgDataSrc src, ColorSpace csMap ) : System
src BlkImgDataSrc -- Source of image data ///
csMap ColorSpace
Résultat System

close() public méthode

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

copyGeometry() protected static méthode

Copy the DataBlk geometry from source to target DataBlk and assure that the target has an appropriate data buffer.
protected static copyGeometry ( CSJ2K.j2k.image.DataBlk tgt, CSJ2K.j2k.image.DataBlk src ) : void
tgt CSJ2K.j2k.image.DataBlk has its geometry set. ///
src CSJ2K.j2k.image.DataBlk used to get the new geometric parameters. ///
Résultat void

createInstance() public static méthode

Factory method for creating instances of this class.
profile access exception ///
public static createInstance ( BlkImgDataSrc src, ColorSpace csMap ) : BlkImgDataSrc
src BlkImgDataSrc -- source of image data ///
csMap ColorSpace -- provides colorspace info ///
Résultat BlkImgDataSrc

getCompData() public méthode

Returns, in the blk argument, a block of image data containing the specifed rectangular area, in the specified component. The data is returned, as a copy of the internal data, therefore the returned data can be modified "in place".

The rectangular area to return is specified by the 'ulx', 'uly', 'w' and 'h' members of the 'blk' argument, relative to the current tile. These members are not modified by this method. The 'offset' of the returned data is 0, and the 'scanw' is the same as the block's width. See the 'DataBlk' class.

This method, in general, is less efficient than the 'getInternCompData()' method since, in general, it copies the data. However if the array of returned data is to be modified by the caller then this method is preferable.

If the data array in 'blk' is 'null', then a new one is created. If the data array is not 'null' then it is reused, and it must be large enough to contain the block's data. Otherwise an 'ArrayStoreException' or an 'IndexOutOfBoundsException' is thrown by the Java system.

The returned data may have its 'progressive' attribute set. In this case the returned data is only an approximation of the "final" data.

public getCompData ( CSJ2K.j2k.image.DataBlk out_Renamed, int c ) : CSJ2K.j2k.image.DataBlk
out_Renamed CSJ2K.j2k.image.DataBlk
c int The index of the component from which to get the data. /// ///
Résultat CSJ2K.j2k.image.DataBlk

getFixedPoint() public méthode

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. For floating point data this value is not applicable.
public getFixedPoint ( int c ) : int
c int The index of the component. /// ///
Résultat int

getInternCompData() public méthode

Returns, in the blk argument, a block of image data containing the specifed rectangular area, in the specified component. The data is returned, as a reference to the internal data, if any, instead of as a copy, therefore the returned data should not be modified.

The rectangular area to return is specified by the 'ulx', 'uly', 'w' and 'h' members of the 'blk' argument, relative to the current tile. These members are not modified by this method. The 'offset' and 'scanw' of the returned data can be arbitrary. See the 'DataBlk' class.

This method, in general, is more efficient than the 'getCompData()' method since it may not copy the data. However if the array of returned data is to be modified by the caller then the other method is probably preferable.

If possible, the data in the returned 'DataBlk' should be the internal data itself, instead of a copy, in order to increase the data transfer efficiency. However, this depends on the particular implementation (it may be more convenient to just return a copy of the data). This is the reason why the returned data should not be modified.

If the data array in blk is null, then a new one is created if necessary. The implementation of this interface may choose to return the same array or a new one, depending on what is more efficient. Therefore, the data array in blk prior to the method call should not be considered to contain the returned data, a new array may have been created. Instead, get the array from blk after the method has returned.

The returned data may have its 'progressive' attribute set. In this case the returned data is only an approximation of the "final" data.

public getInternCompData ( CSJ2K.j2k.image.DataBlk out_Renamed, int c ) : CSJ2K.j2k.image.DataBlk
out_Renamed CSJ2K.j2k.image.DataBlk
c int The index of the component from which to get the data. /// ///
Résultat CSJ2K.j2k.image.DataBlk

isOrigSigned() public méthode

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. /// ///
Résultat bool

Property Details

computed protected_oe property

protected ComputedComponents computed
Résultat ComputedComponents

csMap protected_oe property

ColorSpace info
protected ColorSpace,CSJ2K.Color csMap
Résultat ColorSpace

dataFloat protected_oe property

protected float[][] dataFloat
Résultat float[][]

dataInt protected_oe property

protected int[][] dataInt
Résultat int[][]

eol protected_oe static_oe property

Platform dependant end of line String.
protected static String,System eol
Résultat System.String

fixedPtBitsArray protected_oe property

protected int[] fixedPtBitsArray
Résultat int[]

inFloat protected_oe property

protected DataBlkFloat[],CSJ2K.j2k.image inFloat
Résultat CSJ2K.j2k.image.DataBlkFloat[]

inInt protected_oe property

protected DataBlkInt[],CSJ2K.j2k.image inInt
Résultat CSJ2K.j2k.image.DataBlkInt[]

maxValueArray protected_oe property

protected int[] maxValueArray
Résultat int[]

ncomps protected_oe property

Number of image components
protected int ncomps
Résultat int

pl protected_oe property

Parameter Specs
protected ParameterList,CSJ2K.j2k.util pl
Résultat CSJ2K.j2k.util.ParameterList

shiftValueArray protected_oe property

protected int[] shiftValueArray
Résultat int[]

src protected_oe property

The image source.
protected BlkImgDataSrc src
Résultat BlkImgDataSrc

srcBlk protected_oe property

The image source data per component.
protected DataBlk[],CSJ2K.j2k.image srcBlk
Résultat CSJ2K.j2k.image.DataBlk[]

workDataFloat protected_oe property

protected float[][] workDataFloat
Résultat float[][]

workDataInt protected_oe property

protected int[][] workDataInt
Résultat int[][]

workFloat protected_oe property

protected DataBlkFloat[] workFloat
Résultat DataBlkFloat[]

workInt protected_oe property

protected DataBlkInt[] workInt
Résultat DataBlkInt[]