Support decoding arbitrary number of dots as nominal colour sequence.

This is needed for HGR support.
This commit is contained in:
kris
2019-07-07 21:13:28 +01:00
parent fc4a63fffe
commit 16c4faa66d
2 changed files with 21 additions and 29 deletions

View File

@@ -7,7 +7,7 @@ HGRColours = colours.HGRColours
class TestColours(unittest.TestCase):
def test_int34_to_pixels(self):
def test_dots_to_pixels(self):
self.assertEqual(
(
HGRColours.BLACK,
@@ -42,8 +42,8 @@ class TestColours(unittest.TestCase):
HGRColours.BLACK,
HGRColours.BLACK
),
colours.int34_to_nominal_colour_pixels(
0b00000000000000000000111000000000, HGRColours, init_phase=0
colours.dots_to_nominal_colour_pixels(
31, 0b00000000000000000000111000000000, HGRColours, init_phase=0
)
)
@@ -81,8 +81,8 @@ class TestColours(unittest.TestCase):
HGRColours.BLACK,
HGRColours.BLACK
),
colours.int34_to_nominal_colour_pixels(
0b0000111100001111000011110000, HGRColours, init_phase=0
colours.dots_to_nominal_colour_pixels(
31, 0b0000111100001111000011110000, HGRColours, init_phase=0
)
)