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