mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-15 07:26:05 +09:00
file format doc update
This commit is contained in:
@@ -500,22 +500,25 @@ Image is divided into 4x4 blocks and each block is serialised, then the entire i
|
|||||||
# File Structure
|
# File Structure
|
||||||
\x1F T S V M i P F
|
\x1F T S V M i P F
|
||||||
[HEADER]
|
[HEADER]
|
||||||
[Blocks.gz]
|
[Blocks]
|
||||||
|
|
||||||
- Header
|
- Header
|
||||||
uint16 WIDTH
|
uint16 WIDTH
|
||||||
uint16 HEIGHT
|
uint16 HEIGHT
|
||||||
uint8 HAS ALPHA
|
uint8 Flags
|
||||||
uint8 IPF Type
|
0b p00z 000a
|
||||||
0: Type 1 (4:2:0 chroma subsampling)
|
- a: has alpha
|
||||||
1: Type 2 (4:2:2 chroma subsampling)
|
- z: gzipped (p flag always sets this flag)
|
||||||
|
- p: progressive ordering (Adam7)
|
||||||
|
uint8 iPF Type/Colour Mode
|
||||||
|
0: Type 1 (4:2:0 chroma subsampling; 2048 colours?)
|
||||||
|
1: Type 2 (4:2:2 chroma subsampling; 2048 colours?)
|
||||||
|
16: Type 16 (full RGBA4444; 4096 colours)
|
||||||
byte[10] RESERVED
|
byte[10] RESERVED
|
||||||
uint32 UNCOMPRESSED SIZE
|
uint32 UNCOMPRESSED SIZE (somewhat redundant but included for convenience)
|
||||||
|
|
||||||
- *.gz
|
- Chroma Subsampled Blocks
|
||||||
literally a .gz of the iPF bytes
|
Gzipped unless the z-flag is not set.
|
||||||
|
|
||||||
- Blocks
|
|
||||||
4x4 pixels are sampled, then divided into YCoCg planes.
|
4x4 pixels are sampled, then divided into YCoCg planes.
|
||||||
CoCg planes are "chroma subsampled" by 4:2:0, then quantised to 4 bits (8 bits for CoCg combined)
|
CoCg planes are "chroma subsampled" by 4:2:0, then quantised to 4 bits (8 bits for CoCg combined)
|
||||||
Y plane is quantised to 4 bits
|
Y plane is quantised to 4 bits
|
||||||
@@ -565,6 +568,10 @@ Image is divided into 4x4 blocks and each block is serialised, then the entire i
|
|||||||
|
|
||||||
which packs into: [ 30 | 30 | FA | FA ] (because little endian)
|
which packs into: [ 30 | 30 | FA | FA ] (because little endian)
|
||||||
|
|
||||||
|
- Progressive Blocks
|
||||||
|
Ordered string of words (word size varies by the colour mode) are stored here.
|
||||||
|
If progressive mode is enabled, words are stored in the order that accomodates it.
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Sound Adapter
|
Sound Adapter
|
||||||
|
|||||||
Reference in New Issue
Block a user