17 : m_values(windowSize),
19 m_effectivePortion(effectivePortion),
20 m_cutOffBuffer(qCeil(0.5 * (qCeil(windowSize * (1.0 - effectivePortion)))))
43 const int cutOffTotal =
m_values.size() - usefulElements;
45 if (cutOffTotal > 0) {
46 const std::vector<double>::size_type cutMin = qRound(0.5 * cutOffTotal);
47 const std::vector<double>::size_type cutMax = cutOffTotal - cutMin;
59 std::partial_sort_copy(
m_values.begin(),
68 std::partial_sort_copy(
m_values.begin(),
72 std::greater<qreal>());
float value(const T *src, size_t ch)
void addValue(qreal value)
qreal filteredMean() const
KisFilteredRollingMean(int windowSize, qreal effectivePortion)
boost::circular_buffer< qreal > m_values
std::vector< qreal > m_cutOffBuffer
#define KIS_SAFE_ASSERT_RECOVER(cond)
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)