MayaFlux 0.4.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 110 of file NodeUtils.cpp.

111{
112 std::vector<uint32_t> channels;
113
114 if (channel_mask == 0) {
115 channels.push_back(fallback_channel);
116 } else {
117 for (uint32_t channel = 0; channel < MAX_CHANNEL_COUNT; ++channel) {
118 if (channel_mask & (1ULL << channel)) {
119 channels.push_back(channel);
120 }
121 }
122 }
123
124 return channels;
125}
uint32_t channel

References channel, and MAX_CHANNEL_COUNT.