重新提交双张处理

This commit is contained in:
gb 2022-07-23 19:08:18 +08:00
parent 0aa35e86e1
commit 713bbaa38b
8 changed files with 31 additions and 24 deletions

View File

@ -16,10 +16,10 @@ g_color_mode[] =
},
g_multi_out[] =
{
{OPTION_VALUE_DLSC_CS_HD_HB, MULTI_OUT_ALL},
{OPTION_VALUE_DLSC_CS_HD, MULTI_COLOR_AND_GRAY},
{OPTION_VALUE_DLSC_CS_HB, MULTI_COLOR_AND_BW},
{OPTION_VALUE_DLSC_HD_HB, MULTI_GRAY_AND_BW}
{OPTION_VALUE_DLSCLX_CS_HD_HB, MULTI_OUT_ALL},
{OPTION_VALUE_DLSCLX_CS_HD, MULTI_COLOR_AND_GRAY},
{OPTION_VALUE_DLSCLX_CS_HB, MULTI_COLOR_AND_BW},
{OPTION_VALUE_DLSCLX_HD_HB, MULTI_GRAY_AND_BW}
},
g_rid_color[] =
{
@ -427,9 +427,9 @@ int double_paper_flag_from_option_value(std::string& opt_val, bool* exact)
if (exact)
*exact = true;
if (opt_val == OPTION_VALUE_SZTPCL_BCTXBJXSM)
if (opt_val == OPTION_VALUE_SZTPCL_SCTXBJXSM)
return DOUBLE_PAPER_CONTINUE | DOUBLE_PAPER_SAVE_IMG;
else if (opt_val == OPTION_VALUE_SZTPCL_BCTXBTZSM)
else if (opt_val == OPTION_VALUE_SZTPCL_SCTXBTZSM)
return DOUBLE_PAPER_SAVE_IMG;
else if (opt_val == OPTION_VALUE_SZTPCL_DQTXBJXSM)
return DOUBLE_PAPER_CONTINUE;
@ -446,12 +446,12 @@ std::string double_paper_flag_to_option_value(int flag)
if (is_continue_when_double_paper(flag))
{
if (is_save_img_when_double_paper(flag))
return OPTION_VALUE_SZTPCL_BCTXBJXSM;
return OPTION_VALUE_SZTPCL_SCTXBJXSM;
else
return OPTION_VALUE_SZTPCL_DQTXBJXSM;
}
else if (is_save_img_when_double_paper(flag))
return OPTION_VALUE_SZTPCL_BCTXBTZSM;
return OPTION_VALUE_SZTPCL_SCTXBTZSM;
else
return OPTION_VALUE_SZTPCL_DQTXBTZSM;
}

View File

@ -91,8 +91,9 @@ hg_scanner::hg_scanner(ScannerSerial serial
, bright_(128), contrast_(4), gamma_(1.0f), threshold_(40), anti_noise_(8), margin_(5)
, fractate_level_(50), ui_ev_cb_(ui_default_callback), scan_life_(NULL)
, notify_setting_result_(false), user_cancel_(false), cb_mem_(true), test_1_paper_(false)
, setting_count_(0),img_type_(""), online_(false),is_quality_(-1),is_color_fill(false),is_multiout(false),save_multiout(OPTION_VALUE_DLSC_CS_HD_HB)
, final_img_index_(0), custom_area_(false),save_sizecheck(false), bw_threshold_(128), custom_gamma_(false), double_paper_handle_(0)
, setting_count_(0),img_type_(""), online_(false),is_quality_(-1),is_color_fill(false),is_multiout(false),save_multiout(OPTION_VALUE_DLSCLX_CS_HD_HB)
, final_img_index_(0), custom_area_(false),save_sizecheck(false), bw_threshold_(128), custom_gamma_(false)
, double_paper_handle_(0), keep_watermark_(false)
{
final_path_ = hg_log::ini_get("paths", "final_img");
if(final_path_.empty())
@ -1592,6 +1593,12 @@ int hg_scanner::setting_color_fill(int sn, void*data)
is_color_fill = *((bool *)data);
return SCANNER_ERR_OK;
}
int hg_scanner::setting_keep_watermark(int sn, void* data)
{
keep_watermark_ = *(bool*)data;
return SCANNER_ERR_OK;
}
int hg_scanner::setting_black_white_threshold(int sn, void* data)
{
bw_threshold_ = (unsigned char)(*(SANE_Int*)data);
@ -2721,7 +2728,7 @@ int hg_scanner::clear_roller_num(void)
}
int hg_scanner::get_history_count(void)
{
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
return -2;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -148,6 +148,7 @@ protected:
int setting_custom_area_bottom(int sn, void* data);
int setting_img_quality(int sn, void*data);
int setting_color_fill(int sn, void*data);
int setting_keep_watermark(int sn, void* data);
int setting_black_white_threshold(int sn, void* data);
int setting_feedmode(int sn, void* data);
//int get_feedmode(int sn, void* data);
@ -260,7 +261,8 @@ protected:
////////////////////////////////////////////////////////////////
// 2022-07-23 新增双张之后留图继续扫描
int double_paper_handle_;
int double_paper_handle_; // 汉王要求出现双张的时候可保留
bool keep_watermark_; // 汉王要求图像处理过程中保留水印 - 是否与背景移除、背景填充相关???
public:
void set_ui_callback(sane_callback cb, bool enable_async_io);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -67,9 +67,8 @@ protected:
virtual int on_skew_check_changed(bool& check) override;
virtual int on_skew_check_level_changed(int& check) override;
virtual int on_get_feedmode(int &feedmode);//获取分纸强度
virtual int on_set_feedmode(int feedmode);//设置分纸强度
virtual int on_get_feedmode(int& feedmode) override;//获取分纸强度
virtual int on_set_feedmode(int feedmode) override;//设置分纸强度
virtual void on_device_reconnected(void) override;
virtual int on_scanner_closing(bool force) override;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long