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

Function IsSpectralEXR

Source/ThirdParty/tinyexr.h:11291–11312  ·  view source on GitHub ↗

Check if file contains spectral data

Source from the content-addressed store, hash-verified

11289
11290// Check if file contains spectral data
11291int IsSpectralEXR(const char *filename) {
11292 EXRVersion version;
11293 int ret = ParseEXRVersionFromFile(&version, filename);
11294 if (ret != TINYEXR_SUCCESS) return ret;
11295
11296 const char *err = NULL;
11297 EXRHeader header;
11298 InitEXRHeader(&header);
11299
11300 ret = ParseEXRHeaderFromFile(&header, &version, filename, &err);
11301 if (ret != TINYEXR_SUCCESS) {
11302 if (err) FreeEXRErrorMessage(err);
11303 return ret;
11304 }
11305
11306 // Check for spectralLayoutVersion attribute
11307 int is_spectral = (FindCustomAttribute(&header, "spectralLayoutVersion") != NULL);
11308
11309 FreeEXRHeader(&header);
11310
11311 return is_spectral ? TINYEXR_SUCCESS : TINYEXR_ERROR_INVALID_DATA;
11312}
11313
11314// Check if memory contains spectral EXR data
11315int IsSpectralEXRFromMemory(const unsigned char *memory, size_t size) {

Callers

nothing calls this directly

Calls 6

ParseEXRVersionFromFileFunction · 0.85
InitEXRHeaderFunction · 0.85
ParseEXRHeaderFromFileFunction · 0.85
FreeEXRErrorMessageFunction · 0.85
FindCustomAttributeFunction · 0.85
FreeEXRHeaderFunction · 0.85

Tested by

no test coverage detected