|  3DSoftware.com > Programming > File Formats > BIP > Page 3 |
|
BIP File Format
Page 3
File Header Each BIP file contains data at the beginning of the file to provide information about the file. |
||
|
File Signature Bytes Bytes 0 3 The first 4 bytes of the BIP file are the File Signature Bytes which identify the file as a BIP file, and must have these values: |
||
|
||
|
Those are the ASCII characters B, I and P respectively. |
|
File Header (Unsigned Integers) Bytes 0 56 (0x0 0x38) The first 64 bytes of the BIP file is file header information in an array of unsigned integers. There are 16 unsigned integers in this array. Each unsigned integer is |
||
| unsigned int uivecHeader[ 16 ]; | ||
|
When writing this array to file, since each variable in the array is multi-byte, write one variable at a time to ensure proper byte ordering of each |
||
|
||
|
When reading the multi-byte variables from file, read one variable at a time: |
||
|
||
|
This array of variables defines the following file settings: |
||
|
|
File Signature (Magic Number) Must be 0x42495000 File Version Must be 1 File Size High 0 = Default If the file size is 64 bits, then this is the high order File Size Size of the file (number of bytes). If the file size is |
|
Grid Width and Height Number of columns and rows of pixels in each image. This is how wide and high the grid is, in pixels. Tile Width and Tile Height Size of each tile, in pixels. These variables are zero if tiles are not used. Number of Planes This is how many bit planes are stored. If only one image is stored, the Number of Planes |
|
Byte Flags Bytes settings that are accessed with shifting: |
||
|
||
|
|
Pointer to Tile Addresses This is the offset in bytes (from beginning of file) to the list of Tile Addresses. This is zero if tiles are not used. Pointer to Block Addresses This variable points (is the offset in bytes from beginning of file) to the list of Block Addresses. This must be zero if blocks are not used. Blocks can only be used if Tiles are not used (if Pointer to Tile Addresses is zero). Pointer to Band Addresses This variable points (is the offset in bytes from beginning of file) to the list of Diagonal Bands. This must be zero if diagonal bands are not used. Diagonal bands can only be used if Tiles are not used (if Pointer to Tile Addresses is zero). Pointer to Copyright Notice This is the offset in bytes (from beginning of file) to a Copyright Notice. This is optional. If this is null (zero), there is no copyright notice. The Copyright Notice consists of Simple Unicode UTF-16 text characters. Pointer to Comments This is the offset in bytes (from beginning of file) to Text Comments. If this is null (zero), there are no comments. That is the default. Comments are optional, and are Simple Unicode UTF-16 text characters. Pointer to Custom Data 0 = Default If this variable is non-zero, it is the offset in bytes (from beginning of file) to Custom Data. The Custom Data consists of an unsigned int |
| Page 3 | ||||||
|
|
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:31:43 GMT |