EEVblog Electronics Community Forum

Products => Thermal Imaging => Topic started by: Ben321 on May 15, 2016, 11:27:01 pm

Title: Question about FFF header
Post by: Ben321 on May 15, 2016, 11:27:01 pm
I was looking at the official spec just now, and was wondering about this one field for the FFF file's main header.
Code: [Select]
typedef struct tagFLIRFILEHEAD
{
char szFormatID[4];
char szOrigin[16];
unsigned long dwVersion;
unsigned long dwIndexOff;
unsigned long dwNumUsedIndex;
unsigned long dwNextID;
unsigned short usSwapPattern;
unsigned short Spare[7];
unsigned long reserved[2];
unsigned long dwChecksum;
} FLIRFILEHEAD;

I was wondering what the usSwapPattern field in the header was for. Does that have something to do with whether the file uses BigEndian or LittleEndian byte order? I was wondering, because to use a bigendian multi-byte value on a littleendian system (or visa versa), you need to swap the bytes.
Title: Re: Question about FFF header
Post by: tomas123 on May 17, 2016, 09:56:45 am
I think, you know my post here with a full fff.h header:

http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,6763.0.html (http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,6763.0.html)

Code: [Select]
typedef struct tagFLIRFILEHEAD
{
...
    unsigned short usSwapPattern;/* Swap pattern (0=MSBF)  2  38       */
...
} FLIRFILEHEAD;

with
Code: [Select]
LSBF = little-endian
MSBF = big-endian

some more informations you see inside the exiftool code:
http://cpansearch.perl.org/src/EXIFTOOL/Image-ExifTool-10.15/lib/Image/ExifTool/FLIR.pm (http://cpansearch.perl.org/src/EXIFTOOL/Image-ExifTool-10.15/lib/Image/ExifTool/FLIR.pm)