-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathw3-blp.ksy
96 lines (96 loc) · 1.87 KB
/
w3-blp.ksy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
meta:
id: w3_blp
file-extension: blp
endian: le
imports:
- w3id
seq:
- id: header
type: header
- id: mipmap_locator
type: mipmap_locator
if: header.magic.version >= 1
- id: jpg_header
type: jpg_header
if: header.content == content::jpg
- id: direct_header
type: direct_header
if: header.content == content::direct
types:
magic:
seq:
- id: head
type: u1
repeat: expr
repeat-expr: 3
- id: version_raw
type: u1
instances:
version:
value: version_raw - 48
header:
seq:
- id: magic
type: magic
- id: content
type: u4
enum: content
- id: encoding_type
type: u1
if: magic.version >= 2
- id: alpha_bits2
type: u1
if: magic.version >= 2
- id: sample_type
type: u1
if: magic.version >= 2
- id: has_mipmaps2
type: u1
if: magic.version >= 2
- id: alpha_bits
type: u4
if: magic.version < 2
- id: width
type: u4
- id: height
type: u4
- id: extra
type: u4
if: magic.version < 2
- id: has_mipmaps
type: u4
if: magic.version < 2
mipmap_locator:
seq:
- id: mipmap_offset
type: u4
repeat: expr
repeat-expr: 16
- id: mipmap_size
type: u4
repeat: expr
repeat-expr: 16
jpg_header:
seq:
- id: num_header_chunk
type: u4
- id: header_chunk
type: u1
repeat: expr
repeat-expr: num_header_chunk
direct_header:
seq:
- id: cmap
type: u1
repeat: expr
repeat-expr: 256
enums:
content:
0: jpg
1: direct
instances:
mipmap0:
pos: mipmap_locator.mipmap_offset[0]
type: u1
repeat: expr
repeat-expr: mipmap_locator.mipmap_size[0]