benilla-re systems structs docs

MipLevelSize

function · image · primitive

Address
0x5a4a00 · 124 bytes, up to 0x5a4a7b
Signature
uint32_t __fastcall (uint32_t level, uint32_t w, uint32_t h, uint32_t fmt)
Meaning
Returns the bytes of one mip level
Confidence
verified, proof one
Finding
image/mips#level-sizes
Test
image::image_level_size

Finding: Level sizes in image: mip geometry

0x5a49b0(fmt) returns bits per pixel: 4 for format 0, 8 for 1, 6 and 7, 32 for 2, 16 for 3 to 5 and 0 for anything above 7. 0x5a4a00(level, w, h, fmt) returns a level's bytes: each dimension is max(1, dim >> level); formats 0, 1 and 7 raise a dimension of 4 or less to 4; format 9 returns wl · hl · 2 + max(1, wl · hl >> 2); otherwise bpp · wl · hl >> 3.

The derivation is in the doc.

Callers 4

Callees 1

Calls and jumps by a bare address, from tables/calls.tsv.