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