|  3DSoftware.com > Programming > File Formats > BIP > Page 4 |
|
BIP File Format
Page 4
Image Data If the file does not use tiling, blocks and bands, the file header is immediately followed with image data, uncompressed in raster order, beginning with the top scan line, without any pad bytes between scan lines. If there are multiple channels (more than one bit plane), the data for the first bit plane is followed by the data for the second bit plane, etc., without any pad bytes between channels. Tile Addresses Data can be stored as tiles. The Pointer to Tile Addresses in the file header points to a list of tile addresses, or that pointer is null (zero) if tiles are not used. The Tile Addresses are pointers to the image tiles. Each tile is pointed to by a Tile Address. For example, if there are 10 tiles, then there are 10 Tile Addresses. The list of Tile Addresses begins with an unsigned integer The Tile Addresses are stored in raster order, with tiles listed from left to right within a row of tiles, beginning with the top row of tiles. When the address of a tile is zero, then all pixels in that tile are the Default Color and the tile is not stored. Example: Assuming each tile address is To find the second tile of that image, go to the address specified by Pointer to Tile Addresses, skip the next 5 bytes, then instead of using the number at that location (which is the address to the first tile) skip over those Block Addresses If blocks are used, the Pointer to Block Addresses in the file header points to a list of block addresses. The List of Block Addresses is actually a list of block address records. There is one block address record for each block. The List of Block Addresses begins with an unsigned integer The first 16 bytes of a block address record is 4 unsigned integers Blocks are rectangular. The first unsigned int of a block address record specifies the left column of the block relative to the zero-based first column of the entire grid. For example, this number is 3 if the block starts in the 4th column of the grid. Each grid node is one pixel of the grid. The second unsigned int of a block address record specifies the top row of the block relative to the zero-based top row of the entire grid. For example, this number is 2 if the block starts in the 3rd row of the grid. The third and fourth unsigned integers of a block address record specify how many columns and rows of nodes, respectively, there are in the block. For example, if the third number is 7 and the fourth number is 8, then the block has 7 columns of nodes and 8 rows of nodes. The remaining bytes in the block address record is the block pointer, which is the address (offset in bytes from beginning of file) of the actual block. The block itself consists of the numbers which are the grid nodes within that block. The numbers are stored in raster order beginning with the top row of the block. If the file has more than one channel (matrix), then all the nodes in that block of the first channel are stored, followed with all the nodes of the second channel, etc. If the block pointer is zero, the nodes in the block are all the Default Color and the block is not stored. Band Addresses If diagonal bands are used, the Pointer to Band Addresses in the file header points to a list of band addresses. The List of Band Addresses is actually a list of band address records. There is one band address record for each band. The List of Band Addresses begins with an unsigned integer The first 8 bytes of a diagonal band record is 2 unsigned integers The next 2 unsigned integers specify the left and right band widths respectively (total bandwidth equals |
|
|
|
|
The remaining bytes in a diagonal band record is the band pointer (address of the band) which must be at least |
| Page 4 | ||||||
|
|
Copyright © 2008 by 3D Software. All rights reserved. 3D Software, P.O. Box 221190, Sacramento CA 95822 USA www.3DSoftware.com Contact us |
| Tuesday, 06-Jan-2009 04:50:17 GMT |