Fawkes API  Fawkes Development Version
fvff.h
00001 
00002 /***************************************************************************
00003  *  fvff.h - FireVision file format
00004  *
00005  *  Created: Fri Mar 28 11:12:38 2008
00006  *  Copyright  2008  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #ifndef __FIREVISION_FVUTILS_FILEFORMAT_FVFF_H_
00025 #define __FIREVISION_FVUTILS_FILEFORMAT_FVFF_H_
00026 
00027 #pragma pack(push,4)
00028 
00029 #ifndef __STDC_LIMIT_MACROS
00030 #define __STDC_LIMIT_MACROS
00031 #endif
00032 #include <stdint.h>
00033 
00034 #define FVFF_COMMENT_SIZE 256
00035 
00036 namespace firevision {
00037 #if 0 /* just to make Emacs auto-indent happy */
00038 }
00039 #endif
00040 
00041 /** Header for a FireVision file format file.
00042  * The header defines the basic parameters needed to correctly interpret the
00043  * following file contents.
00044  *
00045  * The header defines a magic by which a rectinfo can be identified. This is
00046  * defined by the actual content of the file.
00047  * The version is stored as a sequential number. This version has to be changed
00048  * whenever either the header or the file data format changes. The version is set
00049  * by the concrete data implementation.
00050  * The file defines the endianess of the supplied data.
00051  * There are several reserved bits that may be used later to store flags. The field
00052  * num_blocks define how many info blocks there are in this file.
00053  *
00054  * Directly following the header is the content specific header. It has to be exactly
00055  * the size given in spec_head_size.
00056  */
00057 typedef struct _fvff_header_t {
00058   uint16_t magic_token;         /**< magic token */
00059   uint16_t version    :  4;     /**< version of the data file, this header defines version 1 */
00060   uint16_t endianess  :  1;     /**< endianess of the file, 0 means little endian, 1 means big endian */
00061   uint16_t reserved   : 11;     /**< reserved for future use */
00062   uint16_t num_blocks;          /**< number of rectification info blocks in this file */
00063   uint32_t spec_head_size;      /**< data specific header size */
00064   uint64_t created_sec;         /**< creation unix timestamp, seconds */
00065   uint64_t created_usec;        /**< creation unix timestamp, useconds */
00066   char     comment[FVFF_COMMENT_SIZE];  /**< optional comment */
00067 } fvff_header_t;
00068 
00069 
00070 /** Block header.
00071  * Each block in a FvFF file has a block header. This header defines only the basic
00072  * characteristics that are needed to parse the file.
00073  * Directly following the header is the content specific block header. The size has to
00074  * be set in spec_head_size.
00075  */
00076 typedef struct _fvff_block_header_t {
00077   uint32_t type;                /**< The type of the block, content-specific */
00078   uint32_t size;                /**< size in bytes of this block, does not include any headers */
00079   uint32_t spec_head_size;      /**< the size of the following content specific block header */
00080 } fvff_block_header_t;
00081 
00082 } // end namespace firevision
00083 
00084 
00085 #pragma pack(pop)
00086 #endif