Noodle
Loading...
Searching...
No Matches
noodle_buffer.h
Go to the documentation of this file.
1
6
7#ifndef NOODLE_BUFFER_H
8#define NOODLE_BUFFER_H
9
10#include <stddef.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
29typedef struct {
30 float *data;
31 size_t capacity;
33
44
58float *noodle_buffer_require(NoodleBuffer *buf, size_t required_floats);
59
69
77size_t noodle_buffer_capacity(const NoodleBuffer *buf);
78
87
88#ifdef __cplusplus
89}
90#endif
91
92#endif // NOODLE_BUFFER_H
size_t noodle_buffer_capacity_bytes(const NoodleBuffer *buf)
Return the buffer capacity in bytes.
Definition noodle_buffer.cpp:84
void noodle_buffer_free(NoodleBuffer *buf)
Release a NoodleBuffer.
Definition noodle_buffer.cpp:68
float * noodle_buffer_require(NoodleBuffer *buf, size_t required_floats)
Ensure that a buffer can hold at least required_floats floats.
Definition noodle_buffer.cpp:42
void noodle_buffer_init(NoodleBuffer *buf)
Initialize a NoodleBuffer.
Definition noodle_buffer.cpp:35
size_t noodle_buffer_capacity(const NoodleBuffer *buf)
Return the buffer capacity in float elements.
Definition noodle_buffer.cpp:79
Grow-only float buffer managed by Noodle.
Definition noodle_buffer.h:29
size_t capacity
Definition noodle_buffer.h:31
float * data
Definition noodle_buffer.h:30