Package jj2000.j2k.image
Class DataBlkFloat
- java.lang.Object
-
- jj2000.j2k.image.DataBlk
-
- jj2000.j2k.image.DataBlkFloat
-
-
Field Summary
Fields Modifier and Type Field Description float[]
data
The array where the data is stored-
Fields inherited from class jj2000.j2k.image.DataBlk
h, offset, progressive, scanw, TYPE_BYTE, TYPE_FLOAT, TYPE_INT, TYPE_SHORT, ulx, uly, w
-
-
Constructor Summary
Constructors Constructor Description DataBlkFloat()
Creates a DataBlkFloat with 0 dimensions and no data array (i.e.DataBlkFloat(int ulx, int uly, int w, int h)
Creates a DataBlkFloat with the specified dimensions and position.DataBlkFloat(DataBlkFloat src)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getData()
Returns the array containing the data, or null if there is no data array.float[]
getDataFloat()
Returns the array containing the data, or null if there is no data array.int
getDataType()
Returns the identifier of this data type, TYPE_FLOAT, as defined in DataBlk.void
setData(Object arr)
Sets the data array to the specified one.void
setDataFloat(float[] arr)
Sets the data array to the specified one.String
toString()
Returns a string of informations about the DataBlkInt.
-
-
-
Constructor Detail
-
DataBlkFloat
public DataBlkFloat()
Creates a DataBlkFloat with 0 dimensions and no data array (i.e. data is null).
-
DataBlkFloat
public DataBlkFloat(int ulx, int uly, int w, int h)
Creates a DataBlkFloat with the specified dimensions and position. The data array is initialized to an array of size w*h.- Parameters:
ulx
- The horizontal coordinate of the upper-left corner of the blockuly
- The vertical coordinate of the upper-left corner of the blockw
- The width of the block (in pixels)h
- The height of the block (in pixels)
-
DataBlkFloat
public DataBlkFloat(DataBlkFloat src)
Copy constructor. Creates a DataBlkFloat which is the copy of the DataBlkFloat given as paramter.- Parameters:
src
- the object to be copied.
-
-
Method Detail
-
getDataType
public final int getDataType()
Returns the identifier of this data type, TYPE_FLOAT, as defined in DataBlk.- Specified by:
getDataType
in classDataBlk
- Returns:
- The type of data stored. Always DataBlk.TYPE_FLOAT
- See Also:
DataBlk.TYPE_FLOAT
-
getData
public final Object getData()
Returns the array containing the data, or null if there is no data array. The returned array is a float array.- Specified by:
getData
in classDataBlk
- Returns:
- The array of data (a float[]) or null if there is no data.
- See Also:
DataBlk.getDataType()
-
getDataFloat
public final float[] getDataFloat()
Returns the array containing the data, or null if there is no data array.- Returns:
- The array of data or null if there is no data.
-
setData
public final void setData(Object arr)
Sets the data array to the specified one. The provided array must be a float array, otherwise a ClassCastException is thrown. The size of the array is not checked for consistency with the block's dimensions.- Specified by:
setData
in classDataBlk
- Parameters:
arr
- The data array to use. Must be a float array.- See Also:
DataBlk.getDataType()
-
setDataFloat
public final void setDataFloat(float[] arr)
Sets the data array to the specified one. The size of the array is not checked for consistency with the block's dimensions.- Parameters:
arr
- The data array to use.
-
-