CImage

What is a CImage?

CImage is a format used to store information and data for an image.

Structure

Size Type Name Description
4 UInt32 Handle The handle of the image, used to reference the image by other structures
4 UInt32 Unknown Allegedly a checksum of the data after Data Size, unsure if accurate or the usage
4 UInt32 References The number of references made to this image in the project, used to determine if the image should be removed from the project
4 UInt32 Data Size The size of the Image Data
2 Int16 Width The width of the image
2 Int16 Height The height of the image
1 EImageFormat Image Format The format of the image
1 UInt8 Flags Definitions
2   Unknown Presumably padding
2 Int16 Hotspot X The X coordinate of the Hotspot
2 Int16 Hotspot Y The Y coordinate of the Hotspot
2 Int16 Action Point X The X coordinate of the Action Point
2 Int16 Action Point Y The Y coordinate of the Action Point
4 RGBA Transparent Color The color used for transparency if the Alpha and RGBA flags are both disabled
Data Size UInt8[] Image Data The raw data of the image file, if the LZX flag is enabled, the first 4 bytes are the decompressed size, then the rest is compressed using LZX

Flag Definitions

Flags

Value Name Description
0x01 RLE Image pixel data is RLE compressed, with command bytes controlling run length and repeat behavior
0x02 RLEW Unknown, observed behaviour is similar to RLE
0x04 RLET Unknown, observed behaviour is similar to RLE but differs with padding
0x08 LZX Image pixel data is LZX compressed
0x10 Alpha Image contains a separate alpha channel appended after the pixel data
0x20 ACE Unknown
0x40 Mac Unknown, presumably set for the Mac runtime when compiled
0x80 RGBA Image pixel data already contains an interleaved alpha channel rather than a separate one