#include <C:/Work/specialnumbers_svn/NumberLib/NumbersLib/XYResponseCurve.h>
This curve is slower than the ordinary ResponseCurve. However, it is useful for generating the inverse of a monotonic function. For rapid access, this curve should be sampled into a ordinary ResponseCurve.
Definition at line 18 of file XYResponseCurve.h.
Public Member Functions | |
unsigned int | findInputIndex (const T input) const |
Private: only made public for testing! Test which input sample lies to the left of the given input. | |
void | makeInverse () |
T | operator() (const T input) const |
If the input is below the inputMin given in the constructor, the output is clamped to the first output sample. | |
XYResponseCurve (T inputSamples[n], T outputSamples[n]) | |
Construct a new XYResponse curve from input and output samples. | |
Private Attributes | |
T | mInputSamples [n] |
T | mOutputSamples [n] |
XYResponseCurve | ( | T | inputSamples[n], | |
T | outputSamples[n] | |||
) | [inline] |
Construct a new XYResponse curve from input and output samples.
inputSamples | The input values for this response curve. Must be strictly increasing. | |
outputSamples | The output vlaues for this curve. |
Definition at line 61 of file XYResponseCurve.h.
References XYResponseCurve::mInputSamples, and XYResponseCurve::mOutputSamples.
unsigned int findInputIndex | ( | const T | input | ) | const [inline] |
Private: only made public for testing! Test which input sample lies to the left of the given input.
Definition at line 96 of file XYResponseCurve.h.
References luma::numbers::max(), luma::numbers::min(), and XYResponseCurve::mInputSamples.
Referenced by XYResponseCurve::operator()().
void makeInverse | ( | ) | [inline] |
Definition at line 120 of file XYResponseCurve.h.
References XYResponseCurve::mInputSamples, and XYResponseCurve::mOutputSamples.
T operator() | ( | const T | input | ) | const [inline, virtual] |
If the input is below the inputMin given in the constructor, the output is clamped to the first output sample.
If the input is above the inputMax given in the constructor, the output is clamped to the last output sample.
Otherwise an index is calculated, and the output is interpolated between outputSample[index] and outputSample[index + 1].
input | The input for which output is sought. |
Implements AbstractFunction.
Definition at line 71 of file XYResponseCurve.h.
References XYResponseCurve::findInputIndex(), XYResponseCurve::mInputSamples, and XYResponseCurve::mOutputSamples.
T mInputSamples[n] [private] |
Definition at line 55 of file XYResponseCurve.h.
Referenced by XYResponseCurve::findInputIndex(), XYResponseCurve::makeInverse(), XYResponseCurve::operator()(), and XYResponseCurve::XYResponseCurve().
T mOutputSamples[n] [private] |
Definition at line 56 of file XYResponseCurve.h.
Referenced by XYResponseCurve::makeInverse(), XYResponseCurve::operator()(), and XYResponseCurve::XYResponseCurve().