调整尺寸大小
This commit is contained in:
parent
2fe8fc4d51
commit
e7db4bdf16
|
@ -23,15 +23,22 @@ namespace Device {
|
||||||
papersize.insert({ B4,SIZE{250,353} });
|
papersize.insert({ B4,SIZE{250,353} });
|
||||||
papersize.insert({ B5,SIZE{176,250} });
|
papersize.insert({ B5,SIZE{176,250} });
|
||||||
papersize.insert({ B6,SIZE{125,176} });
|
papersize.insert({ B6,SIZE{125,176} });
|
||||||
#ifdef G400
|
if(pid_ == 0x400)
|
||||||
papersize.insert({ MaxSize,SIZE{297,420 * 1.5} });
|
papersize.insert({ MaxSize,SIZE{297,(long)(420 * 1.5)} });
|
||||||
#else
|
else if(pid_ == 0x300)
|
||||||
|
papersize.insert({ MaxSize,SIZE{210,297 * 2} });
|
||||||
|
else
|
||||||
papersize.insert({ MaxSize,SIZE{297,420 * 2} });
|
papersize.insert({ MaxSize,SIZE{297,420 * 2} });
|
||||||
#endif
|
|
||||||
papersize.insert({ USStatement,SIZE{297,long(420 * 1.5)} });
|
|
||||||
|
if(pid_ == 0x300)
|
||||||
|
papersize.insert({ USStatement,SIZE{210,(long)(297 * 1.5)} });
|
||||||
|
else
|
||||||
|
papersize.insert({ USStatement,SIZE{297,(long)(420 * 1.5)} });
|
||||||
|
|
||||||
papersize.insert({ USLetter,SIZE{216,279} });
|
papersize.insert({ USLetter,SIZE{216,279} });
|
||||||
papersize.insert({ USLegal,SIZE{216,356} });
|
papersize.insert({ USLegal,SIZE{216,356} });
|
||||||
papersize.insert({ USLedger,SIZE{279,432} });
|
papersize.insert({ USLedger,SIZE{216,559} });
|
||||||
papersize.insert({ None,SIZE{297,420} });
|
papersize.insert({ None,SIZE{297,420} });
|
||||||
papersize.insert({ K8,SIZE{270,390} });
|
papersize.insert({ K8,SIZE{270,390} });
|
||||||
papersize.insert({ K16,SIZE{190,270} });
|
papersize.insert({ K16,SIZE{190,270} });
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace Device {
|
||||||
class PaperSize
|
class PaperSize
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PaperSize();
|
PaperSize(int pid);
|
||||||
~PaperSize();
|
~PaperSize();
|
||||||
private:
|
private:
|
||||||
void InitPaperMap();
|
void InitPaperMap();
|
||||||
|
@ -40,6 +40,8 @@ namespace Device {
|
||||||
std::map<TwSS, SIZE> dpiDct_100;
|
std::map<TwSS, SIZE> dpiDct_100;
|
||||||
std::map<TwSS, SIZE> dpiDct_400;
|
std::map<TwSS, SIZE> dpiDct_400;
|
||||||
std::map<TwSS, SIZE> dpiDct_300;
|
std::map<TwSS, SIZE> dpiDct_300;
|
||||||
|
|
||||||
|
int pid_;
|
||||||
public:
|
public:
|
||||||
SIZE GetPaperSize(DWORD paperType, float dpi, int orentation);
|
SIZE GetPaperSize(DWORD paperType, float dpi, int orentation);
|
||||||
};
|
};
|
||||||
|
|
|
@ -572,7 +572,7 @@ void hg_scanner_200::image_process(std::shared_ptr<std::vector<char>>& buffer)
|
||||||
HG_VLOG_MINI_1(HG_LOG_LEVEL_DEBUG_INFO,"param.dpi :%d\r\n",param.dpi);
|
HG_VLOG_MINI_1(HG_LOG_LEVEL_DEBUG_INFO,"param.dpi :%d\r\n",param.dpi);
|
||||||
|
|
||||||
|
|
||||||
handle = hg_imgproc::init(&img_conf_,¶m);
|
handle = hg_imgproc::init(&img_conf_,¶m,pid_);
|
||||||
hg_imgproc::load_buffer(handle, buffer);
|
hg_imgproc::load_buffer(handle, buffer);
|
||||||
hg_imgproc::decode(handle,pid_);
|
hg_imgproc::decode(handle,pid_);
|
||||||
|
|
||||||
|
|
|
@ -636,7 +636,7 @@ void hg_scanner_239::image_process(std::shared_ptr<std::vector<char>>& buff)
|
||||||
// printf("param.double_side :%d\r\n",param.double_side);
|
// printf("param.double_side :%d\r\n",param.double_side);
|
||||||
// printf("param.dpi :%d\r\n",param.dpi);
|
// printf("param.dpi :%d\r\n",param.dpi);
|
||||||
|
|
||||||
handle = hg_imgproc::init(&img_conf_,¶m);
|
handle = hg_imgproc::init(&img_conf_,¶m,pid_);
|
||||||
err = hg_imgproc::load_buffer(handle, buff);
|
err = hg_imgproc::load_buffer(handle, buff);
|
||||||
err = hg_imgproc::decode(handle,pid_);
|
err = hg_imgproc::decode(handle,pid_);
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,7 @@ enum hg_239_setting_item
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
hg_scanner_300::hg_scanner_300(const char* dev_name,int pid, usb_io* io) : hg_scanner(G100Serial, dev_name, io),pid_(pid)
|
hg_scanner_300::hg_scanner_300(const char* dev_name,int pid, usb_io* io) : hg_scanner(G100Serial, dev_name, io),pid_(pid),papersize(pid)
|
||||||
{
|
{
|
||||||
string fw = get_firmware_version();
|
string fw = get_firmware_version();
|
||||||
|
|
||||||
|
@ -527,7 +527,7 @@ void hg_scanner_300::image_process(std::shared_ptr<std::vector<char>>& buffer)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
handle = hg_imgproc::init(&img_conf_,¶m);
|
handle = hg_imgproc::init(&img_conf_,¶m,pid_);
|
||||||
hg_imgproc::load_buffer(handle, buffer);
|
hg_imgproc::load_buffer(handle, buffer);
|
||||||
hg_imgproc::decode(handle,pid_);
|
hg_imgproc::decode(handle,pid_);
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,7 @@ enum hg_239_setting_item
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
hg_scanner_400::hg_scanner_400(const char* dev_name,int pid, usb_io* io) : hg_scanner(G100Serial, dev_name, io),pid_(pid)
|
hg_scanner_400::hg_scanner_400(const char* dev_name,int pid, usb_io* io) : hg_scanner(G100Serial, dev_name, io),pid_(pid),papersize(pid)
|
||||||
{
|
{
|
||||||
string fw = get_firmware_version();
|
string fw = get_firmware_version();
|
||||||
|
|
||||||
|
@ -528,7 +528,7 @@ void hg_scanner_400::image_process(std::shared_ptr<std::vector<char>>& buffer)
|
||||||
HG_VLOG_MINI_1(HG_LOG_LEVEL_DEBUG_INFO,"param.dpi :%d\r\n",param.dpi);
|
HG_VLOG_MINI_1(HG_LOG_LEVEL_DEBUG_INFO,"param.dpi :%d\r\n",param.dpi);
|
||||||
|
|
||||||
|
|
||||||
handle = hg_imgproc::init(&img_conf_,¶m);
|
handle = hg_imgproc::init(&img_conf_,¶m,pid_);
|
||||||
hg_imgproc::load_buffer(handle, buffer);
|
hg_imgproc::load_buffer(handle, buffer);
|
||||||
hg_imgproc::decode(handle,pid_);
|
hg_imgproc::decode(handle,pid_);
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ namespace hg_imgproc
|
||||||
std::shared_ptr<std::string> raw_data_;
|
std::shared_ptr<std::string> raw_data_;
|
||||||
std::shared_ptr<vector<char>> buffer_;
|
std::shared_ptr<vector<char>> buffer_;
|
||||||
std::vector<cv::Mat> mats_;
|
std::vector<cv::Mat> mats_;
|
||||||
|
int pid_;
|
||||||
Device::PaperSize papersize_;
|
Device::PaperSize papersize_;
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,7 +67,7 @@ namespace hg_imgproc
|
||||||
|
|
||||||
// construction
|
// construction
|
||||||
public:
|
public:
|
||||||
imgproc(LPSCANCONF img_param,LPIMGPRCPARAM param) : img_conf_(*img_param),param_(*param)
|
imgproc(LPSCANCONF img_param,LPIMGPRCPARAM param,int pid) : img_conf_(*img_param),param_(*param),pid_(pid),papersize_(pid_)
|
||||||
{
|
{
|
||||||
my_path_ = hg_log::pe_path();
|
my_path_ = hg_log::pe_path();
|
||||||
}
|
}
|
||||||
|
@ -755,9 +756,9 @@ namespace hg_imgproc
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// api ...
|
// api ...
|
||||||
HIMGPRC init(LPSCANCONF parameter,LPIMGPRCPARAM param)
|
HIMGPRC init(LPSCANCONF parameter,LPIMGPRCPARAM param,int pid)
|
||||||
{
|
{
|
||||||
imgproc* obj = new imgproc(parameter,param);
|
imgproc* obj = new imgproc(parameter,param,pid);
|
||||||
|
|
||||||
return (HIMGPRC)obj;
|
return (HIMGPRC)obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,7 +158,7 @@ namespace hg_imgproc
|
||||||
}IMGHEAD, *LPIMGHEAD;
|
}IMGHEAD, *LPIMGHEAD;
|
||||||
|
|
||||||
|
|
||||||
HIMGPRC init(LPSCANCONF parameter,LPIMGPRCPARAM param);
|
HIMGPRC init(LPSCANCONF parameter,LPIMGPRCPARAM param,int pid);
|
||||||
int load_buffer(HIMGPRC himg,std::shared_ptr<std::vector<char>> buff);
|
int load_buffer(HIMGPRC himg,std::shared_ptr<std::vector<char>> buff);
|
||||||
int load_file(HIMGPRC himg, const char* path_file);
|
int load_file(HIMGPRC himg, const char* path_file);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue