IBaseCamera.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. /// 相机接口类
  10. class IBaseCamera
  11. {
  12. public:
  13. IBaseCamera(void) {};
  14. virtual ~IBaseCamera() { };
  15. protected:
  16. /// 打开相机
  17. virtual bool openCamera( QString serial ) = 0;
  18. /// 关闭相机
  19. virtual bool closeCamera( ) = 0;
  20. /// 初始化
  21. virtual bool initialize( ) = 0;
  22. public:
  23. /// 加载参数
  24. virtual void loadCamParam() = 0;
  25. /// 保存参数
  26. virtual void saveCamParam() = 0;
  27. /// 设置相机工作模式
  28. virtual bool setWorkMode(IBaseCamCommon::CamWorkMode, bool Running = false) = 0;
  29. /// 相机工作模式
  30. virtual IBaseCamCommon::CamWorkMode workMode( ) = 0;
  31. /// 相机开始工作
  32. virtual bool startWork() = 0;
  33. /// 相机停止工作
  34. virtual bool stopWork() = 0;
  35. /// 相机序列号
  36. virtual QString serial() = 0;
  37. /// 重启相机
  38. virtual bool restartCamera() = 0;
  39. /// 获取一桢图像
  40. virtual bool captureImage( void **buf, int size ) = 0;
  41. /// 获取图像宽
  42. virtual int imageWidth( void ) = 0;
  43. /// 获取图像高
  44. virtual int imageHeight( void ) = 0;
  45. /// 获取图像通道数
  46. virtual int imageChannels( void ) = 0;
  47. /// 获取配置参数类
  48. virtual IBaseCamParamConfig* camParamConfig() = 0;
  49. /// 显示设置参数窗口页面
  50. virtual void showParamConfigWindow( int mode = 0 ) = 0;
  51. /// 获取相机最大分辨率
  52. virtual bool getMaxSize( int &w, int &h ) = 0;
  53. /// 设置相机分辨率
  54. virtual bool setResolution( int w, int h ) = 0;
  55. ///设置接收图像数据回调函数
  56. virtual void setReceCallBack(IBaseCamCommon::receImgCallBack callBack,long long userParam ) = 0;
  57. ///设置接收Log数据回调函数
  58. virtual void setReceLogCallBack(IBaseCamCommon::receLogCallBack callBack, long long userParam) = 0;//设置接收数据回调函数
  59. /// 软件触发采图
  60. virtual void softTriggerCap() = 0;
  61. };