ramzed_sdk.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. #ifndef RAMZED_SDK_H
  2. #define RAMZED_SDK_H
  3. enum {
  4. PROBE_NULL = -1,
  5. PROBE_LINEAR = 0, //L40
  6. PROBE_CONVEX, //R60
  7. // PROBE_MINI_LINEAR,
  8. // PROBE_MINI_CONVEX,
  9. PROBE_MAX,
  10. };
  11. enum {
  12. MODE_NULL = 0,
  13. MODE_B = 1,
  14. MODE_C,
  15. MODE_D,
  16. // MODE_M,
  17. MAX_MODE_NUM
  18. };
  19. #define FORMAT_QT_RGB888 0
  20. #define FORMAT_QT_ARGB8888 1
  21. #define FORMAT_PNG 10
  22. #define FORMAT_JPG 11
  23. typedef struct _image_msg_t{
  24. //1. header
  25. unsigned short version;
  26. unsigned short frame_type;
  27. unsigned int frame_id;
  28. unsigned int width;
  29. unsigned int height;
  30. unsigned int length;
  31. unsigned int image_format;
  32. char probe_type;
  33. unsigned char res[3];
  34. //2. payload
  35. unsigned char payload[0];
  36. }image_header_msg_t, image_msg_t;
  37. typedef void (*image_done_callback_t)(unsigned char *frame_msg);
  38. typedef void (*image_done_callback2_t)(unsigned char *frame_msg_header, unsigned char *payload);
  39. typedef int (*check_callback2_t)();
  40. typedef void (*probe_connected_callback_t)(unsigned char probe_type);
  41. //just ch32 or new ch24
  42. typedef void (*probe_disconnected_callback_t)(unsigned char probe_type);
  43. #define PRESET_SMALLPART 1
  44. #define PRESET_LIVERPART 2
  45. class __declspec(dllimport) ramzed_sdk
  46. {
  47. public:
  48. ramzed_sdk();
  49. static ramzed_sdk* instance();
  50. int init();
  51. void reg_image_done_cb(image_done_callback_t cb);
  52. void reg_image_done_cb2(check_callback2_t check_cb, image_done_callback2_t cb);
  53. void reg_probe_connected_cb(probe_connected_callback_t cb);
  54. void reg_probe_disconnected_cb(probe_disconnected_callback_t cb);
  55. // void cfg_usb_probe_type(int probe_type);
  56. // void usb_shutting_down(unsigned char down);
  57. // int switch_probe_type(int probe_type);
  58. int set_preset(int preset);
  59. int set_mode(unsigned char mode);
  60. int set_B_gain(unsigned char gain);
  61. int set_B_depth(unsigned char factor);
  62. int set_B_frequency(float frq);
  63. int set_B_focus(unsigned char focus);
  64. int set_B_harmonic(unsigned char harmonic);
  65. int set_B_power(unsigned char power);
  66. int set_B_dynamic_range(unsigned char range);
  67. int get_B_gain(unsigned char *gain);
  68. int get_B_depth(unsigned char *gears, float *depth_cm);
  69. int get_B_frequency(float *frq);
  70. int get_B_focus(unsigned char *gears, float *focus_cm);
  71. //int get_B_power(unsigned char *power);
  72. int get_B_dynamic_range(unsigned char *range);
  73. int set_tgc1(unsigned char tgc);
  74. int set_tgc2(unsigned char tgc);
  75. int set_tgc3(unsigned char tgc);
  76. int set_tgc4(unsigned char tgc);
  77. int set_tgc5(unsigned char tgc);
  78. int set_tgc6(unsigned char tgc);
  79. int set_tgc7(unsigned char tgc);
  80. int set_tgc8(unsigned char tgc);
  81. int get_tgc1(float *tgc);
  82. int get_tgc2(float *tgc);
  83. int get_tgc3(float *tgc);
  84. int get_tgc4(float *tgc);
  85. int get_tgc5(float *tgc);
  86. int get_tgc6(float *tgc);
  87. int get_tgc7(float *tgc);
  88. int get_tgc8(float *tgc);
  89. int set_C_ROI(int x1, int x2, int y1, int y2);
  90. //int set_C_ROI2(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
  91. int set_C_gain(unsigned char gain);
  92. int set_C_frequency(float frq);
  93. // int set_C_speed_wall_filter(unsigned char speed);
  94. //int set_C_range_wall_filter(unsigned char range);
  95. // int set_C_persistence(unsigned char perc);
  96. //int set_C_linear_angle(int angle);
  97. int set_C_prf(unsigned char prf);
  98. int set_C_angle(unsigned char prf);
  99. int get_C_angle(unsigned char *prf);
  100. int get_C_prf(unsigned char *prf);
  101. int get_C_gain(unsigned char *gain);
  102. int get_C_frequency(float *frq);
  103. // int set_D_submode(unsigned char bc_mode);
  104. // int set_D_sampling(int x, int y);
  105. // int set_D_angle(int angle);
  106. // int set_D_baseline(int baseline);
  107. // int set_D_gain(unsigned char gain);
  108. // int set_D_prf(unsigned char prf);
  109. // int set_D_sampling_gate(unsigned char gate);
  110. // int cfg_D_image_width_height(int width, int height);
  111. // int get_D_prf(float *prf);
  112. // int get_D_sampling_gate(float *mm);
  113. // int get_D_speed_range(float *start, float *end);
  114. int set_freeze(unsigned char enable);
  115. int set_ctrl_table(unsigned char *table);
  116. int get_ctrl_table(unsigned char *table);
  117. //int set_post_level(unsigned char level);
  118. // int set_mirror(unsigned char mirror);
  119. // int set_debug_info(int enable);
  120. };
  121. #endif // RAMZED_SDK_H