Windows(C++)[v1.7.5.0]
PanoAnnotation.h
浏览该文件的文档.
1
3#pragma once
4
5#include "PanoRtcDefs.h"
6#include "PanoRtcDevice.h"
7#include "PanoWhiteboard.h"
8
9#include <stddef.h>
10
12PANORTC_NS_BEGIN
13
15
16// Values are platform-specific for Window type:
17// - On Windows: HWND.
18// - On macOS: CGWindowID.
19using AnnoWindowID = uintptr_t;
20
22enum class AnnoOption
23{
29 ENABLE_LOCAL_RENDER = 1, // type: bool
33 ENABLE_SHOW_DRAWS = 2, // type: bool
37 ENABLE_UI_RESPONSE = 3, // type: bool
41 ENABLE_CURSORPOS_SYNC = 4, // type: bool
45 ENABLE_SHOW_REMOTE_CURSOR = 5, // type: bool
46};
47
53{
56 DEFAULT = 1,
59 AUTO_SYNC = 2,
66};
67
75{
76public:
84 {
85 public:
94 virtual void onAnnoRoleChanged(WBRoleType newRole) {}
95
106 virtual void onSnapshotComplete(QResult result, const char *filename) {}
107
118 virtual void onAnnoWindowCreated(AnnoWindowID windowId) {}
119
130 virtual void onAnnoWindowDestroyed(AnnoWindowID windowId) {}
131
138 virtual ~Callback() = default;
139 };
140
147 virtual QResult setCallback(Callback *callback) = 0;
148
157 virtual QResult setRoleType(WBRoleType type) = 0;
158
179 virtual QResult startAnnotation(void *window) = 0;
180
193 virtual QResult stopAnnotation() = 0;
194
211 virtual QResult setVisible(bool visible) = 0;
212
227 virtual QResult addToolboxView(void *window) = 0;
228
243 virtual QResult removeToolboxView(void *window) = 0;
244
259 virtual QResult setToolType(WBToolType type) = 0;
260
275 virtual QResult setLineWidth(int size) = 0;
276
291 virtual QResult setColor(WBColor color) = 0;
292
307 virtual QResult setFillType(WBFillType type) = 0;
308
325 virtual QResult setFillColor(WBColor color) = 0;
326
341 virtual QResult setFontStyle(WBFontStyle style) = 0;
342
357 virtual QResult setFontSize(int size) = 0;
358
371 virtual QResult undo() = 0;
372
385 virtual QResult redo() = 0;
386
405 virtual QResult clearUserContents(uint64_t userId) = 0;
406
423 virtual QResult clearContents() = 0;
424
441 virtual QResult snapshot(const char *outputDir) = 0;
442
453 virtual WBToolType getToolType() = 0;
454
471 virtual QResult setAspectSize(int32_t w, int32_t h) = 0;
472
488
503 virtual QResult setWindowPos(WBRect rect) = 0;
504
523 virtual QResult setOption(AnnoOption option, void *param, size_t size) = 0;
524
540
541protected:
548 virtual ~PanoAnnotation() = default;
549};
550
558{
559public:
567 {
568 public:
579 virtual void onVideoAnnotationStart(uint64_t userId, int streamId) {}
590 virtual void onVideoAnnotationStop(uint64_t userId, int streamId) {}
591
600 virtual void onShareAnnotationStart(uint64_t userId) {}
609 virtual void onShareAnnotationStop(uint64_t userId) {}
610
619 virtual void onExternalAnnotationStart(const char* annotationId) {}
628 virtual void onExternalAnnotationStop(const char* annotationId) {}
629
636 virtual ~Callback() = default;
637 };
638
645 virtual QResult setCallback(Callback *callback) = 0;
646
665 virtual PanoAnnotation* getVideoAnnotation(uint64_t userId, int streamId) = 0;
666
683 virtual PanoAnnotation* getShareAnnotation(uint64_t userId) = 0;
684
707 virtual PanoAnnotation* getExternalAnnotation(const char* annotationId) = 0;
708
709protected:
716 virtual ~AnnotationManager() = default;
717};
718
719PANORTC_NS_END
AnnoOption
标注选项。
Definition: PanoAnnotation.h:23
@ ENABLE_CURSORPOS_SYNC
@ ENABLE_UI_RESPONSE
@ ENABLE_LOCAL_RENDER
@ ENABLE_SHOW_REMOTE_CURSOR
ExternalAnnoMode
外部标注模式。
Definition: PanoAnnotation.h:53
QResult
返回值
Definition: PanoRtcDefs.h:54
VideoScalingMode
视频渲染缩放模式
Definition: PanoRtcDevice.h:480
WBRoleType
白板角色类型。
Definition: PanoWhiteboard.h:23
WBFillType
填充类型。
Definition: PanoWhiteboard.h:73
WBFontStyle
白板字体样式。
Definition: PanoWhiteboard.h:142
WBToolType
白板工具箱类型。
Definition: PanoWhiteboard.h:34
AnnotationManager 的回调函数, 在使用 AnnotationManager 之前必须要设置回调以获取事件通知。
Definition: PanoAnnotation.h:567
virtual void onShareAnnotationStart(uint64_t userId)
开始共享标注通知
Definition: PanoAnnotation.h:600
virtual void onShareAnnotationStop(uint64_t userId)
终止共享标注通知
Definition: PanoAnnotation.h:609
virtual void onVideoAnnotationStop(uint64_t userId, int streamId)
终止视频标注通知
Definition: PanoAnnotation.h:590
virtual ~Callback()=default
virtual void onExternalAnnotationStart(const char *annotationId)
外部标注开始通知
Definition: PanoAnnotation.h:619
virtual void onExternalAnnotationStop(const char *annotationId)
外部标注终止通知
Definition: PanoAnnotation.h:628
virtual void onVideoAnnotationStart(uint64_t userId, int streamId)
开始视频标注通知
Definition: PanoAnnotation.h:579
标注管理器
Definition: PanoAnnotation.h:558
virtual PanoAnnotation * getExternalAnnotation(const char *annotationId)=0
获取外部标注对象
virtual ~AnnotationManager()=default
析构函数
virtual QResult setCallback(Callback *callback)=0
设置标注管理器回调函数,用以接收标注事件消息
virtual PanoAnnotation * getVideoAnnotation(uint64_t userId, int streamId)=0
获取视频标注对象
virtual PanoAnnotation * getShareAnnotation(uint64_t userId)=0
获取共享标注对象
PanoAnnotation 的回调函数, 在使用 PanoAnnotation 之前必须要设置回调以获取事件通知。
Definition: PanoAnnotation.h:84
virtual void onSnapshotComplete(QResult result, const char *filename)
标注快照完成通知
Definition: PanoAnnotation.h:106
virtual void onAnnoWindowCreated(AnnoWindowID windowId)
标注窗口创建通知
Definition: PanoAnnotation.h:118
virtual void onAnnoRoleChanged(WBRoleType newRole)
标注角色类型变化通知
Definition: PanoAnnotation.h:94
virtual ~Callback()=default
virtual void onAnnoWindowDestroyed(AnnoWindowID windowId)
标注窗口销毁通知
Definition: PanoAnnotation.h:130
PanoAnnotation, 标注的核心接口
Definition: PanoAnnotation.h:75
virtual QResult stopAnnotation()=0
停止标注
virtual QResult setFillType(WBFillType type)=0
设置填充类型
virtual QResult removeToolboxView(void *window)=0
移除工具栏窗口
virtual QResult setExtAnnoMode(ExternalAnnoMode mode)=0
设置外部标注模式。仅对外部标注有效。
virtual QResult startAnnotation(void *window)=0
开启标注并且设置显示窗口
virtual QResult setFontStyle(WBFontStyle style)=0
设置字体样式
virtual QResult clearUserContents(uint64_t userId)=0
清除指定用户标注内容
virtual QResult setFillColor(WBColor color)=0
设置填充颜色
virtual QResult setFontSize(int size)=0
设置字体大小
virtual QResult setColor(WBColor color)=0
设置颜色
virtual QResult addToolboxView(void *window)=0
增加工具栏窗口
virtual QResult setLineWidth(int size)=0
设置线宽
virtual WBToolType getToolType()=0
获取工具类型
virtual QResult setVisible(bool visible)=0
设置标注视图是否可见
virtual QResult setOption(AnnoOption option, void *param, size_t size)=0
设置标注参数
virtual QResult setRoleType(WBRoleType type)=0
设置标注角色类型。
virtual QResult clearContents()=0
清除标注内容,需要 ADMIN 角色才可调用成功
virtual QResult setScalingMode(WBScalingMode mode)=0
设置标注区域缩放模式
virtual QResult undo()=0
撤消上一次操作
virtual QResult setAspectSize(int32_t w, int32_t h)=0
设置标注区域大小
virtual QResult snapshot(const char *outputDir)=0
保存标注内容到图像。
virtual QResult setToolType(WBToolType type)=0
设置工具类型
virtual QResult setCallback(Callback *callback)=0
设置标注回调函数,用以接收标注事件消息
virtual QResult setWindowPos(WBRect rect)=0
设置标注窗口位置及大小。
virtual ~PanoAnnotation()=default
析构函数
virtual QResult redo()=0
重做标注的上一次被撤销操作
白板颜色。
Definition: PanoWhiteboard.h:125
矩形。
Definition: PanoWhiteboard.h:112