Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
LinearCharacteristics.h
- Committer:
- pmic
- Date:
- 2022-05-31
- Revision:
- 43:f459f6efaf5c
File content as of revision 43:f459f6efaf5c:
#ifndef LINEAR_CHARACTERISTICS_H_
#define LINEAR_CHARACTERISTICS_H_
class LinearCharacteristics
{
public:
    LinearCharacteristics(float gain, float offset);
    LinearCharacteristics(float x0, float x1, float y0, float y1);
    LinearCharacteristics(float x0, float x1, float y0, float y1, float yMin, float yMax);
    LinearCharacteristics() {};
    virtual ~LinearCharacteristics();
    float operator()(float x)
    {
        return evaluate(x);
    }
    float evaluate(float x);
    void setup(float gain, float offset);
    void setup(float x0, float x1, float y0, float y1);
    void setup(float x0, float x1, float y0, float y1, float yMin, float yMax);
    void correctExistingOffset(float);
private:
    float gain;
    float offset;
    float yMin;
    float yMax;
};
#endif