[]
This is a generic abstract class to store data from a block of an image. This class does not have the notion of components. Therefore, it should be used for data from a single component. Subclasses should implement the different types of storage (int, float, etc.).
<p>The data is always stored in one array, of the type matching the data
type (i.e. for 'int' it's an 'int[]'). The data should be stored in the
array in standard scan-line order. That is the samples go from the top-left
corner of the code-block to the lower-right corner by line and then
column.</p><p>The member variable 'offset' gives the index in the array of the first
data element (i.e. the top-left coefficient (ulx,uly)). The member variable
'scanw' gives the width of the scan that is used to store the data, that
can be different from the width of the block. Element '(x,y)' of the
code-block (i.e. '(ulx,uly)' is the top-left coefficient), will appear at
position 'offset+(y-uly)*scanw+(x-ulx)' in the array of data.</p><p>A block of data can have the <i>progressive</i> attribute set. Data is
progressive when it is obtained by successive refinement and the values in
this block are approximations of the "final" values. When the final values
are returned the progressive attribute must be turned off.</p><p>The classes <tt>DataBlkInt</tt> and <tt>DataBlkFloat</tt> provide
implementations for <tt>int</tt> and <tt>float</tt> types respectively.</p>
public abstract class DataBlk
Name | Description |
---|---|
DataBlk() |
Name | Description |
---|---|
TYPE_BYTE | The identifier for the byte data type, as signed 8 bits. |
TYPE_FLOAT | The identifier for the float data type |
TYPE_INT | The identifier for the int data type, as signed 32 bits. |
TYPE_SHORT | The identifier for the short data type, as signed 16 bits. |
h | The height of the block, in pixels. |
offset | The offset in the array of the top-left coefficient |
progressive | The progressive attribute (false by default) |
scanw | The width of the scanlines used to store the data in the array |
ulx | The horizontal coordinate (in pixels) of the upper-left corner of the block of data. This is relative to the component of the image from where this block was filled or is to be filled. |
uly | The vertical coordinate of the upper-left corner of the block of data. This is relative to the component of the image from where this block was filled or is to be filled. |
w | The width of the block, in pixels. |
Name | Description |
---|---|
Data | Returns the array containing the data, or null if there is no data. The returned array is of the type returned by getDataType() (e.g., for TYPE_INT, it is a int[]).
|
DataType | Returns the data type of the DataBlk object, as defined in this class. |
Name | Description |
---|---|
ToString() | Returns a string of informations about the DataBlk |
getSize(int) | Returns the size in bits, given the data type. The data type must be one defined in this class. An IllegalArgumentException is thrown if type is not defined in this class. |