Package jj2000.j2k.image
Class DataBlkInt
- java.lang.Object
-
- jj2000.j2k.image.DataBlk
-
- jj2000.j2k.image.DataBlkInt
-
-
Field Summary
Fields Modifier and Type Field Description int[]dataThe 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 DataBlkInt()Creates a DataBlkInt with 0 dimensions and no data array (i.e.DataBlkInt(int ulx, int uly, int w, int h)Creates a DataBlkInt with the specified dimensions and position.DataBlkInt(DataBlkInt src)Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetData()Returns the array containing the data, or null if there is no data array.int[]getDataInt()Returns the array containing the data, or null if there is no data array.intgetDataType()Returns the identifier of this data type, TYPE_INT, as defined in DataBlk.voidsetData(java.lang.Object arr)Sets the data array to the specified one.voidsetDataInt(int[] arr)Sets the data array to the specified one.java.lang.StringtoString()Returns a string of informations about the DataBlkInt.
-
-
-
Constructor Detail
-
DataBlkInt
public DataBlkInt()
Creates a DataBlkInt with 0 dimensions and no data array (i.e. data is null).
-
DataBlkInt
public DataBlkInt(int ulx, int uly, int w, int h)Creates a DataBlkInt 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)
-
DataBlkInt
public DataBlkInt(DataBlkInt src)
Copy constructor. Creates a DataBlkInt which is the copy of the DataBlkInt 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_INT, as defined in DataBlk.- Specified by:
getDataTypein classDataBlk- Returns:
- The type of data stored. Always DataBlk.TYPE_INT
- See Also:
DataBlk.TYPE_INT
-
getData
public final java.lang.Object getData()
Returns the array containing the data, or null if there is no data array. The returned array is a int array.- Specified by:
getDatain classDataBlk- Returns:
- The array of data (a int[]) or null if there is no data.
- See Also:
DataBlk.getDataType()
-
getDataInt
public final int[] getDataInt()
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(java.lang.Object arr)
Sets the data array to the specified one. The provided array must be a int array, otherwise a ClassCastException is thrown. The size of the array is not checked for consistency with the block's dimensions.- Specified by:
setDatain classDataBlk- Parameters:
arr- The data array to use. Must be a int array.- See Also:
DataBlk.getDataType()
-
setDataInt
public final void setDataInt(int[] arr)
Sets the data array to the specified one. The size of the array is not checked for consistency with the block's dimensions. This method is more efficient than setData- Parameters:
arr- The data array to use.
-
-