* @brief Validate config profile. * * @param profile The profile to check. * * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure. */
| 234 | * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure. |
| 235 | */ |
| 236 | static astcenc_error validate_profile( |
| 237 | astcenc_profile profile |
| 238 | ) { |
| 239 | // Values in this enum are from an external user, so not guaranteed to be |
| 240 | // bounded to the enum values |
| 241 | switch (static_cast<int>(profile)) |
| 242 | { |
| 243 | case ASTCENC_PRF_LDR_SRGB: |
| 244 | case ASTCENC_PRF_LDR: |
| 245 | case ASTCENC_PRF_HDR_RGB_LDR_A: |
| 246 | case ASTCENC_PRF_HDR: |
| 247 | return ASTCENC_SUCCESS; |
| 248 | default: |
| 249 | return ASTCENC_ERR_BAD_PROFILE; |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | /** |
| 254 | * @brief Validate block size. |