Get spectral units from EXR header
| 11148 | |
| 11149 | // Get spectral units from EXR header |
| 11150 | const 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 |
| 11169 | static int AddStringAttribute(EXRHeader *exr_header, const char *name, const char *value) { |
nothing calls this directly
no test coverage detected