Decoder for the DCC image format.
The DCC format is a compressed sprite image format. It can store multiple directions and frames in a single file. A palette is used to generate the colors, but the file itself doesn't have any information about the palette to use, it is up to the user to know which one to use.
- See Also
- WorldStone::Palette
This format is usually used with COF files, which describe the animations and blending of multiple DCC files.
Layout of a DCC file:
Name | Type | Size in Bytes | Offsets |
header | DCC::Header | 15 | 0x00 |
directionsOffsets | uint32_t[dirs] | 4 * header.directions | 0x0F |
First Direction | DCC::Direction | directionsOffsets[1] - directionsOffsets[0] | directionsOffsets[0] |
*** | | |
Last Direction | DCC::Direction | filesize - directionsOffsets[directions-1] | directionsOffsets[directions-1] |
Direction layout:
Name | Type | Size |
dirHeader[0] | DCC::DirectionHeader | 32 + 30 bits |
| |
frameHeader[0] | DCC::FrameHeader | Based on the DirectionHeader values |
*** | |
frameHeader[framesPerDir-1] | DCC::FrameHeader | Based on the DirectionHeader values |
| |
align | (unused) | Align to byte if any frame has additionnal data |
Frame 0 additionnal data | byte[] | frameHeader[0].optionalBytes |
*** | |
Last frame additionnal data | byte[] | frameHeader[framesPerDir-1].optionalBytes |
| |
equalCellsBitStreamSize | uint20_t | 20 bits (only if compressEqualCells is true) |
pixelMaskBitStreamSize | uint20_t | 20 bits |
encodingTypeBitsreamSize | uint20_t | 20 bits (only if hasRawPixelEncoding is true) |
rawPixelCodesBitStreamSize | uint20_t | 20 bits (only if hasRawPixelEncoding is true) |
codeToPixelValue | bitset<256> | 256 bits |
equalCellBitStream | BitStream | equalCellsBitStreamSize |
pixelMaskBitStream | BitStream | pixelMaskBitStreamSize |
rawPixelUsageBitStream | BitStream | encodingTypeBitsreamSize |
rawPixelCodesBitStream | BitStream | rawPixelCodesBitStreamSize |
pixelCodesDisplacementBitStream | BitStream | Until end of the direction |
- Tests:
DCC_BaalSpirit
DCC_CRHDBRVDTHTH
DCC_BloodSmall01
DCC_HZTRLITA1HTH
Definition at line 46 of file dcc.h.
constexpr unsigned WorldStone::DCC::bitsWidthTable |
|
static |
Initial value:= {0, 1, 2, 4, 6, 8, 10, 12,
14, 16, 20, 24, 26, 28, 30, 32}
An array that maps an encoded 4-bit size to the real size in bits.
The values are { 0, 1, 2, 4, 6, 8, 10, 12, 14, 16, 20, 24, 26, 28, 30, 32 }
Definition at line 160 of file dcc.h.