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

Function validate_decompression_swz

Source/astcenc_entry.cpp:379–397  ·  view source on GitHub ↗

* @brief Validate single channel decompression swizzle. * * @param swizzle The swizzle to check. * * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure. */

Source from the content-addressed store, hash-verified

377 * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure.
378 */
379static 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.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected