MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / test_compress_esw

Method test_compress_esw

Test/astc_test_functional.py:859–883  ·  view source on GitHub ↗

Test compression swizzles.

(self)

Source from the content-addressed store, hash-verified

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 '''

Callers

nothing calls this directly

Calls 5

execMethod · 0.95
get_colorsMethod · 0.95
get_color_refsMethod · 0.95
assertColorSameMethod · 0.95
get_tmp_image_pathMethod · 0.80

Tested by

no test coverage detected