Line data Source code
1 : /** 2 : * \file SumFilter.h 3 : */ 4 : 5 : #ifndef ATK_TOOLS_SUMFILTER_H 6 : #define ATK_TOOLS_SUMFILTER_H 7 : 8 : #include <ATK/Core/TypedBaseFilter.h> 9 : #include <ATK/Tools/config.h> 10 : 11 : namespace ATK 12 : { 13 : /// Sums two signals together 14 : template<typename DataType_> 15 : class ATK_TOOLS_EXPORT SumFilter final : public TypedBaseFilter<DataType_> 16 : { 17 : protected: 18 : /// Simplify parent calls 19 : using Parent = TypedBaseFilter<DataType_>; 20 : using typename Parent::DataType; 21 : using Parent::converted_inputs; 22 : using Parent::outputs; 23 : using Parent::nb_input_ports; 24 : using Parent::nb_output_ports; 25 : 26 : public: 27 : /// Constructor 28 : /** 29 : * @param nb_output_channels is the number of output channels 30 : * @param summed_channels is the number of input channels summed in one output channel 31 : */ 32 : SumFilter(gsl::index nb_output_channels = 1, gsl::index summed_channels = 2); 33 : /// Destructor 34 79 : ~SumFilter() override = default; 35 : 36 : protected: 37 : void process_impl(gsl::index size) const final; 38 : private: 39 : gsl::index summed_channels; 40 : }; 41 : } 42 : 43 : #endif