formats:frm16
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
formats:frm16 [2010-09-26 21:26] – edheldil | formats:frm16 [2010-09-26 23:12] – edheldil | ||
---|---|---|---|
Line 9: | Line 9: | ||
* header | * header | ||
* Opaque layer | * Opaque layer | ||
- | * Scanline LUT for the opaque layer | + | |
+ | | ||
* 80% opacity layer | * 80% opacity layer | ||
- | * Scanline LUT for the 80% layer | + | |
+ | | ||
* 60% opacity layer | * 60% opacity layer | ||
- | * Scanline LUT for the 60% layer | + | |
+ | | ||
* 40% opacity layer | * 40% opacity layer | ||
- | * Scanline LUT for the 40% layer | + | |
+ | | ||
* 20% opacity layer | * 20% opacity layer | ||
- | * Scanline LUT for the 20% layer | + | |
- | + | | |
- | Any (FIXME: even the fully opaque) layer might be missing | + | |
- | + | ||
- | [FIXME: quotes on FRM/FRM16 and JPEG-like compression] | + | |
- | [FIXME: links to convertors by Balder, Miloch, ...] | + | |
+ | Any (FIXME: even the fully opaque) layer might be missing. | ||
There are at least two types of FRM16 files - type 64 and type 68. Type 64 uses uncompressed pixels, while type 68 uses RLE. | There are at least two types of FRM16 files - type 64 and type 68. Type 64 uses uncompressed pixels, while type 68 uses RLE. | ||
Line 38: | Line 39: | ||
| 0x0c | 2 | Type (64 or 68) | | | 0x0c | 2 | Type (64 or 68) | | ||
| 0x0e | 2 | Unknown, possibly padding, always 0 in standalone files | | | 0x0e | 2 | Unknown, possibly padding, always 0 in standalone files | | ||
- | | 0x10 | 4 | Data size for opaque layer | | + | | 0x10 | 4 | Bitmap |
- | | 0x14 | 4 | Data size for % layer | | + | | 0x14 | 4 | Bitmap |
- | | 0x18 | 4 | Data size for % layer | | + | | 0x18 | 4 | Bitmap |
- | | 0x1c | 4 | Data size for % layer | | + | | 0x1c | 4 | Bitmap |
- | | 0x20 | 4 | Data size for % layer | | + | | 0x20 | 4 | Bitmap |
==== Layers ==== | ==== Layers ==== | ||
- | Layer | + | Each layer consists of a bitmap and a scanline lookup table (LUT). |
- | ^ Offset ^ Size ^ Description | + | |
- | ==== Pixel Encoding, RLE ==== | + | |
+ | ==== Bitmap | ||
Pixel color is encoded as a 16bit word, probably with a common 5-6-5 RGB? encoding. FIXME: How are fully transparent pixels encoded? | Pixel color is encoded as a 16bit word, probably with a common 5-6-5 RGB? encoding. FIXME: How are fully transparent pixels encoded? | ||
- | Type 64 files do not use any compression. Each layer contains all Width x Height | + | Type 64 files do not use any compression. Each bitmap consists of width x height |
- | Type 68 FRM16 files use Run Length Encoding, RLE. Each image scanline | + | Type 68 FRM16 files use Run Length Encoding, RLE. Each bitmap line consists of variable number |
+ | For example: | ||
+ | 81 42 ff fe ff fc 05 00 00 | ||
+ | would result in | ||
+ | __ __ ff fe ff fc 00 00 00 00 00 00 00 00 00 00 | ||
+ | (First one pixel (0x81 & 0x7f) is skipped, then two (0x42 & 0x3f) whitish pixels are copied, then a black pixel is copied 5 times) | ||
- | ==== Color Encoding ==== | + | In type 68 files, the first 4 bytes in a bitmap is a DWORD containing bitmap' |
- | Pixels' | + | |
+ | |||
+ | ==== Scanline Lookup Table, LUT ==== | ||
+ | |||
+ | Array of 32bit indices into bitmap pointing to beginnings of each bitmap scanline. The first index is 0 in type 64 files, 4 in type 68 files. | ||
+ | |||
+ | ^ Offset ^ Size ^ Description ^ | ||
+ | | 0x00 | 2 | Offset of the 1st scanline (0 in type 64 files, 4 in type 68 files) | | ||
+ | | 0x02 | 2 | Offset of the 2nd scanline | | ||
+ | | ...||| | ||
+ | | height * 2 | 2 | Offset of the last scanline | | ||
+ | |||
+ | ==== References ==== | ||
+ | |||
+ | [FIXME: quotes on FRM/FRM16 and JPEG-like compression] | ||
+ | [FIXME: links to convertors by Balder, Miloch, | ||
formats/frm16.txt · Last modified: 2011-11-21 22:36 by edheldil