diff --git a/build.sh b/build.sh index 0c31efa..e288e69 100755 --- a/build.sh +++ b/build.sh @@ -4,9 +4,9 @@ sys=${sys%% *} echo "------------------------------change cmake path:$1--------------------" if [ "$sys" == "UnionTech" ];then - sed -i "s/kylin/$1/g" hgdriver/wrapper/CMakeLists.txt + sed -i "s/kylin/uos/g" hgdriver/wrapper/CMakeLists.txt elif [ "$sys" == "kylin" ];then - sed -i "s/uos/$1/g" hgdriver/wrapper/CMakeLists.txt + sed -i "s/uos/kylin/g" hgdriver/wrapper/CMakeLists.txt fi cd ../ diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index 32376ca..5ea8d95 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -1378,7 +1378,7 @@ int hg_scanner::setting_custom_area_left(void* data) { SANE_Fixed* v = (SANE_Fixed*)data; - custom_area_lt_x_ = SANE_UNFIX(*v); + custom_area_lt_x_ = *((double*)data); return HG_ERR_OK; } @@ -1386,7 +1386,7 @@ int hg_scanner::setting_custom_area_top(void* data) { SANE_Fixed* v = (SANE_Fixed*)data; - custom_area_lt_y_ = SANE_UNFIX(*v); + custom_area_lt_y_ = *((double*)data); return HG_ERR_OK; } @@ -1394,7 +1394,7 @@ int hg_scanner::setting_custom_area_right(void* data) { SANE_Fixed* v = (SANE_Fixed*)data; - custom_area_br_x_ = SANE_UNFIX(*v); + custom_area_br_x_ = *((double*)data); return HG_ERR_OK; } @@ -1402,7 +1402,8 @@ int hg_scanner::setting_custom_area_bottom(void* data) { SANE_Fixed* v = (SANE_Fixed*)data; - custom_area_br_y_ = SANE_UNFIX(*v); + custom_area_br_y_ = *((double*)data); + return HG_ERR_OK; } diff --git a/hgdriver/hgdev/hg_scanner_200.cpp b/hgdriver/hgdev/hg_scanner_200.cpp index b6f1a26..fa89b5b 100644 --- a/hgdriver/hgdev/hg_scanner_200.cpp +++ b/hgdriver/hgdev/hg_scanner_200.cpp @@ -413,14 +413,15 @@ int hg_scanner_200::start(void) } printf_devconfig(); - ret = get_scan_is_sleep(); - if (ret == HG_ERR_DEVICE_SLEEPING) - { - status_ = ret; - notify_ui_working_status(STATU_DESC_HG_ERR_DEVICE_SLEEPING, SANE_EVENT_SCAN_FINISHED, status_); - HG_VLOG_MINI_1(HG_LOG_LEVEL_WARNING, "device start status is(%s)\n", STATU_DESC_HG_ERR_DEVICE_SLEEPING); - return ret; - } + //writedown_device_configuration(true); + // ret = get_scan_is_sleep(); + // if (ret == HG_ERR_DEVICE_SLEEPING) + // { + // status_ = ret; + // notify_ui_working_status(STATU_DESC_HG_ERR_DEVICE_SLEEPING, SANE_EVENT_SCAN_FINISHED, status_); + // HG_VLOG_MINI_1(HG_LOG_LEVEL_WARNING, "device start status is(%s)\n", STATU_DESC_HG_ERR_DEVICE_SLEEPING); + // return ret; + // } ret = get_scanner_paperon(); if (ret == HG_ERR_DEVICE_NO_PAPER) { @@ -621,7 +622,7 @@ void hg_scanner_200::image_process(std::shared_ptr>& buffer) if (img_conf_.cropRect.enable && !img_conf_.is_autocrop) { hg_imgproc::croprect(handle); - //HG_LOGHG_LOG_LEVEL_DEBUG_INFO,"手动裁图开启\r\n"); + //printf("手动裁图开启\r\n"); } if (img_conf_.filter != ColorFilter::FILTER_NONE && (img_conf_.pixtype == COLOR_MODE_BLACK_WHITE || img_conf_.pixtype == COLOR_MODE_256_GRAY)) { @@ -650,7 +651,7 @@ void hg_scanner_200::image_process(std::shared_ptr>& buffer) if ((img_conf_.is_autotext != TEXT_DIRECTION_0 || img_conf_.is_backrotate180) && (img_conf_.is_autotext != TEXT_DIRECTION_AUTO)) { hg_imgproc::orentation(handle); - printf("img_conf_ =%d 自动旋转开启\r\n",img_conf_.is_autotext); + //printf("img_conf_ =%d 自动旋转开启\r\n",img_conf_.is_autotext); //HG_LOGHG_LOG_LEVEL_DEBUG_INFO,"自动旋转开启\r\n"); } if (img_conf_.removeMorr) @@ -1017,7 +1018,6 @@ void hg_scanner_200::writedown_image_configuration(void) ic.detachnoise.is_detachnoise = image_prc_param_.bits.noise_optimize; ic.detachnoise.detachnoise = noise_range_; - printf("image_prc_param_.bits.text_direction = %d\r\n",image_prc_param_.bits.text_direction); ic.is_autotext = image_prc_param_.bits.text_direction == TEXT_DIRECTION_AUTO ? 1 :image_prc_param_.bits.text_direction; @@ -1028,11 +1028,17 @@ void hg_scanner_200::writedown_image_configuration(void) ic.errorExtention = image_prc_param_.bits.error_extention ;//暂无参数 ic.textureRemove = image_prc_param_.bits.remove_txtture;//暂无参数 ic.splitImage = image_prc_param_.bits.split; - ic.cropRect.enable = 0;//暂无参数 - ic.cropRect.height = 0;//暂无参数 - ic.cropRect.width = 0;//暂无参数 - ic.cropRect.x = 0;//暂无参数 - ic.cropRect.y = 0;//暂无参数 + + //custom_area_br_x_ *ic.resolution_dst /25.4; + //custom_area_br_y_ *ic.resolution_dst /25.4; + + ic.cropRect.enable = custom_area_; + + ic.cropRect.height = custom_area_br_y_ *ic.resolution_dst /25.4; + ic.cropRect.width = custom_area_br_x_ *ic.resolution_dst /25.4; + ic.cropRect.x = custom_area_lt_x_ *ic.resolution_dst /25.4; + ic.cropRect.y = custom_area_lt_y_ *ic.resolution_dst /25.4; + ic.multiOutput = MultiOutput::Unused; //暂无参数 ic.normalCrop = image_prc_param_.bits.dark_sample; ic.dogeardistabce = fractate_level_; @@ -1102,6 +1108,12 @@ void hg_scanner_200::writedown_image_configuration(void) HG_VLOG_MINI_1(HG_LOG_LEVEL_DEBUG_INFO,"\n ic.fillhole.is_fillhole=%d\r\n ", ic.fillhole.is_fillhole); HG_VLOG_MINI_1(HG_LOG_LEVEL_DEBUG_INFO,"\n ic.ic.fillhole.fillholeratio=%f\r\n ", ic.fillhole.fillholeratio); HG_VLOG_MINI_1(HG_LOG_LEVEL_DEBUG_INFO,"\n ic.fadeback=%d\r\n ",ic.fadeback); + HG_VLOG_MINI_1(HG_LOG_LEVEL_DEBUG_INFO,"\n ic.cropRect.enable=%d\r\n ",ic.cropRect.enable); + HG_VLOG_MINI_1(HG_LOG_LEVEL_DEBUG_INFO,"\n ic.cropRect.height=%d\r\n ",ic.cropRect.height); + HG_VLOG_MINI_1(HG_LOG_LEVEL_DEBUG_INFO,"\n ic.cropRect.width=%d\r\n ",ic.cropRect.width); + HG_VLOG_MINI_1(HG_LOG_LEVEL_DEBUG_INFO,"\n ic.cropRect.x=%d\r\n ",ic.cropRect.x); + HG_VLOG_MINI_1(HG_LOG_LEVEL_DEBUG_INFO,"\n ic.cropRect.y=%d\r\n ",ic.cropRect.y); + } void hg_scanner_200::printf_devconfig(HGSCANCONF_DSP *d) {