* @brief Validate single channel compression swizzle. * * @param swizzle The swizzle to check. * * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure. */
| 330 | * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure. |
| 331 | */ |
| 332 | static astcenc_error validate_compression_swz( |
| 333 | astcenc_swz swizzle |
| 334 | ) { |
| 335 | // Not all enum values are handled; SWZ_Z is invalid for compression |
| 336 | switch (static_cast<int>(swizzle)) |
| 337 | { |
| 338 | case ASTCENC_SWZ_R: |
| 339 | case ASTCENC_SWZ_G: |
| 340 | case ASTCENC_SWZ_B: |
| 341 | case ASTCENC_SWZ_A: |
| 342 | case ASTCENC_SWZ_0: |
| 343 | case ASTCENC_SWZ_1: |
| 344 | return ASTCENC_SUCCESS; |
| 345 | default: |
| 346 | return ASTCENC_ERR_BAD_SWIZZLE; |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | /** |
| 351 | * @brief Validate overall compression swizzle. |
no outgoing calls
no test coverage detected