mirror of
https://github.com/KrisKennaway/ii-vision.git
synced 2025-07-17 19:24:15 +00:00
Separate the details of the bitmap packing from operations on the
packed representation (diff, apply etc). This allows the (D)HGRBitmap classes to focus on the bitmap packing and share common logic. Numpy has unfortunate long-standing bugs to do with type coercion of np.uint64, which leads to spurious "incompatible type" warnings when e.g. operating on a np.uint64 and some other integer type. To work around this we cast explicitly to np.uint64 everywhere. Get tests working again - for now HGR tests in screen_test.py are disabled until I finish implementing new packing. HGRBitmap is still incomplete although closer.
This commit is contained in:
@@ -7,7 +7,7 @@ HGRColours = colours.HGRColours
|
||||
|
||||
class TestColours(unittest.TestCase):
|
||||
|
||||
def test_int28_to_pixels(self):
|
||||
def test_int34_to_pixels(self):
|
||||
self.assertEqual(
|
||||
(
|
||||
HGRColours.BLACK,
|
||||
@@ -38,9 +38,12 @@ class TestColours(unittest.TestCase):
|
||||
HGRColours.BLACK,
|
||||
HGRColours.BLACK,
|
||||
HGRColours.BLACK,
|
||||
HGRColours.BLACK,
|
||||
HGRColours.BLACK,
|
||||
HGRColours.BLACK
|
||||
),
|
||||
colours.int34_to_nominal_colour_pixels(
|
||||
0b00000000000000000000111000000000, HGRColours
|
||||
0b00000000000000000000111000000000, HGRColours, init_phase=0
|
||||
)
|
||||
)
|
||||
|
||||
@@ -73,10 +76,13 @@ class TestColours(unittest.TestCase):
|
||||
HGRColours.BLACK,
|
||||
HGRColours.BLACK,
|
||||
HGRColours.BLACK,
|
||||
HGRColours.BLACK,
|
||||
HGRColours.BLACK,
|
||||
HGRColours.BLACK,
|
||||
HGRColours.BLACK
|
||||
),
|
||||
colours.int34_to_nominal_colour_pixels(
|
||||
0b0000111100001111000011110000, HGRColours
|
||||
0b0000111100001111000011110000, HGRColours, init_phase=0
|
||||
)
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user