Line data Source code
1 : /** 2 : * \file MaxFilter.hxx 3 : */ 4 : 5 : #include "MaxFilter.h" 6 : 7 : namespace ATK 8 : { 9 : template<typename DataType_> 10 1 : MaxFilter<DataType_>::MaxFilter(gsl::index nb_channels) 11 1 : :Parent(2 * nb_channels, nb_channels) 12 : { 13 1 : } 14 : 15 : template<typename DataType_> 16 2 : void MaxFilter<DataType_>::process_impl(gsl::index size) const 17 : { 18 2 : assert(nb_input_ports == 2 * nb_output_ports); 19 : 20 4 : for (gsl::index channel = 0; channel < nb_output_ports; ++channel) 21 : { 22 2 : const DataType* ATK_RESTRICT input0 = converted_inputs[2 * channel]; 23 2 : const DataType* ATK_RESTRICT input1 = converted_inputs[2 * channel + 1]; 24 2 : DataType* ATK_RESTRICT output = outputs[channel]; 25 25 : for (gsl::index i = 0; i < size; ++i) 26 : { 27 23 : output[i] = TypeTraits<DataType>::max(input0[i], input1[i]); 28 : } 29 : } 30 2 : } 31 : }