IBaseCamera.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #pragma once
  2. #include "IBaseCamParamConfig.h"
  3. #include "IBaseCamCommon.h"
  4. typedef struct CAMERASERIAL
  5. {
  6. int mSize = 0;
  7. QString mSerial[10];
  8. } CameraSerial;
  9. typedef struct _tagSDKInfo
  10. {
  11. QString strName; // 工具名字
  12. QString strSDKVersion; // SDK版本
  13. QFileInfo fileInfo;
  14. _tagSDKInfo()
  15. {
  16. }
  17. } SDKINFO;
  18. /// 相机接口类
  19. class IBaseCamera
  20. {
  21. public:
  22. IBaseCamera(void) {};
  23. virtual ~IBaseCamera() { };
  24. protected:
  25. /// 打开相机
  26. virtual bool openCamera( QString serial ) = 0;
  27. /// 关闭相机
  28. virtual bool closeCamera( ) = 0;
  29. /// 初始化
  30. virtual bool initialize( ) = 0;
  31. public:
  32. /// 加载参数
  33. virtual void loadCamParam() = 0;
  34. /// 保存参数
  35. virtual void saveCamParam() = 0;
  36. /// 设置相机工作模式
  37. virtual bool setWorkMode(IBaseCamCommon::CamWorkMode, bool Running = false) = 0;
  38. /// 相机工作模式
  39. virtual IBaseCamCommon::CamWorkMode workMode( ) = 0;
  40. /// 相机开始工作
  41. virtual bool startWork() = 0;
  42. /// 相机停止工作
  43. virtual bool stopWork() = 0;
  44. /// 相机序列号
  45. virtual QString serial() = 0;
  46. /// 重启相机
  47. virtual bool restartCamera() = 0;
  48. /// 获取一桢图像
  49. virtual bool captureImage( void **buf, int size ) = 0;
  50. /// 获取图像宽
  51. virtual int imageWidth( void ) = 0;
  52. /// 获取图像高
  53. virtual int imageHeight( void ) = 0;
  54. /// 获取图像通道数
  55. virtual int imageChannels( void ) = 0;
  56. /// 获取配置参数类
  57. virtual IBaseCamParamConfig* camParamConfig() = 0;
  58. /// 显示设置参数窗口页面
  59. virtual void showParamConfigWindow( int mode = 0 ) = 0;
  60. /// 获取相机最大分辨率
  61. virtual bool getMaxSize( int &w, int &h ) = 0;
  62. /// 设置相机分辨率
  63. virtual bool setResolution( int w, int h ) = 0;
  64. /// 获取已注册图像回调的数量
  65. virtual int getReceCallBackSIze() = 0;
  66. ///设置接收图像数据回调函数
  67. virtual void setReceCallBack(IBaseCamCommon::receImgCallBack callBack,long long userParam , QString userID) = 0;
  68. ///设置接收Log数据回调函数
  69. virtual void setReceLogCallBack(IBaseCamCommon::receLogCallBack callBack, long long userParam) = 0;//设置接收数据回调函数
  70. /// 软件触发采图
  71. virtual void softTriggerCap(QString userID = "main") = 0;
  72. };