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

Function EXRGetSpectralUnits

Source/ThirdParty/tinyexr.h:11150–11166  ·  view source on GitHub ↗

Get spectral units from EXR header

Source from the content-addressed store, hash-verified

11148
11149// Get spectral units from EXR header
11150const char* EXRGetSpectralUnits(const EXRHeader *exr_header) {
11151 if (!exr_header) return NULL;
11152
11153 // Try ROOT/units first (spectral-exr format)
11154 const EXRAttribute *attr = FindCustomAttribute(exr_header, "ROOT/units");
11155 if (attr && attr->value && attr->size > 0) {
11156 return reinterpret_cast<const char*>(attr->value);
11157 }
11158
11159 // Try emissiveUnits
11160 attr = FindCustomAttribute(exr_header, "emissiveUnits");
11161 if (attr && attr->value && attr->size > 0) {
11162 return reinterpret_cast<const char*>(attr->value);
11163 }
11164
11165 return NULL;
11166}
11167
11168// Helper to add a string attribute
11169static int AddStringAttribute(EXRHeader *exr_header, const char *name, const char *value) {

Callers

nothing calls this directly

Calls 1

FindCustomAttributeFunction · 0.85

Tested by

no test coverage detected