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

◆ get_active_channels() [2/2]

MAYAFLUX_API 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 321 of file NodeUtils.cpp.

322{
323 std::vector<uint32_t> channels;
324
325 if (channel_mask == 0) {
326 channels.push_back(fallback_channel);
327 } else {
328 for (uint32_t channel = 0; channel < MAX_CHANNEL_COUNT; ++channel) {
329 if (channel_mask & (1ULL << channel)) {
330 channels.push_back(channel);
331 }
332 }
333 }
334
335 return channels;
336}
uint32_t channels

References channels, and MAX_CHANNEL_COUNT.