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

Function EXRIsSpectralChannel

Source/ThirdParty/tinyexr.h:11048–11064  ·  view source on GitHub ↗

Check if channel name is a spectral channel

Source from the content-addressed store, hash-verified

11046
11047// Check if channel name is a spectral channel
11048int EXRIsSpectralChannel(const char *channel_name) {
11049 if (!channel_name) return 0;
11050
11051 // Check for "S{n}.{wavelength}nm" pattern
11052 if (channel_name[0] == 'S' &&
11053 channel_name[1] >= '0' && channel_name[1] <= '3' &&
11054 channel_name[2] == '.') {
11055 return EXRParseSpectralChannelWavelength(channel_name) > 0.0f ? 1 : 0;
11056 }
11057
11058 // Check for "T.{wavelength}nm" pattern
11059 if (channel_name[0] == 'T' && channel_name[1] == '.') {
11060 return EXRParseSpectralChannelWavelength(channel_name) > 0.0f ? 1 : 0;
11061 }
11062
11063 return 0;
11064}
11065
11066// Helper to find custom attribute by name
11067static const EXRAttribute* FindCustomAttribute(const EXRHeader *exr_header,

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected