ogl_beamforming

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

ogl_beamformer_lib.h (1973B)


      1 /* See LICENSE for license details. */
      2 #include <stddef.h>
      3 #include <stdint.h>
      4 
      5 typedef int16_t   i16;
      6 typedef uint16_t  u16;
      7 typedef int32_t   i32;
      8 typedef uint32_t  u32;
      9 typedef uint32_t  b32;
     10 typedef float     f32;
     11 typedef struct { u32 x, y; }       uv2;
     12 typedef struct { u32 x, y, z, w; } uv4;
     13 typedef struct { f32 x, y, z, w; } v4;
     14 
     15 #include "../beamformer_parameters.h"
     16 
     17 #if defined(_WIN32)
     18 #define LIB_FN __declspec(dllexport)
     19 #else
     20 #define LIB_FN
     21 #endif
     22 
     23 /* IMPORTANT: timeout of -1 will block forever */
     24 
     25 LIB_FN b32 set_beamformer_parameters(char *shm_name, BeamformerParametersV0 *);
     26 LIB_FN b32 set_beamformer_pipeline(char *shm_name, i32 *stages, i32 stages_count);
     27 LIB_FN b32 send_data(char *pipe_name, char *shm_name, void *data, u32 data_size);
     28 
     29 /* NOTE: sends data and waits for (complex) beamformed data to be returned.
     30  * out_data: must be allocated by the caller as 2 f32s per output point. */
     31 LIB_FN b32 beamform_data_synchronized(char *pipe_name, char *shm_name, void *data, u32 data_size,
     32                                       uv4 output_points, f32 *out_data, i32 timeout_ms);
     33 
     34 LIB_FN b32 beamformer_start_compute(char *shm_name, u32 image_plane_tag);
     35 
     36 /* NOTE: these functions only queue an upload; you must flush (old data functions or start_compute) */
     37 LIB_FN b32 beamformer_push_data(char *shm_name, void *data, u32 data_size, i32 timeout_ms);
     38 LIB_FN b32 beamformer_push_channel_mapping(char *shm_name, i16 *mapping, u32 count, i32 timeout_ms);
     39 LIB_FN b32 beamformer_push_sparse_elements(char *shm_name, i16 *elements, u32 count, i32 timeout_ms);
     40 LIB_FN b32 beamformer_push_focal_vectors(char *shm_name, f32 *vectors, u32 count, i32 timeout_ms);
     41 LIB_FN b32 beamformer_push_parameters(char *shm_name, BeamformerParameters *bp, i32 timeout_ms);
     42 LIB_FN b32 beamformer_push_parameters_ui(char *shm_name, BeamformerUIParameters *, i32 timeout_ms);
     43 LIB_FN b32 beamformer_push_parameters_head(char *shm_name, BeamformerParametersHead *, i32 timeout_ms);