From b75df3642c8419beab2c2dcf519eb418ba01d4f8 Mon Sep 17 00:00:00 2001 From: sz Date: Sun, 11 Feb 2024 03:17:58 -0600 Subject: [PATCH] widescreen 8x9??? idk --- cimbar/conf.py | 216 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 204 insertions(+), 12 deletions(-) diff --git a/cimbar/conf.py b/cimbar/conf.py index b1ae384..faeaf47 100644 --- a/cimbar/conf.py +++ b/cimbar/conf.py @@ -1,6 +1,11 @@ import sys +class _Conf: + # autofill the default CELL_*_Y values somehow? + pass + + class og8x8: TOTAL_SIZE = 1024 BITS_PER_SYMBOL = 4 @@ -42,6 +47,26 @@ class sq8x8: MARKER_SIZE_Y = round(54 / CELL_SPACING_Y) # 6 or 9, probably +class sq8x9bw: + TOTAL_SIZE = (1420, 1024) + BITS_PER_SYMBOL = 4 + BITS_PER_COLOR = 2 + CELL_SIZE = 8 + CELL_SPACING_X = CELL_SIZE + 1 + CELL_SPACING_Y = CELL_SIZE + CELL_DIM_X = 156 + CELL_DIM_Y = 126 + CELLS_OFFSET = 9 + ECC = 34 + ECC_BLOCK_SIZE = 174 + INTERLEAVE_PARTITIONS = 2 + FOUNTAIN_BLOCKS = 0 + + INTERLEAVE_BLOCKS = ECC_BLOCK_SIZE + MARKER_SIZE_X = round(54 / CELL_SPACING_X) + MARKER_SIZE_Y = round(54 / CELL_SPACING_Y) # 6 or 9, probably + + class sq5x5: TOTAL_SIZE = 988 BITS_PER_SYMBOL = 2 @@ -50,10 +75,10 @@ class sq5x5: CELL_SPACING_X = CELL_SIZE + 1 CELL_DIM_X = 162 CELLS_OFFSET = 9 - ECC = 40 # 32? + ECC = 40 # or 42? # w/ 162, 32? ECC_BLOCK_SIZE = 216 # 162? INTERLEAVE_PARTITIONS = 2 - FOUNTAIN_BLOCKS = 0 # dynamic + FOUNTAIN_BLOCKS = 0 # dynamic.. could be *2 or *3? CELL_DIM_Y = CELL_DIM_X CELL_SPACING_Y = CELL_SPACING_X @@ -62,7 +87,67 @@ class sq5x5: MARKER_SIZE_Y = round(54 / CELL_SPACING_Y) # 6 or 9, probably -class sq5x6: +class sq5x5wide: + TOTAL_SIZE = (1494, 1048) + BITS_PER_SYMBOL = 2 + BITS_PER_COLOR = 2 + CELL_SIZE = 5 + CELL_SPACING_X = CELL_SIZE + 1 + CELL_DIM_X = 249 + CELL_DIM_Y = 172 + CELLS_OFFSET = 9 + ECC = 51 + ECC_BLOCK_SIZE = 253 + INTERLEAVE_PARTITIONS = 2 + FOUNTAIN_BLOCKS = -7 # 28 (606) for 4c, 35 (606) for 8c + + CELL_SPACING_Y = CELL_SPACING_X + INTERLEAVE_BLOCKS = ECC_BLOCK_SIZE + MARKER_SIZE_X = round(54 / CELL_SPACING_X) + MARKER_SIZE_Y = round(54 / CELL_SPACING_Y) # 6 or 9, probably + + +class sq5x5alt: + TOTAL_SIZE = 1024 + BITS_PER_SYMBOL = 2 + BITS_PER_COLOR = 2 + CELL_SIZE = 5 + CELL_SPACING_X = CELL_SIZE + 1 + CELL_DIM_X = 168 + CELLS_OFFSET = 9 + ECC = 30 + ECC_BLOCK_SIZE = 155 + INTERLEAVE_PARTITIONS = 3 + FOUNTAIN_BLOCKS = 9 # dynamic.. could be *2 or *3? + + CELL_DIM_Y = CELL_DIM_X + CELL_SPACING_Y = CELL_SPACING_X + INTERLEAVE_BLOCKS = ECC_BLOCK_SIZE + MARKER_SIZE_X = round(54 / CELL_SPACING_X) + MARKER_SIZE_Y = round(54 / CELL_SPACING_Y) # 6 or 9, probably + + +class sq5x5beeg: + TOTAL_SIZE = 1048 + BITS_PER_SYMBOL = 2 + BITS_PER_COLOR = 2 + CELL_SIZE = 5 + CELL_SPACING_X = CELL_SIZE + 1 + CELL_DIM_X = 172 + CELLS_OFFSET = 9 + ECC = 41 + ECC_BLOCK_SIZE = 209 + INTERLEAVE_PARTITIONS = 2 + FOUNTAIN_BLOCKS = 0 # dynamic.. could be *2 or *3? + + CELL_DIM_Y = CELL_DIM_X + CELL_SPACING_Y = CELL_SPACING_X + INTERLEAVE_BLOCKS = ECC_BLOCK_SIZE + MARKER_SIZE_X = round(54 / CELL_SPACING_X) + MARKER_SIZE_Y = round(54 / CELL_SPACING_Y) # 6 or 9, probably + + +class sq5x6bad: TOTAL_SIZE = 966 BITS_PER_SYMBOL = 2 BITS_PER_COLOR = 2 @@ -83,7 +168,7 @@ class sq5x6: # this one is very flexible, probably good for experimenting with -class sq5x6alt: +class sq5x6: TOTAL_SIZE = 958 BITS_PER_SYMBOL = 2 BITS_PER_COLOR = 2 @@ -96,7 +181,92 @@ class sq5x6alt: ECC = 35 ECC_BLOCK_SIZE = 182 INTERLEAVE_PARTITIONS = 2 - FOUNTAIN_BLOCKS = 0 # dynamic + FOUNTAIN_BLOCKS = 0 # dynamic ... should be *3, not *2...? + + INTERLEAVE_BLOCKS = ECC_BLOCK_SIZE + MARKER_SIZE_X = round(54 / CELL_SPACING_X) + MARKER_SIZE_Y = round(54 / CELL_SPACING_Y) # 6 or 9, probably + + +class sq6x5: + TOTAL_SIZE = 958 + BITS_PER_SYMBOL = 2 + BITS_PER_COLOR = 2 + CELL_SIZE = 5 + CELL_SPACING_X = CELL_SIZE + 1 + CELL_SPACING_Y = CELL_SIZE + CELL_DIM_X = 157 + CELL_DIM_Y = 188 + CELLS_OFFSET = 9 + ECC = 35 + ECC_BLOCK_SIZE = 182 + INTERLEAVE_PARTITIONS = 2 + FOUNTAIN_BLOCKS = 0 # dynamic ... should be *3, not *2...? + + INTERLEAVE_BLOCKS = ECC_BLOCK_SIZE + MARKER_SIZE_X = round(54 / CELL_SPACING_X) + MARKER_SIZE_Y = round(54 / CELL_SPACING_Y) # 6 or 9, probably + + +# possible bad ones that still can work with 4bit... +#... just don't try to make the numbers match for 5bit too... +# 160,192 +# 165,198 (33,163,10) +class sq5x6alt: + TOTAL_SIZE = 1026 + BITS_PER_SYMBOL = 2 + BITS_PER_COLOR = 2 + CELL_SIZE = 5 + CELL_SPACING_X = CELL_SIZE + CELL_SPACING_Y = CELL_SIZE + 1 + CELL_DIM_Y = 168 + CELL_DIM_X = 202 + CELLS_OFFSET = 9 + ECC = 43 + ECC_BLOCK_SIZE = 215 + INTERLEAVE_PARTITIONS = 2 + FOUNTAIN_BLOCKS = 0 # dynamic ... could be *3, not *2...? + + INTERLEAVE_BLOCKS = ECC_BLOCK_SIZE + MARKER_SIZE_X = round(54 / CELL_SPACING_X) + MARKER_SIZE_Y = round(54 / CELL_SPACING_Y) # 6 or 9, probably + + +# experimental 1.3:1 config? +class sq5x6wide: + TOTAL_SIZE = (1306, 988) + BITS_PER_SYMBOL = 2 + BITS_PER_COLOR = 2 + CELL_SIZE = 5 + CELL_SPACING_X = CELL_SIZE + CELL_SPACING_Y = CELL_SIZE + 1 + CELL_DIM_Y = 162 + CELL_DIM_X = 258 + CELLS_OFFSET = 9 + ECC = 43 + ECC_BLOCK_SIZE = 207 + INTERLEAVE_PARTITIONS = 2 + FOUNTAIN_BLOCKS = 20 + + INTERLEAVE_BLOCKS = ECC_BLOCK_SIZE + MARKER_SIZE_X = round(54 / CELL_SPACING_X) + MARKER_SIZE_Y = round(54 / CELL_SPACING_Y) # 6 or 9, probably + + +class sq5x6w2: + TOTAL_SIZE = (1286, 1012) + BITS_PER_SYMBOL = 2 + BITS_PER_COLOR = 2 + CELL_SIZE = 5 + CELL_SPACING_X = CELL_SIZE + CELL_SPACING_Y = CELL_SIZE + 1 + CELL_DIM_Y = 166 + CELL_DIM_X = 254 + CELLS_OFFSET = 9 + ECC = 47 + ECC_BLOCK_SIZE = 227 + INTERLEAVE_PARTITIONS = 2 + FOUNTAIN_BLOCKS = 12 # -3? INTERLEAVE_BLOCKS = ECC_BLOCK_SIZE MARKER_SIZE_X = round(54 / CELL_SPACING_X) @@ -105,19 +275,41 @@ class sq5x6alt: # swing for the fences class sq5x6beeg: - TOTAL_SIZE = 1051 + TOTAL_SIZE = (1326, 1036) BITS_PER_SYMBOL = 2 BITS_PER_COLOR = 2 CELL_SIZE = 5 CELL_SPACING_X = CELL_SIZE CELL_SPACING_Y = CELL_SIZE + 1 - CELL_DIM_Y = 172 - CELL_DIM_X = 207 + CELL_DIM_Y = 170 + CELL_DIM_X = 262 + CELLS_OFFSET = 9 + ECC = 37 + ECC_BLOCK_SIZE = 178 + INTERLEAVE_PARTITIONS = 2 + FOUNTAIN_BLOCKS = -3 # 12 for 4color, 15 for 8color + + INTERLEAVE_BLOCKS = ECC_BLOCK_SIZE + MARKER_SIZE_X = round(54 / CELL_SPACING_X) + MARKER_SIZE_Y = round(54 / CELL_SPACING_Y) # 6 or 9, probably + + +# swing for the fences +# tbd, haven't found good numbers yet... but 250 kb/s is reasonable???? +class sq6x5wide: + TOTAL_SIZE = (1468, 1006) + BITS_PER_SYMBOL = 2 + BITS_PER_COLOR = 2 + CELL_SIZE = 5 + CELL_SPACING_X = CELL_SIZE + 1 + CELL_SPACING_Y = CELL_SIZE + CELL_DIM_X = 242 + CELL_DIM_Y = 198 CELLS_OFFSET = 9 ECC = 33 - ECC_BLOCK_SIZE = 163 - INTERLEAVE_PARTITIONS = 3 - FOUNTAIN_BLOCKS = 0 # dynamic + ECC_BLOCK_SIZE = 165 + INTERLEAVE_PARTITIONS = 2 + FOUNTAIN_BLOCKS = -6 # 24 (792) for 4color, 30??? for 8color INTERLEAVE_BLOCKS = ECC_BLOCK_SIZE MARKER_SIZE_X = round(54 / CELL_SPACING_X) @@ -133,4 +325,4 @@ def init(cls): continue setattr(this, k, v) -init(sq8x8) +init(sq6x5wide)