ogl_beamforming

Ultrasound Beamforming Implemented with OpenGL
git clone anongit@rnpnr.xyz:ogl_beamforming.git
Log | Files | Refs | Feed | Submodules | LICENSE

Commit: b22f811d0194b0961e153ca7b56cd50a4c0c3cd2
Parent: 34d5b881cfab5d94a622852409e8f0b8863179cd
Author: Randy Palamar
Date:   Thu, 11 Jul 2024 08:45:19 -0600

add lib option to build.sh and fix errors

Diffstat:
Mbuild.sh | 4++++
Mhelpers/ogl_beamformer_lib.c | 4++--
Mhelpers/ogl_beamformer_lib.h | 2+-
3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/build.sh b/build.sh @@ -7,6 +7,10 @@ case "$1" in cflags="$cflags -I./external/include" ldflags="$ldflags -lgdi32 -lwinmm -L./external" ;; +"lib") + cflags="$cflags -I"/opt/matlab/extern/include" -shared -fPIC" + cc $cflags helpers/ogl_beamformer_lib.c -o helpers/ogl_beamformer_lib.so + ;; *) ldflags="$ldflags -lGL" diff --git a/helpers/ogl_beamformer_lib.c b/helpers/ogl_beamformer_lib.c @@ -120,7 +120,7 @@ check_shared_memory(char *name) } void -send_data(char *pipe_name, i16 *data, uv4 data_dim) +send_data(char *pipe_name, char *shm_name, i16 *data, uv4 data_dim) { if (g_pipe.file == OS_INVALID_FILE) { g_pipe = os_open_named_pipe(pipe_name); @@ -130,7 +130,7 @@ send_data(char *pipe_name, i16 *data, uv4 data_dim) } } - check_shared_memory(); + check_shared_memory(shm_name); /* TODO: this probably needs a mutex around it if we want to change it here */ g_bp->rf_data_dim = data_dim; size data_size = data_dim.x * data_dim.y * data_dim.z * sizeof(i16); diff --git a/helpers/ogl_beamformer_lib.h b/helpers/ogl_beamformer_lib.h @@ -25,4 +25,4 @@ typedef struct { u32 x, y, z, w; } uv4; #include "../beamformer_parameters.h" LIB_FN void set_beamformer_parameters(char *shm_name, BeamformerParameters *); -LIB_FN void send_data(char *, i16 *, uv3 data_dim); +LIB_FN void send_data(char *pipe_name, char *shm_name, i16 *data, uv4 data_dim);