MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ get_active_channels() [2/2]

std::vector< uint32_t > MayaFlux::Nodes::get_active_channels ( uint32_t  channel_mask,
uint32_t  fallback_channel = 0 
)

Extracts active channel list from a channel mask.

Parameters
channel_maskBitmask of active channels
fallback_channelChannel to use if mask is 0 (default: 0)
Returns
Vector of active channel indices

Definition at line 144 of file NodeUtils.cpp.

145{
146 std::vector<uint32_t> channels;
147
148 if (channel_mask == 0) {
149 channels.push_back(fallback_channel);
150 } else {
151 for (uint32_t channel = 0; channel < MAX_CHANNEL_COUNT; ++channel) {
152 if (channel_mask & (1ULL << channel)) {
153 channels.push_back(channel);
154 }
155 }
156 }
157
158 return channels;
159}

References MAX_CHANNEL_COUNT.