138 FilterFifo3F() =
delete;
140 FilterFifo3F(
size_t size)
154 unsafeGetFilterFifo()
165 push(
const xrt_vec3 &sample, uint64_t timestamp_ns)
176 get(
size_t num,
xrt_vec3 *out_sample, uint64_t *out_timestamp_ns)
187 filter(uint64_t start_ns, uint64_t stop_ns,
struct xrt_vec3 *out_average)
void m_ff_f64_push(struct m_ff_f64 *ff, const double *sample, uint64_t timestamp_ns)
Pushes a sample at the given timepoint, pushing samples out of order yields unspecified behaviour,...
Definition: m_filter_fifo.c:273
bool m_ff_vec3_f32_get_timestamp(struct m_ff_vec3_f32 *ff, size_t num, uint64_t *out_timestamp_ns)
Return the timestamp of the sample at the index, zero means the last sample push, one second last and...
Definition: m_filter_fifo.c:113
bool m_ff_f64_get(struct m_ff_f64 *ff, size_t num, double *out_sample, uint64_t *out_timestamp_ns)
Return the sample at the index, 0 means the last sample push, 1 second-to-last, etc.
Definition: m_filter_fifo.c:286
void m_ff_f64_alloc(struct m_ff_f64 **ff_out, size_t num)
Allocates a filter fifo tracking num samples and fills it with num samples at timepoint zero.
Definition: m_filter_fifo.c:246
void m_ff_vec3_f32_free(struct m_ff_vec3_f32 **ff_ptr)
Frees the given filter fifo and all its samples.
Definition: m_filter_fifo.c:81
void m_ff_vec3_f32_push(struct m_ff_vec3_f32 *ff, const struct xrt_vec3 *sample, uint64_t timestamp_ns)
Pushes a sample at the given timepoint, pushing samples out of order yields unspecified behaviour,...
Definition: m_filter_fifo.c:100
void m_ff_vec3_f32_alloc(struct m_ff_vec3_f32 **ff_out, size_t num)
Allocates a filter fifo tracking num samples and fills it with num samples at timepoint zero.
Definition: m_filter_fifo.c:73
size_t m_ff_vec3_f32_filter(struct m_ff_vec3_f32 *ff, uint64_t start_ns, uint64_t stop_ns, struct xrt_vec3 *out_average)
Averages all samples in the fifo between the two timepoints, returns number of samples sampled,...
Definition: m_filter_fifo.c:140
bool m_ff_vec3_f32_get(struct m_ff_vec3_f32 *ff, size_t num, struct xrt_vec3 *out_sample, uint64_t *out_timestamp_ns)
Return the sample at the index, zero means the last sample push, one second last and so on.
Definition: m_filter_fifo.c:126
void m_ff_f64_free(struct m_ff_f64 **ff_ptr)
Frees the given filter fifo and all its samples.
Definition: m_filter_fifo.c:254
size_t m_ff_f64_filter(struct m_ff_f64 *ff, uint64_t start_ns, uint64_t stop_ns, double *out_average)
Averages all samples in the fifo between the two timepoints, returns number of samples sampled,...
Definition: m_filter_fifo.c:300
size_t m_ff_vec3_f32_get_num(struct m_ff_vec3_f32 *ff)
Return the number of samples that can fill the fifo.
Definition: m_filter_fifo.c:94
size_t m_ff_f64_get_num(struct m_ff_f64 *ff)
Return the number of samples that can fill the fifo.
Definition: m_filter_fifo.c:267
Definition: m_filter_fifo.c:198
Definition: m_filter_fifo.c:23
A 3 element vector with single floats.
Definition: xrt_defines.h:289
static const cJSON * get(const cJSON *json, const char *f)
Less typing.
Definition: u_json.c:36
Common defines and enums for XRT.