62 lines
1.9 KiB
C++
62 lines
1.9 KiB
C++
#ifndef P10_INTELLIGENTPAGE_H
|
||
#define P10_INTELLIGENTPAGE_H
|
||
|
||
#include <QWidget>
|
||
#include <QPixmap>
|
||
#include <QTimer>
|
||
#include <QEvent>
|
||
#include <QMouseEvent>
|
||
#if CONFIG_EN_RTSP //开启 RTSP 读取
|
||
#include <PublicFunctions/RtspPlayer.h> // 引入RTSP播放器头文件
|
||
#include <GlobalDefinitions/Variable.h>
|
||
#endif
|
||
namespace Ui {
|
||
class P10_IntelligentPage;
|
||
}
|
||
|
||
class P10_IntelligentPage : public QWidget
|
||
{
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit P10_IntelligentPage(QWidget *parent = nullptr);
|
||
~P10_IntelligentPage();
|
||
#if CONFIG_EN_RTSP //开启 RTSP 读取
|
||
void setRtspUrl(const QString &url); // 设置RTSP地址接口
|
||
void WinInit(); // 初始化界面与逻辑
|
||
|
||
private slots:
|
||
void onFrameReady(const QImage &frame); // 接收新视频帧并显示
|
||
void onErrorOccurred(const QString &msg); // 接收错误信息并提示
|
||
|
||
// 按钮点击事件(UI自动关联,需确保.ui文件中按钮对象名一致)
|
||
void on_But_Atlas_1_clicked(); // 切换摄像头1
|
||
void on_But_Atlas_2_clicked(); // 切换摄像头2
|
||
void on_But_Atlas_3_clicked(); // 暂停/继续播放
|
||
void on_But_Magnify_clicked(); // 图像放大
|
||
void on_But_Reduce_clicked(); // 图像缩小
|
||
|
||
private:
|
||
#endif
|
||
Ui::P10_IntelligentPage *ui;
|
||
#if CONFIG_EN_RTSP //开启 RTSP 读取
|
||
// 事件过滤器(处理鼠标拖拽平移)
|
||
bool eventFilter(QObject *obj, QEvent *ev) override;
|
||
|
||
/* 图像尺寸与缩放参数 */
|
||
uint32_t Img_W = 0; // 图像原始宽度
|
||
uint32_t Img_H = 0; // 图像原始高度
|
||
float Img_Zoom = 1.0f; // 缩放比例(默认100%)
|
||
|
||
/* 鼠标拖拽参数 */
|
||
QPoint dragStart; // 拖拽起始点
|
||
bool dragging = false; // 拖拽状态标记
|
||
|
||
/* RTSP播放相关 */
|
||
RtspPlayer *m_rtspPlayer; // RTSP播放器实例
|
||
QString m_rtspUrl; // 当前使用的RTSP地址
|
||
#endif
|
||
};
|
||
|
||
#endif // P10_INTELLIGENTPAGE_H
|