ogl_beamforming

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

beamformer_core.c (5383B)


      1 /* See LICENSE for license details. */
      2 
      3 // GENERATED CODE
      4 
      5 typedef enum {
      6 	BeamformerPanelKind_Nil                 = 0,
      7 	BeamformerPanelKind_Split               = 1,
      8 	BeamformerPanelKind_TabGroup            = 2,
      9 	BeamformerPanelKind_ComputeBarGraph     = 3,
     10 	BeamformerPanelKind_ComputeStats        = 4,
     11 	BeamformerPanelKind_FrameViewLive       = 5,
     12 	BeamformerPanelKind_FrameViewCopy       = 6,
     13 	BeamformerPanelKind_FrameViewXPlane     = 7,
     14 	BeamformerPanelKind_LiveImagingControls = 8,
     15 	BeamformerPanelKind_ParameterListing    = 9,
     16 	BeamformerPanelKind_Count,
     17 } BeamformerPanelKind;
     18 
     19 typedef enum {
     20 	BeamformerRegisterSlot_String         = 0,
     21 	BeamformerRegisterSlot_TreeNode       = 1,
     22 	BeamformerRegisterSlot_Window         = 2,
     23 	BeamformerRegisterSlot_Frame          = 3,
     24 	BeamformerRegisterSlot_FrameView      = 4,
     25 	BeamformerRegisterSlot_SplitAxis      = 5,
     26 	BeamformerRegisterSlot_SplitLeftTree  = 6,
     27 	BeamformerRegisterSlot_SplitRightTree = 7,
     28 	BeamformerRegisterSlot_DropTargetTree = 8,
     29 	BeamformerRegisterSlot_DropChildIndex = 9,
     30 	BeamformerRegisterSlot_Count,
     31 } BeamformerRegisterSlot;
     32 
     33 typedef enum {
     34 	BeamformerCommandKind_Nil       = 0,
     35 	BeamformerCommandKind_CloseTab  = 1,
     36 	BeamformerCommandKind_FocusTab  = 2,
     37 	BeamformerCommandKind_MoveTab   = 3,
     38 	BeamformerCommandKind_OpenTab   = 4,
     39 	BeamformerCommandKind_SplitTree = 5,
     40 	BeamformerCommandKind_Count,
     41 } BeamformerCommandKind;
     42 
     43 typedef enum {
     44 	BeamformerPanelFlags_List        = 1 << 0,
     45 	BeamformerPanelFlags_NeedsFrame  = 1 << 1,
     46 	BeamformerPanelFlags_HasSettings = 1 << 2,
     47 } BeamformerPanelFlags;
     48 
     49 typedef struct {
     50 	str8                 display;
     51 	str8                 string;
     52 	str8                 description;
     53 	BeamformerPanelFlags flags;
     54 } BeamformerPanelInfo;
     55 
     56 typedef struct {
     57 	str8 string;
     58 	u64  tree_node;
     59 	u64  window;
     60 	u64  frame;
     61 	u64  frame_view;
     62 	u64  split_axis;
     63 	u64  split_left_tree;
     64 	u64  split_right_tree;
     65 	u64  drop_target_tree;
     66 	u64  drop_child_index;
     67 } BeamformerRegisters;
     68 
     69 typedef struct {
     70 	str8 string;
     71 	str8 display;
     72 	str8 description;
     73 } BeamformerCommandInfo;
     74 
     75 read_only global BeamformerPanelInfo beamformer_panel_infos[] = {
     76 	{str8_comp(""), str8_comp("nil"), str8_comp(""), (0*BeamformerPanelFlags_List)|(0*BeamformerPanelFlags_NeedsFrame)|(0*BeamformerPanelFlags_HasSettings)},
     77 	{str8_comp(""), str8_comp("split"), str8_comp(""), (0*BeamformerPanelFlags_List)|(0*BeamformerPanelFlags_NeedsFrame)|(0*BeamformerPanelFlags_HasSettings)},
     78 	{str8_comp(""), str8_comp("group"), str8_comp(""), (0*BeamformerPanelFlags_List)|(0*BeamformerPanelFlags_NeedsFrame)|(0*BeamformerPanelFlags_HasSettings)},
     79 	{str8_comp("Compute Bar Graph"), str8_comp("compute_bar_graph"), str8_comp("Bar graph showing portions of compute occupied by each stage."), (1*BeamformerPanelFlags_List)|(0*BeamformerPanelFlags_NeedsFrame)|(0*BeamformerPanelFlags_HasSettings)},
     80 	{str8_comp("Compute Stats"), str8_comp("compute_stats"), str8_comp("Average stats about beamforming computations."), (1*BeamformerPanelFlags_List)|(0*BeamformerPanelFlags_NeedsFrame)|(0*BeamformerPanelFlags_HasSettings)},
     81 	{str8_comp("Frame View"), str8_comp("frame_view_live"), str8_comp("Latest frame with selected tag."), (1*BeamformerPanelFlags_List)|(0*BeamformerPanelFlags_NeedsFrame)|(1*BeamformerPanelFlags_HasSettings)},
     82 	{str8_comp("Frame View (Copy)"), str8_comp("frame_view_copy"), str8_comp("Copy of an old frame. Useful for comparisons."), (0*BeamformerPanelFlags_List)|(1*BeamformerPanelFlags_NeedsFrame)|(1*BeamformerPanelFlags_HasSettings)},
     83 	{str8_comp("3D X-Plane"), str8_comp("frame_view_xplane"), str8_comp("3D Cross Plane View."), (1*BeamformerPanelFlags_List)|(0*BeamformerPanelFlags_NeedsFrame)|(1*BeamformerPanelFlags_HasSettings)},
     84 	{str8_comp("Live Controls"), str8_comp("live_controls"), str8_comp("Imaging system controls."), (1*BeamformerPanelFlags_List)|(0*BeamformerPanelFlags_NeedsFrame)|(0*BeamformerPanelFlags_HasSettings)},
     85 	{str8_comp("Parameter Listing"), str8_comp("parameters_listing"), str8_comp("Editable parameter set used for beamforming."), (1*BeamformerPanelFlags_List)|(0*BeamformerPanelFlags_NeedsFrame)|(1*BeamformerPanelFlags_HasSettings)},
     86 };
     87 
     88 #define beamformer_registers_init_literal \
     89 	.string           = beamformer_registers()->string, \
     90 	.tree_node        = beamformer_registers()->tree_node, \
     91 	.window           = beamformer_registers()->window, \
     92 	.frame            = beamformer_registers()->frame, \
     93 	.frame_view       = beamformer_registers()->frame_view, \
     94 	.split_axis       = beamformer_registers()->split_axis, \
     95 	.split_left_tree  = beamformer_registers()->split_left_tree, \
     96 	.split_right_tree = beamformer_registers()->split_right_tree, \
     97 	.drop_target_tree = beamformer_registers()->drop_target_tree, \
     98 	.drop_child_index = beamformer_registers()->drop_child_index, \
     99 
    100 read_only global BeamformerCommandInfo beamformer_command_infos[] = {
    101 	{0},
    102 	{str8_comp("close_tab"), str8_comp("Close Tab"), str8_comp("Closes currently active tab.")},
    103 	{str8_comp("focus_tab"), str8_comp("Focus Tab"), str8_comp("Focus the currently selected tab in its group.")},
    104 	{str8_comp("move_tab"), str8_comp("Move Tab"), str8_comp("Moves an exisiting tab to a different group/split.")},
    105 	{str8_comp("open_tab"), str8_comp("Open Tab"), str8_comp("Opens a new tab with a specified view.")},
    106 	{str8_comp("split_tree"), str8_comp("Split Tree"), str8_comp("Splits the UI into two new splits.")},
    107 };
    108