comparison base/RangeMapper.h @ 879:eb6b6a88faed

Unit-test RangeMapper, fix a couple of bugs
author Chris Cannam
date Fri, 31 Jan 2014 13:39:37 +0000
parents b4a8d8221eaf
children b4787b595db3
comparison
equal deleted inserted replaced
862:786ee8d1f30e 879:eb6b6a88faed
32 32
33 33
34 class LinearRangeMapper : public RangeMapper 34 class LinearRangeMapper : public RangeMapper
35 { 35 {
36 public: 36 public:
37 /**
38 * Map values in range minval->maxval linearly into integer range
39 * minpos->maxpos. minval and minpos must be less than maxval and
40 * maxpos respectively. If inverted is true, the range will be
41 * mapped "backwards" (minval to maxpos and maxval to minpos).
42 */
37 LinearRangeMapper(int minpos, int maxpos, 43 LinearRangeMapper(int minpos, int maxpos,
38 float minval, float maxval, 44 float minval, float maxval,
39 QString unit = "", bool inverted = false); 45 QString unit = "", bool inverted = false);
40 46
41 virtual int getPositionForValue(float value) const; 47 virtual int getPositionForValue(float value) const;