| 246 | } |
| 247 | |
| 248 | int main(int argc, char* argv[]) |
| 249 | { |
| 250 | unsigned char imgBuffer[64] = {0}; // Results buffer for decompressed shape0_RGBA |
| 251 | unsigned short imgBufferF16[48] = {0}; // Results buffer for decompressed shape0_RGBAF16 |
| 252 | unsigned char imgBuffer1[16] = {0}; // Results buffer for decompressed single channel 1 |
| 253 | unsigned char imgBuffer2[16] = {0}; // Results buffer for decompressed single channel 2 |
| 254 | char imgBuffer1s[16] = {0}; // Results buffer for decompressed single signed channel |
| 255 | char imgBuffer2s[16] = {0}; // Results buffer for decompressed single signed channel |
| 256 | |
| 257 | unsigned char cmpBuffer8[8] = {0}; // Compression buffer for BC1 and BC4 Codecs |
| 258 | unsigned char cmpBuffer16[16] = {0}; // Compression buffer for BC5,BC6 and BC7 |
| 259 | char cmpBuffer8s[8] = {0}; // Compression buffer for BC4s Codecs |
| 260 | |
| 261 | //=================================================================== |
| 262 | // Example #1 of how to set compress and decompress for BCn codecs |
| 263 | //=================================================================== |
| 264 | |
| 265 | //================================================================================== |
| 266 | // BC1 Example: using default options settings |
| 267 | // This example show 2 ways to call the compress and decompress API |
| 268 | // one is using C++ convention with n optional parameter, which is null |
| 269 | // for "C" compilers the third parameters must be set to null |
| 270 | // Examples to use the third option parameter is shown in Example #2 and Example #3 |
| 271 | // For the remaining codec examples, "C" parameter examples are shown |
| 272 | // They will work for C++ compilers also |
| 273 | //================================================================================== |
| 274 | |
| 275 | #ifdef __cplusplus |
| 276 | CompressBlockBC1(shape0_RGBA, 16, cmpBuffer8); |
| 277 | DecompressBlockBC1(cmpBuffer8, imgBuffer); |
| 278 | #else |
| 279 | CompressBlockBC1(shape0_RGBA, 16, cmpBuffer8, NULL); |
| 280 | DecompressBC1(cmpBuffer8, imgBuffer, NULL); |
| 281 | #endif |
| 282 | ShowResults("BC1", shape0_RGBA, imgBuffer); |
| 283 | |
| 284 | //============ |
| 285 | // BC2 Example |
| 286 | //============= |
| 287 | CompressBlockBC2(shape0_RGBA, 16, cmpBuffer16, NULL); |
| 288 | DecompressBlockBC2(cmpBuffer16, imgBuffer, NULL); |
| 289 | ShowResults("BC2", shape0_RGBA, imgBuffer); |
| 290 | |
| 291 | //============= |
| 292 | // BC3 Example |
| 293 | //============= |
| 294 | CompressBlockBC3(shape0_RGBA, 16, cmpBuffer16, NULL); |
| 295 | DecompressBlockBC3(cmpBuffer16, imgBuffer, NULL); |
| 296 | ShowResults("BC3", shape0_RGBA, imgBuffer); |
| 297 | |
| 298 | //============== |
| 299 | // BC4 Example |
| 300 | //============== |
| 301 | CompressBlockBC4(shape_1, 4, cmpBuffer8, NULL); |
| 302 | DecompressBlockBC4(cmpBuffer8, imgBuffer, NULL); |
| 303 | ShowResults1("BC4", shape_1, imgBuffer); |
| 304 | |
| 305 | //============================== |
nothing calls this directly
no test coverage detected