Parametrize the RGB palette to encode with, and support both NTSC and

IIGS palettes.

Move the palette diff_matrix generation into make_data_tables.py since
that is the only place it is used.

Demand-load the edit distance matrices when transcoding.
This commit is contained in:
kris
2019-06-15 21:02:00 +01:00
parent 824154fd39
commit ca817999f6
11 changed files with 237 additions and 157 deletions

View File

@@ -10,31 +10,15 @@ class TestMakeDataTables(unittest.TestCase):
self.assertEqual("0FC", make_data_tables.pixel_string(pixels))
def test_pixels_influenced_by_byte_index(self):
pixels = (
DHGRColours.ORANGE,
DHGRColours.GREEN,
DHGRColours.BLACK,
DHGRColours.BLACK,
DHGRColours.BLACK,
DHGRColours.BLACK,
DHGRColours.BLACK,
)
pixels = "CB00000"
self.assertEqual(
(DHGRColours.ORANGE, DHGRColours.GREEN),
"CB",
make_data_tables.pixels_influenced_by_byte_index(pixels, 0)
)
pixels = (
DHGRColours.BLACK,
DHGRColours.BROWN,
DHGRColours.YELLOW,
DHGRColours.GREY1,
DHGRColours.BLACK,
DHGRColours.BLACK,
DHGRColours.BLACK,
)
pixels = "CBA9000"
self.assertEqual(
(DHGRColours.BROWN, DHGRColours.YELLOW, DHGRColours.GREY1),
"BA9",
make_data_tables.pixels_influenced_by_byte_index(pixels, 1)
)