MayaFlux 0.1.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 146 of file NodeUtils.cpp.

147{
148 std::vector<uint32_t> channels;
149
150 if (channel_mask == 0) {
151 channels.push_back(fallback_channel);
152 } else {
153 for (uint32_t channel = 0; channel < MayaFlux::Config::get_node_config().max_channels; ++channel) {
154 if (channel_mask & (1ULL << channel)) {
155 channels.push_back(channel);
156 }
157 }
158 }
159
160 return channels;
161}
NodeConfig & get_node_config()
Definition Config.cpp:44
uint32_t max_channels
Maximum number of channels supported (uint32_t bits)
Definition Config.hpp:41

References MayaFlux::Config::get_node_config(), and MayaFlux::Config::NodeConfig::max_channels.

+ Here is the call graph for this function: