* @brief Validate single channel decompression swizzle. * * @param swizzle The swizzle to check. * * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure. */
| 377 | * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure. |
| 378 | */ |
| 379 | static astcenc_error validate_decompression_swz( |
| 380 | astcenc_swz swizzle |
| 381 | ) { |
| 382 | // Values in this enum are from an external user, so not guaranteed to be |
| 383 | // bounded to the enum values |
| 384 | switch (static_cast<int>(swizzle)) |
| 385 | { |
| 386 | case ASTCENC_SWZ_R: |
| 387 | case ASTCENC_SWZ_G: |
| 388 | case ASTCENC_SWZ_B: |
| 389 | case ASTCENC_SWZ_A: |
| 390 | case ASTCENC_SWZ_0: |
| 391 | case ASTCENC_SWZ_1: |
| 392 | case ASTCENC_SWZ_Z: |
| 393 | return ASTCENC_SUCCESS; |
| 394 | default: |
| 395 | return ASTCENC_ERR_BAD_SWIZZLE; |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | /** |
| 400 | * @brief Validate overall decompression swizzle. |
no outgoing calls
no test coverage detected