From 98ee790bacdba4b85b82d029da1e8c37e2bde4c1 Mon Sep 17 00:00:00 2001 From: lovelyyoung <1002639516@qq.com> Date: Tue, 7 Jul 2020 11:19:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A9=B1=E5=8A=A8=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E9=A6=96=E9=80=89=E9=A1=B9=E4=BA=AE=E5=BA=A6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- huagao/GscanJsonConfig.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/huagao/GscanJsonConfig.cpp b/huagao/GscanJsonConfig.cpp index 8841d2cb..ad8b76d0 100644 --- a/huagao/GscanJsonConfig.cpp +++ b/huagao/GscanJsonConfig.cpp @@ -400,10 +400,10 @@ std::vector GscanJsonConfig::parseJsonFromString(const std::string str cfp.brightness = f_value; itmAutoCrnt.Get(i, b_value); cfp.is_autocontrast = b_value ? 1 : 0; - itmContrast.Get(i, i_value); - cfp.contrast = i_value; - itmGamma.Get(i, i_value); - cfp.gamma = i_value; + itmContrast.Get(i, f_value); + cfp.contrast = f_value; + itmGamma.Get(i, f_value); + cfp.gamma = f_value; itmFilter.Get(i, i_value); cfp.filter = i_value; @@ -430,8 +430,8 @@ std::vector GscanJsonConfig::parseJsonFromString(const std::string str cfp.hardwarecaps.en_stapledetect = b_value ? 1 : 0; itmScanCount.Get(i, i_value); cfp.scannum = i_value; - itmDocOrientation.Get(i, i_value); - cfp.imageRotateDegree = i_value; + itmDocOrientation.Get(i, f_value); + cfp.imageRotateDegree = (int)f_value; itmAutotext.Get(i, b_value); cfp.is_autotext = b_value?1:0; itmBackRotate.Get(i, b_value); @@ -459,6 +459,7 @@ std::vector GscanJsonConfig::parseJsonFromString(const std::string str GScanCap cfp; int index; bool bvalue; + float fvalue; std::string svalue; root["Config"].Get(PIXTYPE, index); @@ -486,8 +487,8 @@ std::vector GscanJsonConfig::parseJsonFromString(const std::string str root["Config"].Get(SWITCHFRONTBACK, bvalue); cfp.is_switchfrontback = bvalue?1:0; - root["Config"].Get(BRIGHTNESS, index); - cfp.brightness = (float)index; + root["Config"].Get(BRIGHTNESS, fvalue); + cfp.brightness = (float)fvalue; root["Config"].Get(AUTOCONTRAST, bvalue); cfp.is_autocontrast = bvalue?1:0; root["Config"].Get(CONTRAST, index);