hspscanner_impl.h 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #ifndef LIBFRAMEWORK_HSPS_IMPL_H
  2. #define LIBFRAMEWORK_HSPS_IMPL_H
  3. #include "HSPScannerClass.h"
  4. class HSPSClassImpl : public CHSPSClass
  5. {
  6. public:
  7. HSPSClassImpl();
  8. ~HSPSClassImpl();
  9. //DeviceBaseClass
  10. ErrorCodeEnum GetDevCategory(DevCategoryInfo &devCategory);
  11. ErrorCodeEnum Reset();
  12. ErrorCodeEnum DevClose();
  13. ErrorCodeEnum GetLastErr(DevErrorInfo &devErrInfo);
  14. virtual ErrorCodeEnum DevOpen()
  15. {
  16. ErrorCodeEnum err = Error_Succeed;
  17. return err;
  18. }
  19. //
  20. // Set param, more detail please to see ParamType and its according ParamTypeValue.
  21. //
  22. virtual ErrorCodeEnum SetParam(ParamType type, ParamTypeValue value);
  23. //
  24. // Command the device to start to preview or stop previewing.
  25. // -nValue[in] set 1 means StartPreview while 0 means StopPreview.
  26. // If the device' state had been setted before what the nValue commanded, ignore it and
  27. // return Error_Succeed.
  28. // The function returns only the specified behavior is done completely, StartPreview in special.
  29. // 更新20161117: nValue值为 1 时打开预览,确保当前打开预览过程执行结束且窗口处于显示状态才返回Error_Succeed,
  30. // nValue值为 0 时关闭预览并隐藏窗口
  31. //
  32. //
  33. virtual ErrorCodeEnum SetPreview(short nValue);
  34. //
  35. // Scan Image from device and store the image.
  36. // -pszFileName[in] Store the path and name using suffix ".jpg"
  37. // specifies that where the image will be located and what it would be named.
  38. // 拍摄照片,传入的文件名已带绝对路径,无需再进行拼接处理
  39. //
  40. virtual ErrorCodeEnum ScanImage(const char* pszFileName);
  41. //
  42. // Scan Image from device and return the image data in byte format.
  43. // -pBtImg[out] The buffer used to store the scanned image data.
  44. // 存储图片字节流的缓冲区,大小为 nBtLen 字节
  45. // -nBtLen[in,out] Indicate the max byte-type size of pBtImg could be stored
  46. // and Store the real byte-type size of pBtImg had used when returned.
  47. // when detect value of nBtLen is 0 or smaller that necessary size, please
  48. // set nBtlen with real byte-type size and return Error_TooSmallBuffer.
  49. // 如果nBtLen指定的字节数过小,那么对nBtLen赋值实际所需的大小并返回 Error_TooSmallBuffer,此操作仅允许一次
  50. // -pszFileName[in] Store the path and name where the image file should be located
  51. // while "" indicates that the image file shouldn't be stored at locate.
  52. // 文件名长度为零表示不在本地生成图片文件
  53. //
  54. //
  55. virtual ErrorCodeEnum ScanImageEx(BYTE* pBtImg, int& nBtLen, const char* pszFileName = "");
  56. //
  57. // Set position and width of preview dialog with the rate of length to width: 16:9.
  58. // -nX[in] The X coordinate of leftTop point.
  59. // -nY[in] The Y coordinate of leftTop point.
  60. // -nWidth[in] The Width of Preview Dialog .
  61. // 传入预览窗口显示的坐标,左上角的横坐标nX,左上角的纵坐标nY,以及预览窗口的宽,宽与高的比例为 16:9
  62. //
  63. virtual ErrorCodeEnum SetViewPos(int nX, int nY, int nWidth);
  64. //
  65. // Show property dialog of HSPS of LiangTian.
  66. // If there is no property dialog function, ignore it and return Error_NotImpl(更新20161117).
  67. // 更新20161117:用于打开良田高拍仪设备的设置属性页,可能用不到
  68. //
  69. virtual ErrorCodeEnum SetProperty();
  70. //
  71. // Get current status of device.
  72. //
  73. virtual ErrorCodeEnum GetDevStatus(HspsDevStatus& status);
  74. private:
  75. int m_mode;
  76. };
  77. #endif //LIBFRAMEWORK_HSPS_IMPL_H