|  3DSoftware.com > Programming > File Formats > FIN > Page 4 |
|
FIN File Format
Page 4
File Header Each FIN 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 FIN file are the File Signature Bytes which identify the file as a FIN file, and must have these values: |
||
|
||
|
Those are the ASCII characters F, I and N respectively. |
|
File Header (Unsigned Integers) Bytes 0 80 (0x0 0x50) The first 80 bytes of the FIN file is file header information in an array of unsigned integers. There are 20 unsigned integers in this array. Each unsigned integer is |
||
| unsigned int uivecHeader[ 20 ]; | ||
|
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 0x46494e00 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 Size of grid, in floating point numbers or integers. The grid width is the number of columns in the grid. The grid height is the number of rows in the grid. Both of these variables (Grid Width and Height) can be zero if only blocks are used (without bands), and if both variables (not just one of these variables) are zero, in which case the two variables can be ignored (or determined by examining the blocks). For example, you can store a file of vector polylines with each polyline as a block without specifying grid extents. Tile Width and Tile Height Size of each tile. Tile width is the number of columns in the tile. Tile Height is the number of rows in the tile. Both can be set to zero if tiling will not be used, or if the file will be a single tile and blocks and bands are not used. Number of Matrices This is how many channels (planes) of data are stored. For example, if the file stores a matrix of longitude values and a matrix of latitude values, the Number of Matrices |
|
Byte Flags Bytes settings that are accessed with shifting. Byte settings that are not used must be 0x00. The following byte settings are always used: |
||
|
||
|
||
|
If the Type of Grid Node is 0x00 or 0x01, then the Size of Grid Node is stored as: |
||
|
||
|
If the Type of Grid Node is 0x02, then each uncompressed grid node is |
|
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. Tiles are used if Blocks and Bands are not used. If Blocks or Diagonal Bands are used, then this Pointer to Tile Addresses must be zero and 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). Reserved uivecHeader[ 13 ] is reserved for future use and must be zero. |
|
Pointer to File Dynamic Range
0 = Default If this variable is non-zero, it is the offset in bytes (from beginning of file) to the Dynamic Range of the entire file integer grid. This is optional, and is only supported for an integer grid. Pointer to File Bias 0 = Default This variable specifies the optional bias for the entire file integer grid. Application programs can subtract this variable from each integer in the grid to recover original signed data. This is only supported for an integer grid. |
|
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 Text Titles This is the offset in bytes (from beginning of file) to Column and Row Titles. If this is null (zero), there are no titles. Titles are optional, and are Simple Unicode UTF-16 text characters. Pointer to Text 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 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:36:19 GMT |