ogl_beamforming

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

beamformer_parameters.h (2297B)


      1 /* See LICENSE for license details. */
      2 
      3 /* TODO(rnp):
      4  * [ ]: shader kinds have ballooned; shader stats table needs to be compressed
      5  * [ ]: Upload previously exported data for display. maybe this is a UI thing but doing it
      6  *      programatically would be nice.
      7  * [ ]: Add interface for multi frame upload. RF upload already uses an offset into SM so
      8  *      that part works fine. We just need a way of specify a multi frame upload. (Data must
      9  *      be organized for simple offset access per frame).
     10  */
     11 
     12 typedef struct {
     13 	/* NOTE(rnp): this wants to be iterated on both dimensions. it depends entirely on which
     14 	 * visualization method you want to use. the coalescing function wants both directions */
     15 	float times[32][BeamformerMaxComputeShaderStages];
     16 	float rf_time_deltas[32];
     17 } BeamformerComputeStatsTable;
     18 
     19 /* X(type, id, pretty name) */
     20 #define BEAMFORMER_VIEW_PLANE_TAG_LIST \
     21 	X(XZ,        0, "XZ")        \
     22 	X(YZ,        1, "YZ")        \
     23 	X(XY,        2, "XY")        \
     24 	X(Arbitrary, 3, "Arbitrary")
     25 
     26 typedef enum {
     27 	#define X(type, id, pretty) BeamformerViewPlaneTag_##type = id,
     28 	BEAMFORMER_VIEW_PLANE_TAG_LIST
     29 	#undef X
     30 	BeamformerViewPlaneTag_Count,
     31 } BeamformerViewPlaneTag;
     32 
     33 #define BEAMFORMER_LIVE_IMAGING_DIRTY_FLAG_LIST \
     34 	X(ImagePlaneOffsets, 0) \
     35 	X(TransmitPower,     1) \
     36 	X(TGCControlPoints,  2) \
     37 	X(SaveData,          3) \
     38 	X(SaveNameTag,       4) \
     39 	X(StopImaging,       5)
     40 /* NOTE(rnp): if this exceeds 32 you need to fix the flag handling code */
     41 
     42 #define BEAMFORMER_LIVE_IMAGING_PARAMETERS_LIST \
     43 	X(active,               uint32_t, ,                               1)   \
     44 	X(save_enabled,         uint32_t, ,                               1)   \
     45 	X(save_active,          uint32_t, ,                               1)   \
     46 	X(transmit_power,       float,    ,                               1)   \
     47 	X(image_plane_offsets,  float,    [BeamformerViewPlaneTag_Count], BeamformerViewPlaneTag_Count) \
     48 	X(tgc_control_points,   float,    [8],                            8)   \
     49 	X(save_name_tag_length, int32_t,  ,                               1)   \
     50 	X(save_name_tag,        char,     [128],                          128)
     51 
     52 #define X(name, type, size, ...) type name size;
     53 typedef struct {BEAMFORMER_LIVE_IMAGING_PARAMETERS_LIST} BeamformerLiveImagingParameters;
     54 #undef X