@@ -27,7 +27,7 @@ public void Decompress_BC1()
2727 int totalBytesRead = 0 ;
2828 foreach ( int size in new int [ ] { 256 , 128 , 64 , 32 , 16 , 8 , 4 } ) //mipmaps 2 and 1 cause a buffer overrun for the output
2929 {
30- int bytesRead = Bc1 . Decompress ( data . Slice ( totalBytesRead ) , size , size , out byte [ ] bcDecodedData ) ;
30+ int bytesRead = Bc1 . Decompress < ColorBGRA32 , byte > ( data . Slice ( totalBytesRead ) , size , size , out byte [ ] bcDecodedData ) ;
3131 DxtDecoder . DecompressDXT1 < ColorBGRA32 , byte > ( data . Slice ( totalBytesRead ) , size , size , out byte [ ] dxtDecodedData ) ;
3232 totalBytesRead += bytesRead ;
3333 AssertAlmostEqual ( dxtDecodedData , bcDecodedData ) ;
@@ -42,7 +42,7 @@ public void Decompress_BC2()
4242 int totalBytesRead = 0 ;
4343 foreach ( int size in new int [ ] { 256 , 128 , 64 , 32 , 16 , 8 , 4 } ) //mipmaps 2 and 1 cause a buffer overrun for the output
4444 {
45- int bytesRead = Bc2 . Decompress ( data . Slice ( totalBytesRead ) , size , size , out byte [ ] bcDecodedData ) ;
45+ int bytesRead = Bc2 . Decompress < ColorBGRA32 , byte > ( data . Slice ( totalBytesRead ) , size , size , out byte [ ] bcDecodedData ) ;
4646 DxtDecoder . DecompressDXT3 < ColorBGRA32 , byte > ( data . Slice ( totalBytesRead ) , size , size , out byte [ ] dxtDecodedData ) ;
4747 totalBytesRead += bytesRead ;
4848 AssertAlmostEqual ( dxtDecodedData , bcDecodedData ) ;
@@ -57,7 +57,7 @@ public void Decompress_BC3()
5757 int totalBytesRead = 0 ;
5858 foreach ( int size in new int [ ] { 256 , 128 , 64 , 32 , 16 , 8 , 4 } ) //mipmaps 2 and 1 cause a buffer overrun for the output
5959 {
60- int bytesRead = Bc3 . Decompress ( data . Slice ( totalBytesRead ) , size , size , out byte [ ] bcDecodedData ) ;
60+ int bytesRead = Bc3 . Decompress < ColorBGRA32 , byte > ( data . Slice ( totalBytesRead ) , size , size , out byte [ ] bcDecodedData ) ;
6161 DxtDecoder . DecompressDXT5 < ColorBGRA32 , byte > ( data . Slice ( totalBytesRead ) , size , size , out byte [ ] dxtDecodedData ) ;
6262 totalBytesRead += bytesRead ;
6363 AssertAlmostEqual ( dxtDecodedData , bcDecodedData ) ;
@@ -69,15 +69,15 @@ public void Decompress_BC3()
6969 public void Decompress_BC4 ( )
7070 {
7171 ReadOnlySpan < byte > data = File . ReadAllBytes ( TestFileFolders . BcTestFiles + "test.bc4" ) ;
72- int bytesRead = Bc4 . Decompress ( data , 512 , 512 , out _ ) ;
72+ int bytesRead = Bc4 . Decompress < ColorBGRA32 , byte > ( data , 512 , 512 , out _ ) ;
7373 Assert . That ( bytesRead , Is . EqualTo ( data . Length ) ) ;
7474 }
7575
7676 [ Test ]
7777 public void Decompress_BC5 ( )
7878 {
7979 ReadOnlySpan < byte > data = File . ReadAllBytes ( TestFileFolders . BcTestFiles + "test.bc5" ) ;
80- int bytesRead = Bc5 . Decompress ( data , 512 , 512 , out _ ) ;
80+ int bytesRead = Bc5 . Decompress < ColorBGRA32 , byte > ( data , 512 , 512 , out _ ) ;
8181 Assert . That ( bytesRead , Is . EqualTo ( data . Length ) ) ;
8282 }
8383
@@ -103,7 +103,7 @@ public void PartialBlock_BC1([Range(1, 4)] int width, [Range(1, 4)] int height)
103103 Assert . Multiple ( ( ) =>
104104 {
105105 ReadOnlySpan < byte > data = File . ReadAllBytes ( TestFileFolders . DxtTestFiles + "test.dxt1" ) . AsSpan ( ) [ ..Bc1 . BlockSize ] ;
106- int bytesRead = Bc1 . Decompress ( data , width , height , out byte [ ] decodedData ) ;
106+ int bytesRead = Bc1 . Decompress < ColorBGRA32 , byte > ( data , width , height , out byte [ ] decodedData ) ;
107107 Assert . That ( bytesRead , Is . EqualTo ( data . Length ) ) ;
108108 Assert . That ( decodedData , Has . Length . EqualTo ( width * height * Unsafe . SizeOf < ColorBGRA32 > ( ) ) ) ;
109109 } ) ;
@@ -115,7 +115,7 @@ public void PartialBlock_BC2([Range(1, 4)] int width, [Range(1, 4)] int height)
115115 Assert . Multiple ( ( ) =>
116116 {
117117 ReadOnlySpan < byte > data = File . ReadAllBytes ( TestFileFolders . DxtTestFiles + "test.dxt3" ) . AsSpan ( ) [ ..Bc2 . BlockSize ] ;
118- int bytesRead = Bc2 . Decompress ( data , width , height , out byte [ ] decodedData ) ;
118+ int bytesRead = Bc2 . Decompress < ColorBGRA32 , byte > ( data , width , height , out byte [ ] decodedData ) ;
119119 Assert . That ( bytesRead , Is . EqualTo ( data . Length ) ) ;
120120 Assert . That ( decodedData , Has . Length . EqualTo ( width * height * Unsafe . SizeOf < ColorBGRA32 > ( ) ) ) ;
121121 } ) ;
@@ -127,7 +127,7 @@ public void PartialBlock_BC3([Range(1, 4)] int width, [Range(1, 4)] int height)
127127 Assert . Multiple ( ( ) =>
128128 {
129129 ReadOnlySpan < byte > data = File . ReadAllBytes ( TestFileFolders . DxtTestFiles + "test.dxt5" ) . AsSpan ( ) [ ..Bc3 . BlockSize ] ;
130- int bytesRead = Bc3 . Decompress ( data , width , height , out byte [ ] decodedData ) ;
130+ int bytesRead = Bc3 . Decompress < ColorBGRA32 , byte > ( data , width , height , out byte [ ] decodedData ) ;
131131 Assert . That ( bytesRead , Is . EqualTo ( data . Length ) ) ;
132132 Assert . That ( decodedData , Has . Length . EqualTo ( width * height * Unsafe . SizeOf < ColorBGRA32 > ( ) ) ) ;
133133 } ) ;
@@ -139,7 +139,7 @@ public void PartialBlock_BC4([Range(1, 4)] int width, [Range(1, 4)] int height)
139139 Assert . Multiple ( ( ) =>
140140 {
141141 ReadOnlySpan < byte > data = File . ReadAllBytes ( TestFileFolders . BcTestFiles + "test.bc4" ) . AsSpan ( ) [ ..Bc4 . BlockSize ] ;
142- int bytesRead = Bc4 . Decompress ( data , width , height , out byte [ ] decodedData ) ;
142+ int bytesRead = Bc4 . Decompress < ColorBGRA32 , byte > ( data , width , height , out byte [ ] decodedData ) ;
143143 Assert . That ( bytesRead , Is . EqualTo ( data . Length ) ) ;
144144 Assert . That ( decodedData , Has . Length . EqualTo ( width * height * Unsafe . SizeOf < ColorBGRA32 > ( ) ) ) ;
145145 } ) ;
@@ -151,7 +151,7 @@ public void PartialBlock_BC5([Range(1, 4)] int width, [Range(1, 4)] int height)
151151 Assert . Multiple ( ( ) =>
152152 {
153153 ReadOnlySpan < byte > data = File . ReadAllBytes ( TestFileFolders . BcTestFiles + "test.bc5" ) . AsSpan ( ) [ ..Bc5 . BlockSize ] ;
154- int bytesRead = Bc5 . Decompress ( data , width , height , out byte [ ] decodedData ) ;
154+ int bytesRead = Bc5 . Decompress < ColorBGRA32 , byte > ( data , width , height , out byte [ ] decodedData ) ;
155155 Assert . That ( bytesRead , Is . EqualTo ( data . Length ) ) ;
156156 Assert . That ( decodedData , Has . Length . EqualTo ( width * height * Unsafe . SizeOf < ColorBGRA32 > ( ) ) ) ;
157157 } ) ;
@@ -163,7 +163,7 @@ public void PartialBlock_BC6H([Range(1, 4)] int width, [Range(1, 4)] int height)
163163 Assert . Multiple ( ( ) =>
164164 {
165165 ReadOnlySpan < byte > data = File . ReadAllBytes ( TestFileFolders . BcTestFiles + "test.bc6h_best" ) . AsSpan ( ) [ ..Bc6h . BlockSize ] ;
166- int bytesRead = Bc6h . Decompress ( data , width , height , false , out byte [ ] decodedData ) ;
166+ int bytesRead = Bc6h . Decompress < ColorBGRA32 , byte > ( data , width , height , false , out byte [ ] decodedData ) ;
167167 Assert . That ( bytesRead , Is . EqualTo ( data . Length ) ) ;
168168 Assert . That ( decodedData , Has . Length . EqualTo ( width * height * Unsafe . SizeOf < ColorBGRA32 > ( ) ) ) ;
169169 } ) ;
@@ -175,7 +175,7 @@ public void PartialBlock_BC7([Range(1, 4)] int width, [Range(1, 4)] int height)
175175 Assert . Multiple ( ( ) =>
176176 {
177177 ReadOnlySpan < byte > data = File . ReadAllBytes ( TestFileFolders . BcTestFiles + "test.bc7_best" ) . AsSpan ( ) [ ..Bc7 . BlockSize ] ;
178- int bytesRead = Bc7 . Decompress ( data , width , height , out byte [ ] decodedData ) ;
178+ int bytesRead = Bc7 . Decompress < ColorBGRA32 , byte > ( data , width , height , out byte [ ] decodedData ) ;
179179 Assert . That ( bytesRead , Is . EqualTo ( data . Length ) ) ;
180180 Assert . That ( decodedData , Has . Length . EqualTo ( width * height * Unsafe . SizeOf < ColorBGRA32 > ( ) ) ) ;
181181 } ) ;
@@ -184,15 +184,15 @@ public void PartialBlock_BC7([Range(1, 4)] int width, [Range(1, 4)] int height)
184184 private static void AssertCorrectBC6HDecompression ( string path , int width , int height , bool isSigned )
185185 {
186186 ReadOnlySpan < byte > data = File . ReadAllBytes ( path ) ;
187- int bytesRead = Bc6h . Decompress ( data , width , height , isSigned , out byte [ ] decodedData ) ;
187+ int bytesRead = Bc6h . Decompress < ColorBGRA32 , byte > ( data , width , height , isSigned , out byte [ ] decodedData ) ;
188188 Assert . That ( bytesRead , Is . EqualTo ( data . Length ) ) ;
189189 ByteArrayDeviation . AssertMinimalDeviation ( decodedData , originalBgra32LogoData , MaxMeanDeviationBc6h , MaxStandardDeviationBc6h ) ;
190190 }
191191
192192 private static void AssertCorrectBC7Decompression ( string path , int width , int height )
193193 {
194194 ReadOnlySpan < byte > data = File . ReadAllBytes ( path ) ;
195- int bytesRead = Bc7 . Decompress ( data , width , height , out byte [ ] decodedData ) ;
195+ int bytesRead = Bc7 . Decompress < ColorBGRA32 , byte > ( data , width , height , out byte [ ] decodedData ) ;
196196 Assert . That ( bytesRead , Is . EqualTo ( data . Length ) ) ;
197197 ByteArrayDeviation . AssertMinimalDeviation ( decodedData , originalBgra32LogoData , MaxMeanDeviationBc7 , MaxStandardDeviationBc7 ) ;
198198 }
0 commit comments