diff options
author | Brett Weiland <brett_weiland@bpcsapce.com> | 2023-01-12 13:41:48 -0600 |
---|---|---|
committer | Brett Weiland <brett_weiland@bpcsapce.com> | 2023-01-12 13:41:48 -0600 |
commit | b666668d0e6b67e4632e65486cae814ab5abbc39 (patch) | |
tree | 0cf0c2d689799c5e98d505e632248fdc5ed5a072 /tests/xy_to_page.py | |
parent | 94304b11e7220f060dbc345de5fa1952d0465016 (diff) |
updating for linkedin
Diffstat (limited to 'tests/xy_to_page.py')
-rwxr-xr-x | tests/xy_to_page.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/xy_to_page.py b/tests/xy_to_page.py new file mode 100755 index 0000000..dc552d9 --- /dev/null +++ b/tests/xy_to_page.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 + +# +(int(xy / 16) * 16) + int((((xy - (int(xy / 16) * 16)))) / 8) + ((xy - ((int(xy / 16) * 16) + int(((xy - (int(xy / 16) * 16))) / 8) * 8)) * 2) + +BLEN = 2 +WIDTH = 8 +HEIGHT = 4 + +for xy in range(0, 32): + page_offset = int(xy / (BLEN * WIDTH)) * (BLEN * WIDTH) + collumn_offset = int((xy - page_offset) / WIDTH) + + bit_offset = page_offset + collumn_offset + ((xy - (page_offset + collumn_offset * WIDTH)) * BLEN) + + page_location = bit_offset + print(page_location) + #print("pixel {}: bit {}".format(xy, column_offset)) + |