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

Function IsSpectralEXRFromMemory

Source/ThirdParty/tinyexr.h:11315–11338  ·  view source on GitHub ↗

Check if memory contains spectral EXR data

Source from the content-addressed store, hash-verified

11313
11314// Check if memory contains spectral EXR data
11315int IsSpectralEXRFromMemory(const unsigned char *memory, size_t size) {
11316 if (!memory || size < 8) return TINYEXR_ERROR_INVALID_DATA;
11317
11318 EXRVersion version;
11319 int ret = ParseEXRVersionFromMemory(&version, memory, size);
11320 if (ret != TINYEXR_SUCCESS) return ret;
11321
11322 const char *err = NULL;
11323 EXRHeader header;
11324 InitEXRHeader(&header);
11325
11326 ret = ParseEXRHeaderFromMemory(&header, &version, memory, size, &err);
11327 if (ret != TINYEXR_SUCCESS) {
11328 if (err) FreeEXRErrorMessage(err);
11329 return ret;
11330 }
11331
11332 // Check for spectralLayoutVersion attribute
11333 int is_spectral = (FindCustomAttribute(&header, "spectralLayoutVersion") != NULL);
11334
11335 FreeEXRHeader(&header);
11336
11337 return is_spectral ? TINYEXR_SUCCESS : TINYEXR_ERROR_INVALID_DATA;
11338}
11339
11340#ifdef __clang__
11341// zero-as-null-pointer-constant

Callers

nothing calls this directly

Calls 6

InitEXRHeaderFunction · 0.85
ParseEXRHeaderFromMemoryFunction · 0.85
FreeEXRErrorMessageFunction · 0.85
FindCustomAttributeFunction · 0.85
FreeEXRHeaderFunction · 0.85

Tested by

no test coverage detected