tui_big_text/
pixel_size.rs

1#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, Default)]
2pub enum PixelSize {
3    #[default]
4    /// A pixel from the 8x8 font is represented by a full character cell in the terminal.
5    Full,
6    /// A pixel from the 8x8 font is represented by a half (upper/lower) character cell in the
7    /// terminal.
8    HalfHeight,
9    /// A pixel from the 8x8 font is represented by a half (left/right) character cell in the
10    /// terminal.
11    HalfWidth,
12    /// A pixel from the 8x8 font is represented by a quadrant of a character cell in the
13    /// terminal.
14    Quadrant,
15    /// A pixel from the 8x8 font is represented by a third (top/middle/bottom) of a character
16    /// cell in the terminal.
17    /// *Note: depending on how the used terminal renders characters, the generated text with
18    /// this PixelSize might look very strange.*
19    ThirdHeight,
20    /// A pixel from the 8x8 font is represented by a sextant of a character cell in the
21    /// terminal.
22    /// *Note: depending on how the used terminal renders characters, the generated text with
23    /// this PixelSize might look very strange.*
24    Sextant,
25    /// A pixel from the 8x8 font is represented by a quarter
26    /// (top/upper-middle/lower-middle/bottom) of a character cell in the terminal.
27    /// *Note: depending on how the used terminal renders characters, the generated text with
28    /// this PixelSize might look very strange.*
29    QuarterHeight,
30    /// A pixel from the 8x8 font is represented by an octant of a character cell in the
31    /// terminal.
32    /// *Note: depending on how the used terminal renders characters, the generated text with
33    /// this PixelSize might look very strange.*
34    Octant,
35}
36
37impl PixelSize {
38    /// The number of pixels that can be displayed in a single character cell for the given
39    /// pixel size.
40    ///
41    /// The first value is the number of pixels in the horizontal direction, the second value is
42    /// the number of pixels in the vertical direction.
43    pub(crate) const fn pixels_per_cell(self) -> (u16, u16) {
44        match self {
45            Self::Full => (1, 1),
46            Self::HalfHeight => (1, 2),
47            Self::HalfWidth => (2, 1),
48            Self::Quadrant => (2, 2),
49            Self::ThirdHeight => (1, 3),
50            Self::Sextant => (2, 3),
51            Self::QuarterHeight => (1, 4),
52            Self::Octant => (2, 4),
53        }
54    }
55
56    /// Get a symbol/char that represents the pixels at the given position with the given pixel size
57    pub(crate) const fn symbol_for_position(self, glyph: &[u8; 8], row: usize, col: i32) -> char {
58        match self {
59            Self::Full => match glyph[row] & (1 << col) {
60                0 => ' ',
61                _ => '█',
62            },
63            Self::HalfHeight => {
64                let top = glyph[row] & (1 << col);
65                let bottom = glyph[row + 1] & (1 << col);
66                get_symbol_half_height(top, bottom)
67            }
68            Self::HalfWidth => {
69                let left = glyph[row] & (1 << col);
70                let right = glyph[row] & (1 << (col + 1));
71                get_symbol_half_width(left, right)
72            }
73            Self::Quadrant => {
74                let top_left = glyph[row] & (1 << col);
75                let top_right = glyph[row] & (1 << (col + 1));
76                let bottom_left = glyph[row + 1] & (1 << col);
77                let bottom_right = glyph[row + 1] & (1 << (col + 1));
78                get_symbol_quadrant_size(top_left, top_right, bottom_left, bottom_right)
79            }
80            Self::ThirdHeight => {
81                let top = glyph[row] & (1 << col);
82                let is_middle_available = (row + 1) < glyph.len();
83                let middle = if is_middle_available {
84                    glyph[row + 1] & (1 << col)
85                } else {
86                    0
87                };
88                let is_bottom_available = (row + 2) < glyph.len();
89                let bottom = if is_bottom_available {
90                    glyph[row + 2] & (1 << col)
91                } else {
92                    0
93                };
94                get_symbol_third_height(top, middle, bottom)
95            }
96            Self::Sextant => {
97                let top_left = glyph[row] & (1 << col);
98                let top_right = glyph[row] & (1 << (col + 1));
99                let is_middle_available = (row + 1) < glyph.len();
100                let (middle_left, middle_right) = if is_middle_available {
101                    (
102                        glyph[row + 1] & (1 << col),
103                        glyph[row + 1] & (1 << (col + 1)),
104                    )
105                } else {
106                    (0, 0)
107                };
108                let is_bottom_available = (row + 2) < glyph.len();
109                let (bottom_left, bottom_right) = if is_bottom_available {
110                    (
111                        glyph[row + 2] & (1 << col),
112                        glyph[row + 2] & (1 << (col + 1)),
113                    )
114                } else {
115                    (0, 0)
116                };
117                get_symbol_sextant_size(
118                    top_left,
119                    top_right,
120                    middle_left,
121                    middle_right,
122                    bottom_left,
123                    bottom_right,
124                )
125            }
126            Self::QuarterHeight => {
127                let top = glyph[row] & (1 << col);
128                let is_upper_middle_available = (row + 1) < glyph.len();
129                let upper_middle = if is_upper_middle_available {
130                    glyph[row + 1] & (1 << col)
131                } else {
132                    0
133                };
134                let is_lower_middle_available = (row + 2) < glyph.len();
135                let lower_middle = if is_lower_middle_available {
136                    glyph[row + 2] & (1 << col)
137                } else {
138                    0
139                };
140                let is_bottom_available = (row + 3) < glyph.len();
141                let bottom = if is_bottom_available {
142                    glyph[row + 3] & (1 << col)
143                } else {
144                    0
145                };
146                get_symbol_quarter_height(top, upper_middle, lower_middle, bottom)
147            }
148            Self::Octant => {
149                let top_left = glyph[row] & (1 << col);
150                let top_right = glyph[row] & (1 << (col + 1));
151                let is_upper_middle_available = (row + 1) < glyph.len();
152                let (upper_middle_left, upper_middle_right) = if is_upper_middle_available {
153                    (
154                        glyph[row + 1] & (1 << col),
155                        glyph[row + 1] & (1 << (col + 1)),
156                    )
157                } else {
158                    (0, 0)
159                };
160                let is_lower_middle_available = (row + 2) < glyph.len();
161                let (lower_middle_left, lower_middle_right) = if is_lower_middle_available {
162                    (
163                        glyph[row + 2] & (1 << col),
164                        glyph[row + 2] & (1 << (col + 1)),
165                    )
166                } else {
167                    (0, 0)
168                };
169                let is_bottom_available = (row + 3) < glyph.len();
170                let (bottom_left, bottom_right) = if is_bottom_available {
171                    (
172                        glyph[row + 3] & (1 << col),
173                        glyph[row + 3] & (1 << (col + 1)),
174                    )
175                } else {
176                    (0, 0)
177                };
178                get_symbol_octant_size(
179                    top_left,
180                    top_right,
181                    upper_middle_left,
182                    upper_middle_right,
183                    lower_middle_left,
184                    lower_middle_right,
185                    bottom_left,
186                    bottom_right,
187                )
188            }
189        }
190    }
191}
192
193/// Get the correct unicode symbol for two vertical "pixels"
194const fn get_symbol_half_height(top: u8, bottom: u8) -> char {
195    match top {
196        0 => match bottom {
197            0 => ' ',
198            _ => '▄',
199        },
200        _ => match bottom {
201            0 => '▀',
202            _ => '█',
203        },
204    }
205}
206
207/// Get the correct unicode symbol for two horizontal "pixels"
208const fn get_symbol_half_width(left: u8, right: u8) -> char {
209    match left {
210        0 => match right {
211            0 => ' ',
212            _ => '▐',
213        },
214        _ => match right {
215            0 => '▌',
216            _ => '█',
217        },
218    }
219}
220
221/// Get the correct unicode symbol for 2x2 "pixels"
222const fn get_symbol_quadrant_size(
223    top_left: u8,
224    top_right: u8,
225    bottom_left: u8,
226    bottom_right: u8,
227) -> char {
228    let top_left = if top_left > 0 { 1 } else { 0 };
229    let top_right = if top_right > 0 { 1 } else { 0 };
230    let bottom_left = if bottom_left > 0 { 1 } else { 0 };
231    let bottom_right = if bottom_right > 0 { 1 } else { 0 };
232
233    // We use an array here instead of directly indexing into the unicode symbols, because although
234    // most symbols are in order in unicode, some of them are already part of another character set
235    // and missing in this character set.
236    const QUADRANT_SYMBOLS: [char; 16] = [
237        ' ', '▘', '▝', '▀', '▖', '▌', '▞', '▛', '▗', '▚', '▐', '▜', '▄', '▙', '▟', '█',
238    ];
239    let character_index = top_left + (top_right << 1) + (bottom_left << 2) + (bottom_right << 3);
240
241    QUADRANT_SYMBOLS[character_index]
242}
243
244/// Get the correct unicode symbol for 1x3 "pixels"
245const fn get_symbol_third_height(top: u8, middle: u8, bottom: u8) -> char {
246    get_symbol_sextant_size(top, top, middle, middle, bottom, bottom)
247}
248
249/// Get the correct unicode symbol for 2x3 "pixels"
250const fn get_symbol_sextant_size(
251    top_left: u8,
252    top_right: u8,
253    middle_left: u8,
254    middle_right: u8,
255    bottom_left: u8,
256    bottom_right: u8,
257) -> char {
258    let top_left = if top_left > 0 { 1 } else { 0 };
259    let top_right = if top_right > 0 { 1 } else { 0 };
260    let middle_left = if middle_left > 0 { 1 } else { 0 };
261    let middle_right = if middle_right > 0 { 1 } else { 0 };
262    let bottom_left = if bottom_left > 0 { 1 } else { 0 };
263    let bottom_right = if bottom_right > 0 { 1 } else { 0 };
264
265    // We use an array here instead of directly indexing into the unicode symbols, because although
266    // most symbols are in order in unicode, some of them are already part of another character set
267    // and missing in this character set.
268    const SEXANT_SYMBOLS: [char; 64] = [
269        ' ', '🬀', '🬁', '🬂', '🬃', '🬄', '🬅', '🬆', '🬇', '🬈', '🬉', '🬊', '🬋', '🬌', '🬍', '🬎', '🬏', '🬐',
270        '🬑', '🬒', '🬓', '▌', '🬔', '🬕', '🬖', '🬗', '🬘', '🬙', '🬚', '🬛', '🬜', '🬝', '🬞', '🬟', '🬠', '🬡',
271        '🬢', '🬣', '🬤', '🬥', '🬦', '🬧', '▐', '🬨', '🬩', '🬪', '🬫', '🬬', '🬭', '🬮', '🬯', '🬰', '🬱', '🬲',
272        '🬳', '🬴', '🬵', '🬶', '🬷', '🬸', '🬹', '🬺', '🬻', '█',
273    ];
274    let character_index = top_left
275        + (top_right << 1)
276        + (middle_left << 2)
277        + (middle_right << 3)
278        + (bottom_left << 4)
279        + (bottom_right << 5);
280
281    SEXANT_SYMBOLS[character_index]
282}
283
284/// Get the correct unicode symbol for 1x4 "pixels"
285const fn get_symbol_quarter_height(
286    top: u8,
287    upper_middle: u8,
288    lower_middle: u8,
289    bottom: u8,
290) -> char {
291    get_symbol_octant_size(
292        top,
293        top,
294        upper_middle,
295        upper_middle,
296        lower_middle,
297        lower_middle,
298        bottom,
299        bottom,
300    )
301}
302
303/// Get the correct unicode symbol for 2x4 "pixels"
304#[allow(clippy::too_many_arguments)]
305const fn get_symbol_octant_size(
306    top_left: u8,
307    top_right: u8,
308    upper_middle_left: u8,
309    upper_middle_right: u8,
310    lower_middle_left: u8,
311    lower_middle_right: u8,
312    bottom_left: u8,
313    bottom_right: u8,
314) -> char {
315    let top_left = if top_left > 0 { 1 } else { 0 };
316    let top_right = if top_right > 0 { 1 } else { 0 };
317    let upper_middle_left = if upper_middle_left > 0 { 1 } else { 0 };
318    let upper_middle_right = if upper_middle_right > 0 { 1 } else { 0 };
319    let lower_middle_left = if lower_middle_left > 0 { 1 } else { 0 };
320    let lower_middle_right = if lower_middle_right > 0 { 1 } else { 0 };
321    let bottom_left = if bottom_left > 0 { 1 } else { 0 };
322    let bottom_right = if bottom_right > 0 { 1 } else { 0 };
323
324    // We use an array here instead of directly indexing into the unicode symbols, because although
325    // most symbols are in order in unicode, some of them are already part of another character set
326    // and missing in this character set.
327    const OCTANT_SYMBOLS: [char; 256] = [
328        ' ', '𜺨', '𜺫', '🮂', '𜴀', '▘', '𜴁', '𜴂', '𜴃', '𜴄', '▝', '𜴅', '𜴆', '𜴇', '𜴈', '▀', '𜴉', '𜴊',
329        '𜴋', '𜴌', '🯦', '𜴍', '𜴎', '𜴏', '𜴐', '𜴑', '𜴒', '𜴓', '𜴔', '𜴕', '𜴖', '𜴗', '𜴘', '𜴙', '𜴚', '𜴛',
330        '𜴜', '𜴝', '𜴞', '𜴟', '🯧', '𜴠', '𜴡', '𜴢', '𜴣', '𜴤', '𜴥', '𜴦', '𜴧', '𜴨', '𜴩', '𜴪', '𜴫', '𜴬',
331        '𜴭', '𜴮', '𜴯', '𜴰', '𜴱', '𜴲', '𜴳', '𜴴', '𜴵', '🮅', '𜺣', '𜴶', '𜴷', '𜴸', '𜴹', '𜴺', '𜴻', '𜴼',
332        '𜴽', '𜴾', '𜴿', '𜵀', '𜵁', '𜵂', '𜵃', '𜵄', '▖', '𜵅', '𜵆', '𜵇', '𜵈', '▌', '𜵉', '𜵊', '𜵋', '𜵌',
333        '▞', '𜵍', '𜵎', '𜵏', '𜵐', '▛', '𜵑', '𜵒', '𜵓', '𜵔', '𜵕', '𜵖', '𜵗', '𜵘', '𜵙', '𜵚', '𜵛', '𜵜',
334        '𜵝', '𜵞', '𜵟', '𜵠', '𜵡', '𜵢', '𜵣', '𜵤', '𜵥', '𜵦', '𜵧', '𜵨', '𜵩', '𜵪', '𜵫', '𜵬', '𜵭', '𜵮',
335        '𜵯', '𜵰', '𜺠', '𜵱', '𜵲', '𜵳', '𜵴', '𜵵', '𜵶', '𜵷', '𜵸', '𜵹', '𜵺', '𜵻', '𜵼', '𜵽', '𜵾', '𜵿',
336        '𜶀', '𜶁', '𜶂', '𜶃', '𜶄', '𜶅', '𜶆', '𜶇', '𜶈', '𜶉', '𜶊', '𜶋', '𜶌', '𜶍', '𜶎', '𜶏', '▗', '𜶐',
337        '𜶑', '𜶒', '𜶓', '▚', '𜶔', '𜶕', '𜶖', '𜶗', '▐', '𜶘', '𜶙', '𜶚', '𜶛', '▜', '𜶜', '𜶝', '𜶞', '𜶟',
338        '𜶠', '𜶡', '𜶢', '𜶣', '𜶤', '𜶥', '𜶦', '𜶧', '𜶨', '𜶩', '𜶪', '𜶫', '▂', '𜶬', '𜶭', '𜶮', '𜶯', '𜶰',
339        '𜶱', '𜶲', '𜶳', '𜶴', '𜶵', '𜶶', '𜶷', '𜶸', '𜶹', '𜶺', '𜶻', '𜶼', '𜶽', '𜶾', '𜶿', '𜷀', '𜷁', '𜷂',
340        '𜷃', '𜷄', '𜷅', '𜷆', '𜷇', '𜷈', '𜷉', '𜷊', '𜷋', '𜷌', '𜷍', '𜷎', '𜷏', '𜷐', '𜷑', '𜷒', '𜷓', '𜷔',
341        '𜷕', '𜷖', '𜷗', '𜷘', '𜷙', '𜷚', '▄', '𜷛', '𜷜', '𜷝', '𜷞', '▙', '𜷟', '𜷠', '𜷡', '𜷢', '▟', '𜷣',
342        '▆', '𜷤', '𜷥', '█',
343    ];
344    let character_index = top_left
345        + (top_right << 1)
346        + (upper_middle_left << 2)
347        + (upper_middle_right << 3)
348        + (lower_middle_left << 4)
349        + (lower_middle_right << 5)
350        + (bottom_left << 6)
351        + (bottom_right << 7);
352
353    OCTANT_SYMBOLS[character_index]
354}
355
356#[cfg(test)]
357mod tests {
358    use super::*;
359
360    type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
361
362    #[test]
363    fn check_quadrant_size_symbols() -> Result<()> {
364        assert_eq!(get_symbol_quadrant_size(0, 0, 0, 0), ' ');
365        assert_eq!(get_symbol_quadrant_size(1, 0, 0, 0), '▘');
366        assert_eq!(get_symbol_quadrant_size(0, 1, 0, 0), '▝');
367        assert_eq!(get_symbol_quadrant_size(1, 1, 0, 0), '▀');
368        assert_eq!(get_symbol_quadrant_size(0, 0, 1, 0), '▖');
369        assert_eq!(get_symbol_quadrant_size(1, 0, 1, 0), '▌');
370        assert_eq!(get_symbol_quadrant_size(0, 1, 1, 0), '▞');
371        assert_eq!(get_symbol_quadrant_size(1, 1, 1, 0), '▛');
372        assert_eq!(get_symbol_quadrant_size(0, 0, 0, 1), '▗');
373        assert_eq!(get_symbol_quadrant_size(1, 0, 0, 1), '▚');
374        assert_eq!(get_symbol_quadrant_size(0, 1, 0, 1), '▐');
375        assert_eq!(get_symbol_quadrant_size(1, 1, 0, 1), '▜');
376        assert_eq!(get_symbol_quadrant_size(0, 0, 1, 1), '▄');
377        assert_eq!(get_symbol_quadrant_size(1, 0, 1, 1), '▙');
378        assert_eq!(get_symbol_quadrant_size(0, 1, 1, 1), '▟');
379        assert_eq!(get_symbol_quadrant_size(1, 1, 1, 1), '█');
380        Ok(())
381    }
382
383    #[test]
384    #[allow(clippy::cognitive_complexity)]
385    fn check_sextant_size_symbols() -> Result<()> {
386        assert_eq!(get_symbol_sextant_size(0, 0, 0, 0, 0, 0), ' ');
387        assert_eq!(get_symbol_sextant_size(1, 0, 0, 0, 0, 0), '🬀');
388        assert_eq!(get_symbol_sextant_size(0, 1, 0, 0, 0, 0), '🬁');
389        assert_eq!(get_symbol_sextant_size(1, 1, 0, 0, 0, 0), '🬂');
390        assert_eq!(get_symbol_sextant_size(0, 0, 1, 0, 0, 0), '🬃');
391        assert_eq!(get_symbol_sextant_size(1, 0, 1, 0, 0, 0), '🬄');
392        assert_eq!(get_symbol_sextant_size(0, 1, 1, 0, 0, 0), '🬅');
393        assert_eq!(get_symbol_sextant_size(1, 1, 1, 0, 0, 0), '🬆');
394        assert_eq!(get_symbol_sextant_size(0, 0, 0, 1, 0, 0), '🬇');
395        assert_eq!(get_symbol_sextant_size(1, 0, 0, 1, 0, 0), '🬈');
396        assert_eq!(get_symbol_sextant_size(0, 1, 0, 1, 0, 0), '🬉');
397        assert_eq!(get_symbol_sextant_size(1, 1, 0, 1, 0, 0), '🬊');
398        assert_eq!(get_symbol_sextant_size(0, 0, 1, 1, 0, 0), '🬋');
399        assert_eq!(get_symbol_sextant_size(1, 0, 1, 1, 0, 0), '🬌');
400        assert_eq!(get_symbol_sextant_size(0, 1, 1, 1, 0, 0), '🬍');
401        assert_eq!(get_symbol_sextant_size(1, 1, 1, 1, 0, 0), '🬎');
402        assert_eq!(get_symbol_sextant_size(0, 0, 0, 0, 1, 0), '🬏');
403        assert_eq!(get_symbol_sextant_size(1, 0, 0, 0, 1, 0), '🬐');
404        assert_eq!(get_symbol_sextant_size(0, 1, 0, 0, 1, 0), '🬑');
405        assert_eq!(get_symbol_sextant_size(1, 1, 0, 0, 1, 0), '🬒');
406        assert_eq!(get_symbol_sextant_size(0, 0, 1, 0, 1, 0), '🬓');
407        assert_eq!(get_symbol_sextant_size(1, 0, 1, 0, 1, 0), '▌');
408        assert_eq!(get_symbol_sextant_size(0, 1, 1, 0, 1, 0), '🬔');
409        assert_eq!(get_symbol_sextant_size(1, 1, 1, 0, 1, 0), '🬕');
410        assert_eq!(get_symbol_sextant_size(0, 0, 0, 1, 1, 0), '🬖');
411        assert_eq!(get_symbol_sextant_size(1, 0, 0, 1, 1, 0), '🬗');
412        assert_eq!(get_symbol_sextant_size(0, 1, 0, 1, 1, 0), '🬘');
413        assert_eq!(get_symbol_sextant_size(1, 1, 0, 1, 1, 0), '🬙');
414        assert_eq!(get_symbol_sextant_size(0, 0, 1, 1, 1, 0), '🬚');
415        assert_eq!(get_symbol_sextant_size(1, 0, 1, 1, 1, 0), '🬛');
416        assert_eq!(get_symbol_sextant_size(0, 1, 1, 1, 1, 0), '🬜');
417        assert_eq!(get_symbol_sextant_size(1, 1, 1, 1, 1, 0), '🬝');
418        assert_eq!(get_symbol_sextant_size(0, 0, 0, 0, 0, 1), '🬞');
419        assert_eq!(get_symbol_sextant_size(1, 0, 0, 0, 0, 1), '🬟');
420        assert_eq!(get_symbol_sextant_size(0, 1, 0, 0, 0, 1), '🬠');
421        assert_eq!(get_symbol_sextant_size(1, 1, 0, 0, 0, 1), '🬡');
422        assert_eq!(get_symbol_sextant_size(0, 0, 1, 0, 0, 1), '🬢');
423        assert_eq!(get_symbol_sextant_size(1, 0, 1, 0, 0, 1), '🬣');
424        assert_eq!(get_symbol_sextant_size(0, 1, 1, 0, 0, 1), '🬤');
425        assert_eq!(get_symbol_sextant_size(1, 1, 1, 0, 0, 1), '🬥');
426        assert_eq!(get_symbol_sextant_size(0, 0, 0, 1, 0, 1), '🬦');
427        assert_eq!(get_symbol_sextant_size(1, 0, 0, 1, 0, 1), '🬧');
428        assert_eq!(get_symbol_sextant_size(0, 1, 0, 1, 0, 1), '▐');
429        assert_eq!(get_symbol_sextant_size(1, 1, 0, 1, 0, 1), '🬨');
430        assert_eq!(get_symbol_sextant_size(0, 0, 1, 1, 0, 1), '🬩');
431        assert_eq!(get_symbol_sextant_size(1, 0, 1, 1, 0, 1), '🬪');
432        assert_eq!(get_symbol_sextant_size(0, 1, 1, 1, 0, 1), '🬫');
433        assert_eq!(get_symbol_sextant_size(1, 1, 1, 1, 0, 1), '🬬');
434        assert_eq!(get_symbol_sextant_size(0, 0, 0, 0, 1, 1), '🬭');
435        assert_eq!(get_symbol_sextant_size(1, 0, 0, 0, 1, 1), '🬮');
436        assert_eq!(get_symbol_sextant_size(0, 1, 0, 0, 1, 1), '🬯');
437        assert_eq!(get_symbol_sextant_size(1, 1, 0, 0, 1, 1), '🬰');
438        assert_eq!(get_symbol_sextant_size(0, 0, 1, 0, 1, 1), '🬱');
439        assert_eq!(get_symbol_sextant_size(1, 0, 1, 0, 1, 1), '🬲');
440        assert_eq!(get_symbol_sextant_size(0, 1, 1, 0, 1, 1), '🬳');
441        assert_eq!(get_symbol_sextant_size(1, 1, 1, 0, 1, 1), '🬴');
442        assert_eq!(get_symbol_sextant_size(0, 0, 0, 1, 1, 1), '🬵');
443        assert_eq!(get_symbol_sextant_size(1, 0, 0, 1, 1, 1), '🬶');
444        assert_eq!(get_symbol_sextant_size(0, 1, 0, 1, 1, 1), '🬷');
445        assert_eq!(get_symbol_sextant_size(1, 1, 0, 1, 1, 1), '🬸');
446        assert_eq!(get_symbol_sextant_size(0, 0, 1, 1, 1, 1), '🬹');
447        assert_eq!(get_symbol_sextant_size(1, 0, 1, 1, 1, 1), '🬺');
448        assert_eq!(get_symbol_sextant_size(0, 1, 1, 1, 1, 1), '🬻');
449        assert_eq!(get_symbol_sextant_size(1, 1, 1, 1, 1, 1), '█');
450        Ok(())
451    }
452
453    #[test]
454    #[allow(clippy::cognitive_complexity)]
455    fn check_octant_size_symbols() -> Result<()> {
456        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 0, 0, 0, 0), ' ');
457        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 0, 0, 0, 0), '𜺨');
458        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 0, 0, 0, 0), '𜺫');
459        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 0, 0, 0, 0), '🮂');
460        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 0, 0, 0, 0), '𜴀');
461        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 0, 0, 0, 0), '▘');
462        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 0, 0, 0, 0), '𜴁');
463        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 0, 0, 0, 0), '𜴂');
464        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 0, 0, 0, 0), '𜴃');
465        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 0, 0, 0, 0), '𜴄');
466        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 0, 0, 0, 0), '▝');
467        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 0, 0, 0, 0), '𜴅');
468        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 0, 0, 0, 0), '𜴆');
469        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 0, 0, 0, 0), '𜴇');
470        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 0, 0, 0, 0), '𜴈');
471        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 0, 0, 0, 0), '▀');
472        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 1, 0, 0, 0), '𜴉');
473        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 1, 0, 0, 0), '𜴊');
474        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 1, 0, 0, 0), '𜴋');
475        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 1, 0, 0, 0), '𜴌');
476        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 1, 0, 0, 0), '🯦');
477        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 1, 0, 0, 0), '𜴍');
478        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 1, 0, 0, 0), '𜴎');
479        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 1, 0, 0, 0), '𜴏');
480        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 1, 0, 0, 0), '𜴐');
481        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 1, 0, 0, 0), '𜴑');
482        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 1, 0, 0, 0), '𜴒');
483        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 1, 0, 0, 0), '𜴓');
484        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 1, 0, 0, 0), '𜴔');
485        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 1, 0, 0, 0), '𜴕');
486        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 1, 0, 0, 0), '𜴖');
487        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 1, 0, 0, 0), '𜴗');
488        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 0, 1, 0, 0), '𜴘');
489        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 0, 1, 0, 0), '𜴙');
490        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 0, 1, 0, 0), '𜴚');
491        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 0, 1, 0, 0), '𜴛');
492        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 0, 1, 0, 0), '𜴜');
493        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 0, 1, 0, 0), '𜴝');
494        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 0, 1, 0, 0), '𜴞');
495        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 0, 1, 0, 0), '𜴟');
496        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 0, 1, 0, 0), '🯧');
497        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 0, 1, 0, 0), '𜴠');
498        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 0, 1, 0, 0), '𜴡');
499        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 0, 1, 0, 0), '𜴢');
500        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 0, 1, 0, 0), '𜴣');
501        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 0, 1, 0, 0), '𜴤');
502        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 0, 1, 0, 0), '𜴥');
503        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 0, 1, 0, 0), '𜴦');
504        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 1, 1, 0, 0), '𜴧');
505        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 1, 1, 0, 0), '𜴨');
506        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 1, 1, 0, 0), '𜴩');
507        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 1, 1, 0, 0), '𜴪');
508        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 1, 1, 0, 0), '𜴫');
509        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 1, 1, 0, 0), '𜴬');
510        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 1, 1, 0, 0), '𜴭');
511        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 1, 1, 0, 0), '𜴮');
512        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 1, 1, 0, 0), '𜴯');
513        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 1, 1, 0, 0), '𜴰');
514        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 1, 1, 0, 0), '𜴱');
515        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 1, 1, 0, 0), '𜴲');
516        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 1, 1, 0, 0), '𜴳');
517        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 1, 1, 0, 0), '𜴴');
518        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 1, 1, 0, 0), '𜴵');
519        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 1, 1, 0, 0), '🮅');
520        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 0, 0, 1, 0), '𜺣');
521        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 0, 0, 1, 0), '𜴶');
522        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 0, 0, 1, 0), '𜴷');
523        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 0, 0, 1, 0), '𜴸');
524        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 0, 0, 1, 0), '𜴹');
525        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 0, 0, 1, 0), '𜴺');
526        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 0, 0, 1, 0), '𜴻');
527        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 0, 0, 1, 0), '𜴼');
528        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 0, 0, 1, 0), '𜴽');
529        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 0, 0, 1, 0), '𜴾');
530        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 0, 0, 1, 0), '𜴿');
531        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 0, 0, 1, 0), '𜵀');
532        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 0, 0, 1, 0), '𜵁');
533        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 0, 0, 1, 0), '𜵂');
534        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 0, 0, 1, 0), '𜵃');
535        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 0, 0, 1, 0), '𜵄');
536        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 1, 0, 1, 0), '▖');
537        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 1, 0, 1, 0), '𜵅');
538        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 1, 0, 1, 0), '𜵆');
539        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 1, 0, 1, 0), '𜵇');
540        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 1, 0, 1, 0), '𜵈');
541        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 1, 0, 1, 0), '▌');
542        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 1, 0, 1, 0), '𜵉');
543        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 1, 0, 1, 0), '𜵊');
544        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 1, 0, 1, 0), '𜵋');
545        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 1, 0, 1, 0), '𜵌');
546        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 1, 0, 1, 0), '▞');
547        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 1, 0, 1, 0), '𜵍');
548        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 1, 0, 1, 0), '𜵎');
549        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 1, 0, 1, 0), '𜵏');
550        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 1, 0, 1, 0), '𜵐');
551        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 1, 0, 1, 0), '▛');
552        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 0, 1, 1, 0), '𜵑');
553        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 0, 1, 1, 0), '𜵒');
554        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 0, 1, 1, 0), '𜵓');
555        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 0, 1, 1, 0), '𜵔');
556        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 0, 1, 1, 0), '𜵕');
557        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 0, 1, 1, 0), '𜵖');
558        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 0, 1, 1, 0), '𜵗');
559        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 0, 1, 1, 0), '𜵘');
560        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 0, 1, 1, 0), '𜵙');
561        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 0, 1, 1, 0), '𜵚');
562        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 0, 1, 1, 0), '𜵛');
563        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 0, 1, 1, 0), '𜵜');
564        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 0, 1, 1, 0), '𜵝');
565        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 0, 1, 1, 0), '𜵞');
566        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 0, 1, 1, 0), '𜵟');
567        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 0, 1, 1, 0), '𜵠');
568        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 1, 1, 1, 0), '𜵡');
569        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 1, 1, 1, 0), '𜵢');
570        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 1, 1, 1, 0), '𜵣');
571        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 1, 1, 1, 0), '𜵤');
572        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 1, 1, 1, 0), '𜵥');
573        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 1, 1, 1, 0), '𜵦');
574        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 1, 1, 1, 0), '𜵧');
575        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 1, 1, 1, 0), '𜵨');
576        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 1, 1, 1, 0), '𜵩');
577        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 1, 1, 1, 0), '𜵪');
578        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 1, 1, 1, 0), '𜵫');
579        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 1, 1, 1, 0), '𜵬');
580        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 1, 1, 1, 0), '𜵭');
581        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 1, 1, 1, 0), '𜵮');
582        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 1, 1, 1, 0), '𜵯');
583        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 1, 1, 1, 0), '𜵰');
584        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 0, 0, 0, 1), '𜺠');
585        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 0, 0, 0, 1), '𜵱');
586        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 0, 0, 0, 1), '𜵲');
587        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 0, 0, 0, 1), '𜵳');
588        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 0, 0, 0, 1), '𜵴');
589        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 0, 0, 0, 1), '𜵵');
590        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 0, 0, 0, 1), '𜵶');
591        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 0, 0, 0, 1), '𜵷');
592        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 0, 0, 0, 1), '𜵸');
593        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 0, 0, 0, 1), '𜵹');
594        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 0, 0, 0, 1), '𜵺');
595        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 0, 0, 0, 1), '𜵻');
596        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 0, 0, 0, 1), '𜵼');
597        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 0, 0, 0, 1), '𜵽');
598        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 0, 0, 0, 1), '𜵾');
599        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 0, 0, 0, 1), '𜵿');
600        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 1, 0, 0, 1), '𜶀');
601        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 1, 0, 0, 1), '𜶁');
602        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 1, 0, 0, 1), '𜶂');
603        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 1, 0, 0, 1), '𜶃');
604        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 1, 0, 0, 1), '𜶄');
605        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 1, 0, 0, 1), '𜶅');
606        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 1, 0, 0, 1), '𜶆');
607        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 1, 0, 0, 1), '𜶇');
608        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 1, 0, 0, 1), '𜶈');
609        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 1, 0, 0, 1), '𜶉');
610        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 1, 0, 0, 1), '𜶊');
611        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 1, 0, 0, 1), '𜶋');
612        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 1, 0, 0, 1), '𜶌');
613        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 1, 0, 0, 1), '𜶍');
614        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 1, 0, 0, 1), '𜶎');
615        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 1, 0, 0, 1), '𜶏');
616        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 0, 1, 0, 1), '▗');
617        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 0, 1, 0, 1), '𜶐');
618        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 0, 1, 0, 1), '𜶑');
619        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 0, 1, 0, 1), '𜶒');
620        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 0, 1, 0, 1), '𜶓');
621        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 0, 1, 0, 1), '▚');
622        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 0, 1, 0, 1), '𜶔');
623        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 0, 1, 0, 1), '𜶕');
624        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 0, 1, 0, 1), '𜶖');
625        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 0, 1, 0, 1), '𜶗');
626        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 0, 1, 0, 1), '▐');
627        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 0, 1, 0, 1), '𜶘');
628        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 0, 1, 0, 1), '𜶙');
629        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 0, 1, 0, 1), '𜶚');
630        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 0, 1, 0, 1), '𜶛');
631        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 0, 1, 0, 1), '▜');
632        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 1, 1, 0, 1), '𜶜');
633        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 1, 1, 0, 1), '𜶝');
634        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 1, 1, 0, 1), '𜶞');
635        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 1, 1, 0, 1), '𜶟');
636        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 1, 1, 0, 1), '𜶠');
637        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 1, 1, 0, 1), '𜶡');
638        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 1, 1, 0, 1), '𜶢');
639        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 1, 1, 0, 1), '𜶣');
640        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 1, 1, 0, 1), '𜶤');
641        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 1, 1, 0, 1), '𜶥');
642        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 1, 1, 0, 1), '𜶦');
643        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 1, 1, 0, 1), '𜶧');
644        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 1, 1, 0, 1), '𜶨');
645        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 1, 1, 0, 1), '𜶩');
646        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 1, 1, 0, 1), '𜶪');
647        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 1, 1, 0, 1), '𜶫');
648        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 0, 0, 1, 1), '▂');
649        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 0, 0, 1, 1), '𜶬');
650        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 0, 0, 1, 1), '𜶭');
651        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 0, 0, 1, 1), '𜶮');
652        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 0, 0, 1, 1), '𜶯');
653        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 0, 0, 1, 1), '𜶰');
654        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 0, 0, 1, 1), '𜶱');
655        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 0, 0, 1, 1), '𜶲');
656        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 0, 0, 1, 1), '𜶳');
657        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 0, 0, 1, 1), '𜶴');
658        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 0, 0, 1, 1), '𜶵');
659        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 0, 0, 1, 1), '𜶶');
660        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 0, 0, 1, 1), '𜶷');
661        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 0, 0, 1, 1), '𜶸');
662        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 0, 0, 1, 1), '𜶹');
663        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 0, 0, 1, 1), '𜶺');
664        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 1, 0, 1, 1), '𜶻');
665        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 1, 0, 1, 1), '𜶼');
666        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 1, 0, 1, 1), '𜶽');
667        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 1, 0, 1, 1), '𜶾');
668        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 1, 0, 1, 1), '𜶿');
669        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 1, 0, 1, 1), '𜷀');
670        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 1, 0, 1, 1), '𜷁');
671        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 1, 0, 1, 1), '𜷂');
672        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 1, 0, 1, 1), '𜷃');
673        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 1, 0, 1, 1), '𜷄');
674        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 1, 0, 1, 1), '𜷅');
675        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 1, 0, 1, 1), '𜷆');
676        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 1, 0, 1, 1), '𜷇');
677        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 1, 0, 1, 1), '𜷈');
678        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 1, 0, 1, 1), '𜷉');
679        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 1, 0, 1, 1), '𜷊');
680        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 0, 1, 1, 1), '𜷋');
681        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 0, 1, 1, 1), '𜷌');
682        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 0, 1, 1, 1), '𜷍');
683        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 0, 1, 1, 1), '𜷎');
684        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 0, 1, 1, 1), '𜷏');
685        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 0, 1, 1, 1), '𜷐');
686        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 0, 1, 1, 1), '𜷑');
687        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 0, 1, 1, 1), '𜷒');
688        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 0, 1, 1, 1), '𜷓');
689        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 0, 1, 1, 1), '𜷔');
690        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 0, 1, 1, 1), '𜷕');
691        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 0, 1, 1, 1), '𜷖');
692        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 0, 1, 1, 1), '𜷗');
693        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 0, 1, 1, 1), '𜷘');
694        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 0, 1, 1, 1), '𜷙');
695        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 0, 1, 1, 1), '𜷚');
696        assert_eq!(get_symbol_octant_size(0, 0, 0, 0, 1, 1, 1, 1), '▄');
697        assert_eq!(get_symbol_octant_size(1, 0, 0, 0, 1, 1, 1, 1), '𜷛');
698        assert_eq!(get_symbol_octant_size(0, 1, 0, 0, 1, 1, 1, 1), '𜷜');
699        assert_eq!(get_symbol_octant_size(1, 1, 0, 0, 1, 1, 1, 1), '𜷝');
700        assert_eq!(get_symbol_octant_size(0, 0, 1, 0, 1, 1, 1, 1), '𜷞');
701        assert_eq!(get_symbol_octant_size(1, 0, 1, 0, 1, 1, 1, 1), '▙');
702        assert_eq!(get_symbol_octant_size(0, 1, 1, 0, 1, 1, 1, 1), '𜷟');
703        assert_eq!(get_symbol_octant_size(1, 1, 1, 0, 1, 1, 1, 1), '𜷠');
704        assert_eq!(get_symbol_octant_size(0, 0, 0, 1, 1, 1, 1, 1), '𜷡');
705        assert_eq!(get_symbol_octant_size(1, 0, 0, 1, 1, 1, 1, 1), '𜷢');
706        assert_eq!(get_symbol_octant_size(0, 1, 0, 1, 1, 1, 1, 1), '▟');
707        assert_eq!(get_symbol_octant_size(1, 1, 0, 1, 1, 1, 1, 1), '𜷣');
708        assert_eq!(get_symbol_octant_size(0, 0, 1, 1, 1, 1, 1, 1), '▆');
709        assert_eq!(get_symbol_octant_size(1, 0, 1, 1, 1, 1, 1, 1), '𜷤');
710        assert_eq!(get_symbol_octant_size(0, 1, 1, 1, 1, 1, 1, 1), '𜷥');
711        assert_eq!(get_symbol_octant_size(1, 1, 1, 1, 1, 1, 1, 1), '█');
712        Ok(())
713    }
714
715    #[test]
716    fn check_half_width_symbols() -> Result<()> {
717        assert_eq!(get_symbol_half_width(0, 0), ' ');
718        assert_eq!(get_symbol_half_width(1, 0), '▌');
719        assert_eq!(get_symbol_half_width(0, 1), '▐');
720        assert_eq!(get_symbol_half_width(1, 1), '█');
721        Ok(())
722    }
723
724    #[test]
725    fn check_half_height_symbols() -> Result<()> {
726        assert_eq!(get_symbol_half_height(0, 0), ' ');
727        assert_eq!(get_symbol_half_height(1, 0), '▀');
728        assert_eq!(get_symbol_half_height(0, 1), '▄');
729        assert_eq!(get_symbol_half_height(1, 1), '█');
730        Ok(())
731    }
732
733    #[test]
734    fn check_third_height_symbols() -> Result<()> {
735        assert_eq!(get_symbol_third_height(0, 0, 0), ' ');
736        assert_eq!(get_symbol_third_height(1, 0, 0), '🬂');
737        assert_eq!(get_symbol_third_height(0, 1, 0), '🬋');
738        assert_eq!(get_symbol_third_height(1, 1, 0), '🬎');
739        assert_eq!(get_symbol_third_height(0, 0, 1), '🬭');
740        assert_eq!(get_symbol_third_height(1, 0, 1), '🬰');
741        assert_eq!(get_symbol_third_height(0, 1, 1), '🬹');
742        assert_eq!(get_symbol_third_height(1, 1, 1), '█');
743        Ok(())
744    }
745
746    #[test]
747    fn check_quarter_height_symbols() -> Result<()> {
748        assert_eq!(get_symbol_quarter_height(0, 0, 0, 0), ' ');
749        assert_eq!(get_symbol_quarter_height(1, 0, 0, 0), '🮂');
750        assert_eq!(get_symbol_quarter_height(0, 1, 0, 0), '𜴆');
751        assert_eq!(get_symbol_quarter_height(1, 1, 0, 0), '▀');
752        assert_eq!(get_symbol_quarter_height(0, 0, 1, 0), '𜴧');
753        assert_eq!(get_symbol_quarter_height(1, 0, 1, 0), '𜴪');
754        assert_eq!(get_symbol_quarter_height(0, 1, 1, 0), '𜴳');
755        assert_eq!(get_symbol_quarter_height(1, 1, 1, 0), '🮅');
756        assert_eq!(get_symbol_quarter_height(0, 0, 0, 1), '▂');
757        assert_eq!(get_symbol_quarter_height(1, 0, 0, 1), '𜶮');
758        assert_eq!(get_symbol_quarter_height(0, 1, 0, 1), '𜶷');
759        assert_eq!(get_symbol_quarter_height(1, 1, 0, 1), '𜶺');
760        assert_eq!(get_symbol_quarter_height(0, 0, 1, 1), '▄');
761        assert_eq!(get_symbol_quarter_height(1, 0, 1, 1), '𜷝');
762        assert_eq!(get_symbol_quarter_height(0, 1, 1, 1), '▆');
763        assert_eq!(get_symbol_quarter_height(1, 1, 1, 1), '█');
764        Ok(())
765    }
766
767    #[test]
768    fn check_get_symbol_for_position_in_glyph_third_height_defensive_middle() -> Result<()> {
769        // In this test, we set all pixels of the glyph to 1 (all bytes are u8-max)
770        // We expect that pixels out of the glyph-bounds are not set
771        // Returned character is upper third filled only
772
773        let glyph = [0xFFu8; 8];
774        assert_eq!(
775            PixelSize::ThirdHeight.symbol_for_position(&glyph, 7, 0),
776            '🬂'
777        );
778        Ok(())
779    }
780
781    #[test]
782    fn check_get_symbol_for_position_in_glyph_sextant_size_defensive_middle() -> Result<()> {
783        // In this test, we set all pixels of the glyph to 1 (all bytes are u8-max)
784        // We expect that pixels out of the glyph-bounds are not set
785        // Returned character is upper third filled only
786
787        let glyph = [0xFFu8; 8];
788        assert_eq!(PixelSize::Sextant.symbol_for_position(&glyph, 7, 0), '🬂');
789        Ok(())
790    }
791}