D8 300支持600 dpi

This commit is contained in:
13038267101 2023-02-13 16:38:05 +08:00
parent 6c195264db
commit f0ae35c43e
5 changed files with 68 additions and 61 deletions

View File

@ -157,6 +157,7 @@ hg_scanner::hg_scanner(ScannerSerial serial, const char* dev_name, usb_io* io,in
, size_check(false), save_sleeptime_type_(false), is_kernelsnap_devsislock(false), is_checksum_strat_scan(false), is_cis_image(false) , size_check(false), save_sleeptime_type_(false), is_kernelsnap_devsislock(false), is_checksum_strat_scan(false), is_cis_image(false)
, is_dpi_color_check(false),save_dpi_color_check_val(0.0f), is_auto_falt(false),HGVersion_mgr_(NULL), HGVersion_Init_(NULL) , is_dpi_color_check(false),save_dpi_color_check_val(0.0f), is_auto_falt(false),HGVersion_mgr_(NULL), HGVersion_Init_(NULL)
, HGVersion_Islock_(NULL), HGVersion_Postlog_(NULL), HGVersion_Free_(NULL), Dynamicopen_HGVersion_pHandle_(NULL),pid_(pid), fetching_id_(-1) , HGVersion_Islock_(NULL), HGVersion_Postlog_(NULL), HGVersion_Free_(NULL), Dynamicopen_HGVersion_pHandle_(NULL),pid_(pid), fetching_id_(-1)
, is_kernelsnap3288_230210_(false)
{ {
#if !defined(_WIN32) && !defined(_WIN64) &&defined(x86_64) #if !defined(_WIN32) && !defined(_WIN64) &&defined(x86_64)
isx86_Advan_ = false; isx86_Advan_ = false;
@ -2351,7 +2352,7 @@ hg_imgproc::IMGPRCPARAM hg_scanner::get_image_process_object(int model)
param.color_mode = image_prc_param_.bits.color_mode == COLOR_MODE_AUTO_MATCH ? 2 : image_prc_param_.bits.color_mode; param.color_mode = image_prc_param_.bits.color_mode == COLOR_MODE_AUTO_MATCH ? 2 : image_prc_param_.bits.color_mode;
param.double_side = img_conf_.is_duplex; param.double_side = img_conf_.is_duplex;
param.dpi = img_conf_.resolution_dst; param.dpi = img_conf_.resolution_dst;
param.cis_image = is_cis_image; param.cis_image = is_cis_image || (img_conf_.papertype == TwSS::MaxSize && pid_ == 0x0300 && is_kernelsnap3288_230210_);
//img_conf_.brightness = (float)bright_; //img_conf_.brightness = (float)bright_;
//img_conf_.contrast = (float)contrast_; //img_conf_.contrast = (float)contrast_;
@ -3880,13 +3881,18 @@ void hg_scanner::image_process(std::shared_ptr<tiny_buffer>& buffer, uint32_t id
if (pid_ != 0x239 && pid_ != 0x439) if (pid_ != 0x239 && pid_ != 0x439)
{ {
float dpi3288 = (img_conf_.resolution_dst >= 300 && is_kernelsnap3288_221106_) ? 300 : 200; float dpi3288 = 0.0;
if (is_kernelsnap3288_221106_ && pid_==0x300)
dpi3288 = (img_conf_.resolution_dst >= 300) ? 300 : 200;
else if (is_kernelsnap3288_230210_ && pid_==0x300)
dpi3288 = (img_conf_.resolution_dst == 600) ? 600 : (img_conf_.resolution_dst < 600 && img_conf_.resolution_dst >= 300) ? 300 : 200;
else
dpi3288 = 200;
ret = hg_imgproc::auto_crop(ImagePrc_pHandle_, dpi3288); ret = hg_imgproc::auto_crop(ImagePrc_pHandle_, dpi3288);
(this->*dump_img_)(ImagePrc_pHandle_, "auto_crop"); (this->*dump_img_)(ImagePrc_pHandle_, "auto_crop");
} }
if ((img_conf_.is_autodiscradblank_normal || img_conf_.is_autodiscradblank_vince) && (pid_ != 0x239 && pid_ != 0x439)) if ((img_conf_.is_autodiscradblank_normal || img_conf_.is_autodiscradblank_vince) && (pid_ != 0x239 && pid_ != 0x439))
{ {
ret = hg_imgproc::discardBlank(ImagePrc_pHandle_); ret = hg_imgproc::discardBlank(ImagePrc_pHandle_);
@ -3899,10 +3905,14 @@ void hg_scanner::image_process(std::shared_ptr<tiny_buffer>& buffer, uint32_t id
(this->*dump_img_)(ImagePrc_pHandle_, "fadeback"); (this->*dump_img_)(ImagePrc_pHandle_, "fadeback");
} }
if (((img_conf_.resolution_dst != img_conf_.resolution_native) && (pid_ == 0x300 || pid_ == 0x0400) && !is_kernelsnap3288_221106_) if ( (((img_conf_.resolution_dst != img_conf_.resolution_native) && (pid_ == 0x300 || pid_ == 0x0400))
|| (is_kernelsnap3288_221106_ && (img_conf_.resolution_dst != 200 && img_conf_.resolution_dst != 300))) && !is_kernelsnap3288_221106_ && !is_kernelsnap3288_230210_ )
|| (pid_ == 0x300 && is_kernelsnap3288_221106_ && img_conf_.resolution_dst != 200 && img_conf_.resolution_dst != 300)
|| (pid_ == 0x300 && is_kernelsnap3288_230210_ && img_conf_.resolution_dst != 200 && img_conf_.resolution_dst != 300 && img_conf_.resolution_dst != 600))
{ {
float dpi3288 = (img_conf_.resolution_dst > 300 && is_kernelsnap3288_221106_) ? 300 : 200; float dpi3288 = 0.0;
dpi3288 = (img_conf_.resolution_dst >= 300 && (is_kernelsnap3288_221106_ || is_kernelsnap3288_230210_)) ? 300 : 200;
hg_imgproc::resolution_change(ImagePrc_pHandle_, dpi3288); hg_imgproc::resolution_change(ImagePrc_pHandle_, dpi3288);
(this->*dump_img_)(ImagePrc_pHandle_, "resolution_change"); (this->*dump_img_)(ImagePrc_pHandle_, "resolution_change");

View File

@ -352,7 +352,8 @@ protected:
bool is_kernelsnap_220830_; //此版本支持待纸扫描,手动睡眠唤醒,分纸强度 bool is_kernelsnap_220830_; //此版本支持待纸扫描,手动睡眠唤醒,分纸强度
bool is_kernelsnap_211209_; //获取固件版本号是否是新旧版本 bool is_kernelsnap_211209_; //获取固件版本号是否是新旧版本
bool is_kernelsnap_221027_; //此版本一下不支持拆分模式 pc实现 bool is_kernelsnap_221027_; //此版本一下不支持拆分模式 pc实现
bool is_kernelsnap3288_221106_; //G300 3288 在221106版本支持真实dpi bool is_kernelsnap3288_221106_; //G300 3288 在221106版本支持真实300dpi
bool is_kernelsnap3288_230210_; //G300 3288 在230210版本支持真实600dpi
bool is_kernelsnap_220430_; //待纸扫描 bool is_kernelsnap_220430_; //待纸扫描
bool is_kernelsnap_devsislock;//支持设备锁的版本 bool is_kernelsnap_devsislock;//支持设备锁的版本
SCANCONF img_conf_; //此参数外部不做任何改变请在writedown_image_configuration做修改 SCANCONF img_conf_; //此参数外部不做任何改变请在writedown_image_configuration做修改

View File

@ -1257,7 +1257,7 @@ int hg_scanner_239::start(void)
//211220固件版本不支持返回 //211220固件版本不支持返回
ret = get_scan_is_sleep(val); ret = get_scan_is_sleep(val);
if (!val) if (!val && ret == SCANNER_ERR_OK)
{ {
status_ = SCANNER_ERR_DEVICE_SLEEPING; status_ = SCANNER_ERR_DEVICE_SLEEPING;
VLOG_MINI_1(LOG_LEVEL_WARNING, "device start status is(%s)\n", hg_log::lang_load(ID_STATU_DESC_SCANNER_ERR_DEVICE_SLEEPING)); VLOG_MINI_1(LOG_LEVEL_WARNING, "device start status is(%s)\n", hg_log::lang_load(ID_STATU_DESC_SCANNER_ERR_DEVICE_SLEEPING));
@ -1266,9 +1266,13 @@ int hg_scanner_239::start(void)
//notify_ui_working_status(STATU_DESC_SCANNER_ERR_DEVICE_NOTIFY_SLEEP, SANE_EVENT_ERROR, status_); //notify_ui_working_status(STATU_DESC_SCANNER_ERR_DEVICE_NOTIFY_SLEEP, SANE_EVENT_ERROR, status_);
return status_; return status_;
} }
if (ret != SCANNER_ERR_OK)
{
return ret;
}
bool type = true; bool type = true;
ret = get_scan_mode(type); ret = get_scan_mode(type);
if (!type) if (!type && ret == SCANNER_ERR_OK)
{ {
status_ = SCANNER_ERR_DEVICE_COUNT_MODE; status_ = SCANNER_ERR_DEVICE_COUNT_MODE;
return status_; return status_;

File diff suppressed because one or more lines are too long

View File

@ -809,33 +809,12 @@ namespace hg_imgproc
CImageApplyResize resize(resizeType,cvSize,ratio,ratio); CImageApplyResize resize(resizeType,cvSize,ratio,ratio);
resize.apply(mats,img_conf_.is_duplex); resize.apply(mats,img_conf_.is_duplex);
if (img_conf_.resolution_dst > 300 && img_conf_.sharpen == CImageApplyFilter::FilterMode::None && dpi3288 ==200)
{
if (img_conf_.resolution_dst <= 300)
sharpenType = CImageApplyFilter::FilterMode::Sharpen;
else if (img_conf_.resolution_dst > 300 && img_conf_.resolution_dst <= 600)
sharpenType = CImageApplyFilter::FilterMode::Sharpen_More;
CImageApplyFilter Filte(sharpenType);
for (size_t i = 0; i < mats.size(); ++i)
{
Filte.apply(mats[i], img_conf_.is_duplex);
mats_.push_back(mats[i]);
}
}
else
{
if(!mats.empty())
mats_ = mats;
}
if (mats_.empty()) if (mats.empty())
{ {
return SCANNER_ERR_NO_DATA; return SCANNER_ERR_NO_DATA;
} }
mats_ = mats;
return SCANNER_ERR_OK; return SCANNER_ERR_OK;
} }
int croprect() int croprect()