XYResponseCurve Class Template Reference

#include <C:/Work/specialnumbers_svn/NumberLib/NumbersLib/XYResponseCurve.h>

Inheritance diagram for XYResponseCurve:

AbstractFunction

List of all members.


Detailed Description

template<class T, unsigned int n>
class luma::numbers::XYResponseCurve< T, n >

Similar to ResponseCurve, but allows sample points to be unevenly spaced.

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 ()
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

mInputSamples [n]
mOutputSamples [n]

Constructor & Destructor Documentation

XYResponseCurve ( inputSamples[n],
outputSamples[n] 
) [inline]

Construct a new XYResponse curve from input and output samples.

Parameters:
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.


Member Function Documentation

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]

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].

Parameters:
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.


Member Data Documentation

T mInputSamples[n] [private]

T mOutputSamples[n] [private]


The documentation for this class was generated from the following file:

Generated on Sun Sep 21 20:49:08 2008 for Numbers by  doxygen 1.5.6