LCOV - code coverage report
Current view: top level - Dynamic - GainColoredExpanderFilter.h (source / functions) Hit Total Coverage
Test: coverage.info.cleaned Lines: 1 1 100.0 %
Date: 2021-02-18 20:07:22 Functions: 1 2 50.0 %

          Line data    Source code
       1             : /**
       2             :  * \file GainColoredExpanderFilter.h
       3             :  */
       4             : 
       5             : #ifndef ATK_DYNAMIC_GAINCOLOREDEXPANDERFILTER_H
       6             : #define ATK_DYNAMIC_GAINCOLOREDEXPANDERFILTER_H
       7             : 
       8             : #include <ATK/Dynamic/GainFilter.h>
       9             : #include <ATK/Dynamic/config.h>
      10             : 
      11             : namespace ATK
      12             : {
      13             :   /// Colored gain "expander". Computes a new amplitude/volume gain based on threshold, slope and the power of the input signal
      14             :   template<typename DataType_>
      15             :   class ATK_DYNAMIC_EXPORT GainColoredExpanderFilter : public ParentGainFilter<DataType_>
      16             :   {
      17             :   public:
      18             :     /// Simplify parent calls
      19             :     using Parent = ParentGainFilter<DataType_>;
      20             :     using Parent::ratio;
      21             :     using Parent::start_recomputeLUT;
      22             :     using typename Parent::DataType;
      23             :     /*!
      24             :     * @brief Constructor
      25             :     * @param nb_channels is the number of input and output channels
      26             :     * @param LUTsize is the total LUT size used by the filter
      27             :     * @param LUTprecision is the number of elements used to compute values < 1
      28             :     */
      29             :     GainColoredExpanderFilter(gsl::index nb_channels = 1, size_t LUTsize = 128*1024, size_t LUTprecision = 1024);
      30             :     /// Destructor
      31          11 :     ~GainColoredExpanderFilter() override = default;
      32             : 
      33             :     /// Sets the softness of the knee of the filter (positive value)
      34             :     void set_softness(DataType_ softness);
      35             :     /// Retrieves the softness afctor
      36             :     DataType_ get_softness() const;
      37             : 
      38             :     /// Sets the color of the filter, the behavior around the threshold
      39             :     /*!
      40             :      * A positive value increases the gain, a negative value lowers it
      41             :      */
      42             :     void set_color(DataType_ color);
      43             :     /// Returns the color factor
      44             :     DataType_ get_color() const;
      45             :     /// Sets the quality, the extent around the threshold where the color factor has an effect
      46             :     void set_quality(DataType_ quality);
      47             :     /// Returns the quality factor
      48             :     DataType_ get_quality() const;
      49             : 
      50             :   protected:
      51             :     DataType_ computeGain(DataType_ value) const;
      52             :   private:
      53             :     DataType_ softness{0.0001};
      54             :     DataType_ color{0};
      55             :     DataType_ quality{0};
      56             :   };
      57             : }
      58             : 
      59             : #endif

Generated by: LCOV version TK-3.3.0-4-gdba42eea