Files
ImHex-Patterns/patterns/fas_oskasoftware_old.hexpat
DmitriLeon2000 edd0aa9a2f patterns: Add .fas and .was pattern files (Oska DeskMates) (#176)
* Add .fas and .was pattern files (Oska DeskMates)

* Update .was pattern file

* Update .was/.wa3 pattern file

* Update README.md

* Update README.md

* Update .fas & .was pattern files

* Update README.md

* Update fas_oskasoftware_old.hexpat

* Added WAS test file

* Update WAS test file

* Update was_oskasoftware.hexpat
2023-10-24 07:35:38 +02:00

88 lines
1.9 KiB
Rust

#pragma author DmitriLeon2000
#pragma description Oska Software DeskMates FAS (Frames and Sequences) file (Oska DeskMate versions 1.3 and 2.06)
#pragma endian little
enum Compression : u32 {
BI_RGB,
BI_RLE8,
BI_RLE4,
BI_BITFIELDS,
BI_JPEG,
BI_PNG,
BI_ALPHABITFIELDS,
BI_CMYK,
BI_CMYKRLE8,
BI_CMYKRLE4,
};
struct Colors {
u8 blue;
u8 green;
u8 red;
u8 reserved;
};
struct FASHeader {
s32 width; // width of the animation (in pixels)
s32 height; // height of the animation (in pixels)
u16 reserved1;
u16 reserved2;
u16 frameSizeCombined; // a sum of frameSizeColor and frameSizeMask
u16 frameSizeColor; // size of the animation ((frameWidth * 4 + 31) // 32 * 4 * frameHeight)
u16 frameSizeMask; // size of the animation's mask ((frameWidth * 1 + 31) // 32 * 4 * frameHeight)
u16 headerCount; // amount of DIB headers
};
struct BitmapInfoHeader { // bog-standard BitmapInfoHeaderV1
u32 biSize;
s32 biWidth;
s32 biHeight;
u16 biPlanes;
u16 biBitCount;
Compression compression;
u32 biSizeImage;
s32 biXPelsPerMeter;
s32 biYPelsPerMeter;
u32 biClrUsed;
u32 biClrImportant;
};
struct BitmapInfo {
BitmapInfoHeader header;
le u32 colorMap[header.biClrUsed == 0 ?
1 << header.biBitCount : header.biClrUsed];
};
struct AnimSequence {
char name[];
char sequence[];
};
struct SeqHeader {
le u32 size;
le u32 count;
le u32 strPointers[count*2];
};
struct Frame {
u8 colorBitmap[fas.fasHeader.frameSizeColor];
u8 maskBitmap[fas.fasHeader.frameSizeMask];
};
struct FramesHeader {
le u32 count;
le s16 frameID[count];
};
struct FAS {
FASHeader fasHeader;
BitmapInfo dibHeaders[fasHeader.headerCount];
SeqHeader seqHeader;
AnimSequence sequences[seqHeader.count];
FramesHeader framesHeader;
};
FAS fas @ 0x00;
Frame frames[fas.framesHeader.count] @ $;