AJA NTV2 SDK
17.1.3.1410
NTV2 SDK 17.1.3.1410
|
#include <ajamovingavg.h>
Public Member Functions | |
AJAMovingAvg (const size_t inMaxNumSamples=kDefaultMaxNumSamples) | |
void | addSample (const T inValue) |
void | reset (const size_t inMaxNumSamples=kDefaultMaxNumSamples) |
size_t | numStoredSamples (void) const |
size_t | sampleCapacity (void) const |
size_t | totalSamples (void) const |
bool | isValid (void) const |
bool | isEmpty (void) const |
T | average (void) const |
double | averageF (void) const |
T | minimum (void) const |
T | recentMinimum (void) const |
T | maximum (void) const |
T | recentMaximum (void) const |
std::ostream & | Print (std::ostream &oss, const bool inDetailed=false) const |
Static Public Attributes | |
static const size_t | kDefaultMaxNumSamples = 10 |
Protected Member Functions | |
T | sum (void) const |
Static Protected Member Functions | |
static T | smallestPossibleValue (void) |
static T | largestPossibleValue (void) |
Class that maintains a moving average of a fixed number of T samples. Defaults to a maximum of 10 samples.
Definition at line 28 of file ajamovingavg.h.
|
inlineexplicit |
Constructs me with the given sample capacity.
[in] | inMaxNumSamples | Specifies the maximum number of samples to be stored. |
Definition at line 39 of file ajamovingavg.h.
|
inline |
Stores the given sample value. If my sample capacity is exceeded, my oldest sample is dropped.
[in] | inValue | Specifies the new sample value. |
Definition at line 49 of file ajamovingavg.h.
|
inline |
Definition at line 103 of file ajamovingavg.h.
|
inline |
Definition at line 113 of file ajamovingavg.h.
|
inline |
Definition at line 98 of file ajamovingavg.h.
|
inline |
Definition at line 93 of file ajamovingavg.h.
|
inlinestaticprotected |
Definition at line 221 of file ajamovingavg.h.
|
inline |
Definition at line 141 of file ajamovingavg.h.
|
inline |
Definition at line 123 of file ajamovingavg.h.
|
inline |
Definition at line 78 of file ajamovingavg.h.
|
inline |
Writes my current state in a human-readable form into the given output stream.
oss | The output stream to write into. | |
[in] | inDetailed | Specify true to print detailed information about my state; otherwise just print my average value as a floating-point value. Defaults to false. |
Definition at line 164 of file ajamovingavg.h.
|
inline |
Definition at line 146 of file ajamovingavg.h.
|
inline |
Definition at line 128 of file ajamovingavg.h.
|
inline |
Resets me with the given maximum number of samples.
[in] | inMaxNumSamples | Specifies my new sample capacity. |
Definition at line 66 of file ajamovingavg.h.
|
inline |
Definition at line 83 of file ajamovingavg.h.
|
inlinestaticprotected |
Definition at line 190 of file ajamovingavg.h.
|
inlineprotected |
Definition at line 179 of file ajamovingavg.h.
|
inline |
Definition at line 88 of file ajamovingavg.h.
|
static |
Definition at line 31 of file ajamovingavg.h.