label_event.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /******************************************************************************
  2. 版权所有 (C), 2001-2011, 华为技术有限公司
  3. ******************************************************************************
  4. 文 件 名 : label_event.h
  5. 版 本 号 : 初稿
  6. 作 者 : athina
  7. 生成日期 : 2020年7月4日
  8. 最近修改 :
  9. 功能描述 : TLV消息格式定义
  10. 函数列表 :
  11. 修改历史 :
  12. 1.日 期 : 2020年7月4日
  13. 作 者 : athina
  14. 修改内容 : 创建文件
  15. ******************************************************************************/
  16. #ifndef __LABEL_EVENT_H__
  17. #define __LABEL_EVENT_H__
  18. #include <stdint.h>
  19. #ifdef __cplusplus
  20. #if __cplusplus
  21. extern "C"{
  22. #endif
  23. #endif /* End of #ifdef __cplusplus */
  24. //坐标
  25. typedef struct {
  26. uint32_t x;
  27. uint32_t y;
  28. } point;
  29. //多边形
  30. typedef struct {
  31. int32_t color;//rgb
  32. int32_t edge_width;//0-default
  33. uint32_t attr;//0x01-是否填充底色
  34. int32_t bottom_color; //底色颜色
  35. int32_t transparency; //底色透明度
  36. int32_t iPointcnt;//点的个数,起点只需包含一次
  37. point points[0];
  38. } polygon;
  39. //文字标注
  40. typedef struct {
  41. int32_t color;//rgb
  42. char font[32];//按照渲染库能力定义
  43. int32_t size;//文字大小
  44. point pos;//文字左上角位置
  45. int32_t len;
  46. char str[0];
  47. } tag;
  48. //标注事件
  49. typedef struct {
  50. uint32_t add_flag; //添加 || 删除
  51. char app_name[32];
  52. uint64_t id;
  53. uint16_t polygon_cnt;
  54. polygon polygons[0];
  55. uint8_t tag_cnt;
  56. tag tags[0];
  57. uint8_t ttl;//default 1 second
  58. } label;
  59. // 发送元数据
  60. extern int SDC_LabelEventDel(int fp, unsigned int baseid, unsigned int id, char *cAppName);
  61. extern int SDC_LabelEventPublish(int fp, unsigned int baseid, int iDataLen, char *cEventMsg, uint64_t pts);
  62. #ifdef __cplusplus
  63. #if __cplusplus
  64. }
  65. #endif
  66. #endif/* End of #ifdef __cplusplus */
  67. #endif /* __LABEL_EVENT_H__ */