Format of the hri-files.
This is a simple byte-based format.
C-header contains:
#define HRI1SIGN "PDUS"
#define FRAMESTARTPDUS "FRAME"
/* Time info with 2 byte integers */
struct tm_sh_hri1
{
gint16 tm_sec,tm_min,tm_hour;
gint16 tm_mday,tm_mon,tm_year,tm_wday,tm_yday,tm_isdst;
};
/*************************************
* File header HRI1 format.
*************************************/
typedef struct pdushdr
{
char code[8];
gint16 lenhdr;
gint16 width,height;
gint16 nrchan;
struct tm_sh_hri1 tm;
} HRI1_FILEHDR;
The file header: (34 bytes)
- 8 bytes sign: PDUS ('P' 'D' 'U' 'S' 0 0 0 0)
- 2 bytes header length; not used (0x00)
- 2 bytes width; not used (0x00)
- 2 bytes height; not used (0x00)
- 2 bytes nrchannels; not used (0x00)
- 2x9 bytes time info; not used (0x00)
The data-part contains frameblocks of 364 bytes separated with a 7-bytes sub-header:
- 5 bytes ascii FRAME (if decoder was in-sync) or FRAMe (if not in-sync)
- 2 bytes integer giving the length of the next frame, which is always 364 bytes. So, this number is (hex)016F. In little endian!
Complete format is:
<34bytes_header>F R A M E 6F 01<364bytes_data>F R A M E 6F 01<364bytes_data>...
The reader has to determine the right format from the received hri-data, like width and height of the picture (A-format, B-format, X-format etc.) to reconstruct the picture. This information is present in the 364 bytes-per-frame received data.