Test compression swizzles.
(self)
| 857 | self.assertNotEqual(ref_db, test_db) |
| 858 | |
| 859 | def test_compress_esw(self) -> None: |
| 860 | ''' |
| 861 | Test compression swizzles. |
| 862 | ''' |
| 863 | # The swizzles to test |
| 864 | swizzles = ['rgba', 'g0r1', 'rrrg'] |
| 865 | |
| 866 | # Compress a swizzled image |
| 867 | for swizzle in swizzles: |
| 868 | with self.subTest(swizzle=swizzle): |
| 869 | image_dec = self.get_tmp_image_path('LDR', 'decomp') |
| 870 | |
| 871 | cmd = [ |
| 872 | self.binary, '-tl', |
| 873 | './Test/Data/Tiles/ldr.png', |
| 874 | image_dec, '4x4', '-exhaustive', |
| 875 | '-esw', swizzle] |
| 876 | |
| 877 | self.exec(cmd) |
| 878 | |
| 879 | # Fetch the three color |
| 880 | img = tli.Image(image_dec) |
| 881 | color_test = img.get_colors((7, 7)) |
| 882 | color_ref = self.get_color_refs('LDR', 'BR') |
| 883 | self.assertColorSame(color_ref, color_test, swizzle=swizzle) |
| 884 | |
| 885 | def test_compress_dsw(self) -> None: |
| 886 | ''' |
nothing calls this directly
no test coverage detected