|
| 1 | +\textinput{../snippets/pixmap_table/brief.md} |
| 2 | + |
| 3 | +## Table Structure |
| 4 | + |
| 5 | +### Identifier |
| 6 | +- **Value**: `[IDENTIFIER_PLACEHOLDER]` |
| 7 | + |
| 8 | + |
| 9 | +## Configuration Flags |
| 10 | + |
| 11 | +| Bit | Name | Description | |
| 12 | +| --- | ---- | ----------- | |
| 13 | +| 0 | `use_constant_width` | \textinput{../snippets/pixmap_table/configurations/flag/use_constant_width.md} | |
| 14 | +| 1 | `use_constant_height` | \textinput{../snippets/pixmap_table/configurations/flag/use_constant_height.md} | |
| 15 | +| 2 | `use_constant_bits_per_pixel` | \textinput{../snippets/pixmap_table/configurations/flag/use_constant_bits_per_pixel.md} | |
| 16 | +| 3-7 | — | \textinput{../snippets/phrase/reserved.md} | |
| 17 | + |
| 18 | +### Configuration Values |
| 19 | + |
| 20 | +| Name | Type | Condition | Description | |
| 21 | +| ---- | ---- | --------- | ----------- | |
| 22 | +| `constant_width` | `u8` | \textinput{../snippets/pixmap_table/configurations/condition/constant_width.md} | \textinput{../snippets/pixmap_table/configurations/brief/constant_width.md} | |
| 23 | +| `constant_height` | `u8` | \textinput{../snippets/pixmap_table/configurations/condition/constant_height.md} | \textinput{../snippets/pixmap_table/configurations/brief/constant_height.md} | |
| 24 | +| `constant_bits_per_pixel` | `u8` | \textinput{../snippets/pixmap_table/configurations/condition/constant_bits_per_pixel.md} | \textinput{../snippets/pixmap_table/configurations/brief/constant_bits_per_pixel.md} | |
| 25 | + |
| 26 | +## Table Links |
| 27 | + |
| 28 | +| Bit | Name | Description | |
| 29 | +| --- | ---- | ----------- | |
| 30 | +| 0 | `link_color_tables` | \textinput{../snippets/pixmap_table/links/flag/link_color_tables.md} | |
| 31 | +| 1-7 | — | \textinput{../snippets/phrase/reserved.md} | |
| 32 | + |
| 33 | +### Link Arrays |
| 34 | + |
| 35 | +| Name | Type | Condition | Description | |
| 36 | +| ---- | ---- | --------- | ----------- | |
| 37 | +| `color_tables` | `Vec<u8>` | \textinput{../snippets/pixmap_table/links/condition/color_tables.md} | \textinput{../snippets/pixmap_table/links/brief/color_tables.md} | |
| 38 | + |
| 39 | +## Record Fields |
| 40 | + |
| 41 | + |
| 42 | +Each record contains the following fields in order: |
| 43 | + |
| 44 | +| Field | Type | Condition | Description | |
| 45 | +| ----- | ---- | --------- | ----------- | |
| 46 | +| `width` | `[TYPE_PLACEHOLDER]` | \textinput{../snippets/pixmap_table/records/condition/width.md} | \textinput{../snippets/pixmap_table/records/brief/width.md} | |
| 47 | +| `height` | `[TYPE_PLACEHOLDER]` | \textinput{../snippets/pixmap_table/records/condition/height.md} | \textinput{../snippets/pixmap_table/records/brief/height.md} | |
| 48 | +| `bits_per_pixel` | `[TYPE_PLACEHOLDER]` | \textinput{../snippets/pixmap_table/records/condition/bits_per_pixel.md} | \textinput{../snippets/pixmap_table/records/brief/bits_per_pixel.md} | |
| 49 | +| `data` | `[TYPE_PLACEHOLDER]` | \textinput{../snippets/pixmap_table/records/condition/data.md} | \textinput{../snippets/pixmap_table/records/brief/data.md} | |
| 50 | + |
| 51 | +## Record Layout Examples |
| 52 | + |
| 53 | +**Example 1: Minimal pixmap** (all constants set) |
| 54 | +``` |
| 55 | +Configuration: constant_width=8, constant_height=8, constant_bits_per_pixel=1 |
| 56 | +Pixmap: 8×8 monochrome bitmap |
| 57 | +
|
| 58 | +Byte layout: [data (8 bytes)] |
| 59 | +Binary: 11111111 10000001 10000001 10000001 10000001 10000001 10000001 11111111 |
| 60 | +Hex: FF 81 81 81 81 81 81 FF |
| 61 | +Represents: 8×8 square outline (64 pixels, 1 bit each = 8 bytes) |
| 62 | +``` |
| 63 | + |
| 64 | +**Example 2: Custom dimensions** |
| 65 | +``` |
| 66 | +Configuration: constant_bits_per_pixel=1 |
| 67 | +Pixmap: 5×3 monochrome bitmap |
| 68 | +
|
| 69 | +Byte layout: [width] [height] [data (2 bytes)] |
| 70 | +Binary: 00000101 00000011 11111000 01110000 |
| 71 | +Hex: 05 03 F8 70 |
| 72 | +Calculation: 5×3 = 15 pixels × 1 bit = 15 bits = 2 bytes (1 unused bit) |
| 73 | +Data: 11111 (row 1) |
| 74 | + 000 01 (partial row 2) |
| 75 | + 110 00 (partial row 3) |
| 76 | + 00 (padding) |
| 77 | +``` |
| 78 | + |
| 79 | +**Example 3: Custom bits per pixel** |
| 80 | +``` |
| 81 | +Configuration: constant_width=4, constant_height=4 |
| 82 | +Pixmap: 4×4 bitmap with 4 colors (2 bits per pixel) |
| 83 | +
|
| 84 | +Byte layout: [bits_per_pixel] [data (4 bytes)] |
| 85 | +Binary: 00000010 00011011 00011011 00011011 00011011 |
| 86 | +Hex: 02 1B 1B 1B 1B |
| 87 | +Calculation: 4×4 = 16 pixels × 2 bits = 32 bits = 4 bytes |
| 88 | +Data: 00 01 10 11 | 00 01 10 11 | 00 01 10 11 | 00 01 10 11 |
| 89 | + (Each group of 2 bits is a color index: 0, 1, 2, 3) |
| 90 | +``` |
| 91 | + |
| 92 | +**Example 4: Full custom record** |
| 93 | +``` |
| 94 | +Pixmap: 3×3 bitmap with 8-bit color (256 colors per pixel) |
| 95 | +
|
| 96 | +Byte layout: [width] [height] [bits_per_pixel] [data (9 bytes)] |
| 97 | +Binary: 00000011 00000011 00001000 |
| 98 | + 11111111 00000000 00000000 |
| 99 | + 00000000 11111111 00000000 |
| 100 | + 00000000 00000000 11111111 |
| 101 | +Hex: 03 03 08 |
| 102 | + FF 00 00 |
| 103 | + 00 FF 00 |
| 104 | + 00 00 FF |
| 105 | +Calculation: 3×3 = 9 pixels × 8 bits = 72 bits = 9 bytes |
| 106 | +Data: Red (255,0,0), Green (0,255,0), Blue (0,0,255), repeated 3 times |
| 107 | +``` |
| 108 | + |
| 109 | +**Example 5: Multi-bit packing detail** |
| 110 | +``` |
| 111 | +Pixmap: 6×1 with 2 bits per pixel (4 colors) |
| 112 | +
|
| 113 | +Configuration: constant_height=1, constant_bits_per_pixel=2 |
| 114 | +Byte layout: [width] [data (2 bytes)] |
| 115 | +Binary: 00000110 11100100 01000000 |
| 116 | +Hex: 06 E4 40 |
| 117 | +Calculation: 6 pixels × 2 bits = 12 bits = 2 bytes (4 unused bits) |
| 118 | +
|
| 119 | +Bit breakdown: |
| 120 | +Byte 0: 11 10 01 00 |
| 121 | + ││ ││ ││ ││ |
| 122 | + ││ ││ ││ └└─ Pixel 3: color index 0 |
| 123 | + ││ ││ └└──── Pixel 2: color index 1 |
| 124 | + ││ └└─────── Pixel 1: color index 2 |
| 125 | + └└────────── Pixel 0: color index 3 |
| 126 | +
|
| 127 | +Byte 1: 01 00 00 00 |
| 128 | + ││ ││ ││ ││ |
| 129 | + ││ └└─└└─└└─ Unused padding bits |
| 130 | + └└────────── Pixel 5: color index 1 |
| 131 | + (Pixel 4: 00 = color index 0, spans bytes) |
| 132 | +``` |
| 133 | + |
| 134 | + |
| 135 | +## Complete Table Example |
| 136 | + |
| 137 | + |
| 138 | +The following byte sequence defines a minimal table with example records: |
| 139 | + |
| 140 | +| Byte(s) | Binary | Hex | Description | |
| 141 | +| ------- | ------ | --- | ----------- | |
| 142 | +| 1 | `[BINARY_PLACEHOLDER]` | `[HEX_PLACEHOLDER]` | Table identifier | |
| 143 | +| ... | ... | ... | [DESCRIPTION_PLACEHOLDER] | |
0 commit comments