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

◆ shift_parser()

std::pair< int, int > MayaFlux::Nodes::Filters::shift_parser ( const std::string &  str)

Parses a string representation of filter order into input/output shift configuration.

Parameters
strString in format "N_M" where N is input order and M is output order
Returns
Pair of integers representing input and output shift values

This utility function converts a simple string representation of filter order into the corresponding shift configuration for the filter's internal buffers.

Definition at line 7 of file Filter.cpp.

8{
9 size_t underscore = str.find('_');
10 if (underscore == std::string::npos) {
11 throw std::invalid_argument("Invalid format. Supply numberical format of nInputs_nOutpits like 25_2");
12 }
13
14 int inputs = std::stoi(str.substr(0, underscore));
15 int outputs = std::stoi(str.substr(underscore + 1));
16 return std::make_pair(inputs, outputs);
17}

Referenced by MayaFlux::Nodes::Filters::Filter::Filter(), MayaFlux::Nodes::Filters::Filter::Filter(), and MayaFlux::Nodes::Filters::Filter::set_shift().

+ Here is the caller graph for this function: