QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_curve_smoothing.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10#ifndef QWT_CURVE_SMOOTHING_H
11#define QWT_CURVE_SMOOTHING_H
12
13#include <qpolygon.h>
14
15/*
16 Internal helpers implementing the render smoothing algorithms
17 of QwtPlotCurve.
18
19 They operate on the polyline that has already been translated to paint
20 coordinates and has been downscaled ( f.e. by the FilterPointsLTTB mode ).
21 Only the y coordinates are modified, the x coordinates are copied, so that
22 the horizontal position of the curve stays untouched.
23
24 Both algorithms combine a linear low pass filter with a feature
25 preservation step: points that deviate from a wide baseline by more
26 than preserveThreshold times the estimated noise level ( peaks, dips )
27 keep their original position and height, so that the smoothing removes
28 the pixel noise without distorting the significant features.
29 A preserveThreshold <= 0 disables the feature preservation.
30
31 The functions are stateless and reentrant. They are not part of the
32 public API - the public interface is QwtPlotCurve::setSmoothAlgorithm().
33 */
34
35// Smooth the y coordinates with a Gaussian weighted moving window
36QPolygonF qwtSmoothPolylineGaussian(const QPolygonF& polyline, int window, double preserveThreshold);
37
38// Smooth the y coordinates with a Savitzky-Golay local polynomial regression
39QPolygonF qwtSmoothPolylineSavitzkyGolay(const QPolygonF& polyline, int window, int order, double preserveThreshold);
40
41#endif