[TOC] [Prev] [Next] FME FILES

They contain the frames, which are the "one view" objects (you can turn around them, and you always see the same image).

Here are the data structures for the FME file headers.

FME_Header1 IS
{
InsertX int32 // Insertion point, X coordinate
// Negative values shift the FME left
// Positive values shift the FME right
InsertY int32 // Insertion point, Y coordinate
// Negative values shift the FME up
// Positive values shift the FME down
Flip int32 // 0 = not flipped
// 1 = flipped horizontally
Header2 int32 // pointer to FME_Header2
UnitWidth int32 // Unused
UnitHeight int32 // Unused
pad3 int32 // Unused
pad4 int32 // Unused
}

FME_Header2 IS
{
SizeX int32 // Size of the FME, X value
SizeY int32 // Size of the FME, Y value
Compressed int32 // 0 = not compressed
// 1 = compressed
DataSize int32 // Datasize for compressed FMEs,
// equals length of the FME file - 32
// If not compressed, DataSize = 0
ColOffs int32 // Always 0, because columns table
// follows just after
pad1 int32 // Unused
}

If Compressed = 0, the data follows, encoded by COLUMNS from the bottom to the top.

Compressed FME

Compressed FMEs are very similar to compressed BMs (RLE0).

After FME_Header2 follows a table of offsets to the starts of the columns data.
Those are offsets from the start of FME_Header2.

Then follow the columns data.

The coding of one column follows (in pseudo code format).

while(end of data for this column not reached)
{
 if(buffer[address] <= 128)
   the FOLLOWING n bytes are direct values
 else
   skip n-128 transparent (background) pixels
}

So, for example, the following hex values ...88 02 17 28 82... mean:
skip 8 background pixels, then write two pixels with colors 17 and 28, then skip 2 background pixels, etc.