2020-06-20 03:07:40 +00:00
|
|
|
|
#include "GscanJsonConfig.h"
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <fstream>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <sstream>
|
|
|
|
|
#include "Device/CJsonObject.hpp"
|
|
|
|
|
|
|
|
|
|
GscanJsonConfig::GscanJsonConfig()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GscanJsonConfig::~GscanJsonConfig()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GScanCap GscanJsonConfig::GetDefaultGscancapValue()
|
|
|
|
|
{
|
|
|
|
|
GScanCap gcap;
|
|
|
|
|
|
|
|
|
|
/*< basic page setting*/
|
|
|
|
|
gcap.pixtype = 2;//Ĭ<>ϲ<EFBFBD>ɫ
|
2020-12-17 09:02:33 +00:00
|
|
|
|
gcap.automaticcolor = FALSE;
|
|
|
|
|
gcap.automaticcolortype = 1;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
gcap.paperAlign = PaperAlign::Rot0;
|
|
|
|
|
gcap.papertype = 0;//TwSS::NONE
|
2020-12-10 02:01:22 +00:00
|
|
|
|
gcap.en_sizecheck = FALSE;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
gcap.is_autocrop = TRUE;//Ĭ<><C4AC><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
gcap.is_duplex = TRUE;
|
|
|
|
|
gcap.is_autodiscradblank_normal = FALSE;
|
|
|
|
|
gcap.is_autodiscradblank_vince = FALSE;
|
2020-12-09 08:02:51 +00:00
|
|
|
|
gcap.discardblank_percent = 20;
|
2020-07-11 10:43:17 +00:00
|
|
|
|
gcap.is_switchfrontback = FALSE;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
gcap.resolution_dst = 200.0f;
|
|
|
|
|
gcap.resolution_native = 200.0f;
|
|
|
|
|
|
|
|
|
|
/*< brightness setting*/
|
|
|
|
|
gcap.brightness = 0.0f;//Ĭ<><C4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0
|
|
|
|
|
gcap.contrast = 0.0f;//Ĭ<>϶Աȶ<D4B1>Ϊ0
|
|
|
|
|
gcap.threshold = 128;
|
|
|
|
|
gcap.gamma = 1.0;
|
|
|
|
|
gcap.is_autocontrast = FALSE;//Ĭ<>ϲ<EFBFBD><CFB2>Զ<EFBFBD><D4B6>Աȶ<D4B1>
|
|
|
|
|
|
|
|
|
|
/*< image proecss setting*/
|
|
|
|
|
gcap.autodescrew = TRUE;//<2F>Զ<EFBFBD><D4B6><EFBFBD>ƫ <20><><EFBFBD><EFBFBD>
|
|
|
|
|
gcap.enhance_color = EnchaceColor::Enhance_None;//Ĭ<>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB>ǿ
|
|
|
|
|
gcap.en_fold = FALSE;//Ĭ<>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD>
|
2020-11-16 10:05:04 +00:00
|
|
|
|
gcap.fillbackground = TRUE;//Ĭ<>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD>ڿ<EFBFBD>
|
2020-06-20 03:07:40 +00:00
|
|
|
|
gcap.fillhole.is_fillhole = FALSE;
|
|
|
|
|
gcap.fillhole.fillholeratio = 10;
|
2020-12-09 08:02:51 +00:00
|
|
|
|
gcap.detachnoise.detachnoise = 30;
|
|
|
|
|
gcap.detachnoise.is_detachnoise = FALSE;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
gcap.filter = 3;//<2F><>ӦFilter::None
|
|
|
|
|
gcap.multi_output_red = FALSE;
|
|
|
|
|
gcap.sharpen = SharpenBlur::Sharpen_None;
|
2020-06-23 09:31:43 +00:00
|
|
|
|
gcap.hsvcorrect = FALSE;//Ĭ<>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E2BFA8><EFBFBD><EFBFBD>
|
2020-06-20 03:07:40 +00:00
|
|
|
|
|
|
|
|
|
/*< feeder setting*/
|
|
|
|
|
gcap.hardwarecaps.en_doublefeed = TRUE;//Ĭ<>Ͽ<EFBFBD><CFBF><EFBFBD>˫<EFBFBD><CBAB>
|
|
|
|
|
gcap.hardwarecaps.en_skrewdetect = TRUE;//Ĭ<>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>
|
|
|
|
|
gcap.hardwarecaps.en_stapledetect = FALSE;//Ĭ<>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
gcap.hardwarecaps.skrewdetectlevel = 3;//Ĭ<>ϴ<EFBFBD><CFB4><EFBFBD>3<EFBFBD><33>
|
|
|
|
|
gcap.hardwarecaps.capturepixtype = 2;//<2F><>ɫģʽ
|
2020-07-11 10:43:17 +00:00
|
|
|
|
gcap.imageRotateDegree = 0.0f;//Ĭ<>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת
|
2020-06-20 03:07:40 +00:00
|
|
|
|
gcap.is_autotext = FALSE;
|
|
|
|
|
gcap.is_backrotate180 = FALSE;
|
2020-12-09 08:02:51 +00:00
|
|
|
|
gcap.AutoCrop_threshold = 40;
|
|
|
|
|
gcap.is_convex = TRUE;
|
|
|
|
|
gcap.noise = 40;
|
|
|
|
|
gcap.indent = 5;
|
2020-11-16 10:05:04 +00:00
|
|
|
|
gcap.is_dogeardetection = FALSE;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
gcap.scannum = -1;//Ĭ<><C4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8>
|
|
|
|
|
//gcap.scanrect = { 0 };
|
|
|
|
|
|
|
|
|
|
return gcap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GscanJsonConfig::SaveGscanCapConfig(const GScanCap & gcap, const std::string path)
|
|
|
|
|
{
|
|
|
|
|
neb::CJsonObject outJson;
|
|
|
|
|
|
|
|
|
|
outJson.AddEmptySubObject("Config");//header
|
|
|
|
|
outJson["Config"].Add(PIXTYPE, (int)gcap.pixtype);
|
2020-12-17 09:02:33 +00:00
|
|
|
|
outJson["Config"].Add(AUTOMATICCOLOR, (bool)gcap.automaticcolor,false);
|
|
|
|
|
outJson["Config"].Add(AUTOMATICCOLORTYPR, (int)gcap.automaticcolortype);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
outJson["Config"].Add(PAPARSIZE, (int)(gcap.papertype));
|
|
|
|
|
outJson["Config"].Add(PAPERALIGN, (int)(gcap.paperAlign));
|
2020-12-10 02:01:22 +00:00
|
|
|
|
outJson["Config"].Add(ENSIZECHECK, (bool)(gcap.en_sizecheck), false);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
outJson["Config"].Add(AUTOCROP, (bool)(gcap.is_autocrop), false);
|
|
|
|
|
outJson["Config"].Add(RESOLUTION, (int)(gcap.resolution_dst));
|
|
|
|
|
outJson["Config"].Add(DUPLEX, (bool)(gcap.is_duplex),false);
|
|
|
|
|
outJson["Config"].Add(DISCARBLANK, (bool)(gcap.is_autodiscradblank_normal), false);
|
|
|
|
|
outJson["Config"].Add(DISCARBLANKVINCE, (bool)(gcap.is_autodiscradblank_vince), false);
|
|
|
|
|
//outJson["Config"].Add(DB_AREANUM, (int)(pConfigItem->DBlank_AreaNum));
|
|
|
|
|
//outJson["Config"].Add(DB_DEVNMAX, (int)(pConfigItem->DBlank_DevnMax));
|
|
|
|
|
outJson["Config"].Add(FLOD, (bool)(gcap.en_fold), false);
|
|
|
|
|
outJson["Config"].Add(SWITCHFRONTBACK, (bool)(gcap.is_switchfrontback), false);
|
|
|
|
|
|
2020-07-11 10:43:17 +00:00
|
|
|
|
outJson["Config"].Add(BRIGHTNESS, (int)(gcap.brightness));
|
2020-06-20 03:07:40 +00:00
|
|
|
|
outJson["Config"].Add(AUTOCONTRAST, (bool)(gcap.is_autocontrast), false);
|
2020-07-11 10:43:17 +00:00
|
|
|
|
outJson["Config"].Add(CONTRAST, (int)(gcap.contrast));
|
|
|
|
|
outJson["Config"].Add(GAMMA_, (double)(gcap.gamma));
|
2020-06-20 03:07:40 +00:00
|
|
|
|
|
|
|
|
|
outJson["Config"].Add(FILTERTYPE, (int)(gcap.filter));
|
2020-07-11 10:43:17 +00:00
|
|
|
|
outJson["Config"].Add(ENHANCECOLOR,((int)gcap.enhance_color));
|
2020-06-20 03:07:40 +00:00
|
|
|
|
outJson["Config"].Add(SHARPENTYPE, (int)(gcap.sharpen));
|
|
|
|
|
outJson["Config"].Add(AUTODESCREW, (bool)(gcap.autodescrew), false);
|
|
|
|
|
outJson["Config"].Add(FILLBLACK, (bool)(gcap.fillbackground), false);
|
|
|
|
|
outJson["Config"].Add(MULTIOUTPUT, (bool)(gcap.multi_output_red), false);
|
|
|
|
|
outJson["Config"].Add(OUTHOLE, (bool)(gcap.fillhole.is_fillhole), false);
|
|
|
|
|
outJson["Config"].Add(OUTHOLERATIO, (int)(gcap.fillhole.fillholeratio));
|
2020-12-09 08:02:51 +00:00
|
|
|
|
outJson["Config"].Add(DETACHNOISE, (bool)(gcap.detachnoise.is_detachnoise), false);
|
|
|
|
|
outJson["Config"].Add(DETACHNOISEVALUE, (int)(gcap.detachnoise.detachnoise));
|
2020-07-11 10:43:17 +00:00
|
|
|
|
outJson["Config"].Add(HSVCORRECT, (bool)(gcap.hsvcorrect),false);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
|
|
|
|
|
outJson["Config"].Add(ULTRADETECT, (bool)(gcap.hardwarecaps.en_doublefeed), false);
|
|
|
|
|
outJson["Config"].Add(BINDINGDETECT, (bool)(gcap.hardwarecaps.en_stapledetect), false);
|
|
|
|
|
outJson["Config"].Add(SCANCOUNT, (int)(gcap.scannum));
|
2020-07-11 10:43:17 +00:00
|
|
|
|
outJson["Config"].Add(DOCORIENTATION, (int)(gcap.imageRotateDegree));
|
|
|
|
|
outJson["Config"].Add(AUTO_TEXT, (bool)(gcap.is_autotext),false);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
outJson["Config"].Add(BACKROTATE180, (bool)(gcap.is_backrotate180), false);
|
2020-12-09 08:02:51 +00:00
|
|
|
|
outJson["Config"].Add(NOISE, (int)(gcap.noise), false);
|
|
|
|
|
outJson["Config"].Add(ISCONVEX, (bool)(gcap.is_convex), false);
|
|
|
|
|
outJson["Config"].Add(INDENT, (int)(gcap.indent), false);
|
|
|
|
|
outJson["Config"].Add(AUTOCROP_THRESHOLD, (int)(gcap.AutoCrop_threshold), false);
|
2020-11-16 10:05:04 +00:00
|
|
|
|
outJson["Config"].Add(DOGEAR_DETECTION, (bool)(gcap.is_dogeardetection), false);
|
2020-07-11 10:43:17 +00:00
|
|
|
|
outJson["Config"].Add(SCREWDETECT, (bool)(gcap.hardwarecaps.en_skrewdetect), false);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
outJson["Config"].Add(SCREWLEVEL, (int)(gcap.hardwarecaps.skrewdetectlevel));
|
|
|
|
|
outJson["Config"].Add(ITEMCAPTION, (string)(gcap.Caption));
|
|
|
|
|
outJson["Config"].Add(SAVEPATH, (string)(gcap.SavePath));
|
|
|
|
|
std::ofstream os;
|
|
|
|
|
os.open(path.c_str());
|
|
|
|
|
os << outJson.ToFormattedString();
|
|
|
|
|
os.close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GscanJsonConfig::WriteJsonArrayToFile(std::vector<GScanCap> cfgArray, const std::string filename)
|
|
|
|
|
{
|
|
|
|
|
neb::CJsonObject root;
|
|
|
|
|
root.AddEmptySubObject("Config");
|
|
|
|
|
/*< basic setting*/
|
|
|
|
|
root["Config"].AddEmptySubArray(PIXTYPE);
|
2020-12-17 09:02:33 +00:00
|
|
|
|
root["Config"].AddEmptySubArray(AUTOMATICCOLOR);
|
|
|
|
|
root["Config"].AddEmptySubArray(AUTOMATICCOLORTYPR);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
root["Config"].AddEmptySubArray(PAPARSIZE);
|
|
|
|
|
root["Config"].AddEmptySubArray(PAPERALIGN);
|
2020-12-10 02:01:22 +00:00
|
|
|
|
root["Config"].AddEmptySubArray(ENSIZECHECK);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
root["Config"].AddEmptySubArray(AUTOCROP);
|
|
|
|
|
root["Config"].AddEmptySubArray(RESOLUTION);
|
|
|
|
|
root["Config"].AddEmptySubArray(DUPLEX);
|
|
|
|
|
root["Config"].AddEmptySubArray(DISCARBLANK);
|
|
|
|
|
root["Config"].AddEmptySubArray(DISCARBLANKVINCE);
|
2020-12-09 08:02:51 +00:00
|
|
|
|
root["Config"].AddEmptySubArray(DISCARBLANK_VALUE);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
//root["Config"].AddEmptySubArray(DB_AREANUM);
|
|
|
|
|
//root["Config"].AddEmptySubArray(DB_DEVNMAX);
|
|
|
|
|
root["Config"].AddEmptySubArray(FLOD);
|
|
|
|
|
root["Config"].AddEmptySubArray(SWITCHFRONTBACK);
|
2020-12-09 08:02:51 +00:00
|
|
|
|
root["Config"].AddEmptySubArray(DETACHNOISE);
|
|
|
|
|
root["Config"].AddEmptySubArray(DETACHNOISEVALUE);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
/*< brightness setting*/
|
|
|
|
|
root["Config"].AddEmptySubArray(BRIGHTNESS);
|
|
|
|
|
root["Config"].AddEmptySubArray(AUTOCONTRAST);
|
|
|
|
|
root["Config"].AddEmptySubArray(CONTRAST);
|
|
|
|
|
root["Config"].AddEmptySubArray(GAMMA_);
|
|
|
|
|
|
|
|
|
|
/*< image process settings*/
|
|
|
|
|
root["Config"].AddEmptySubArray(FILTERTYPE);
|
|
|
|
|
root["Config"].AddEmptySubArray(ENHANCECOLOR);
|
|
|
|
|
root["Config"].AddEmptySubArray(SHARPENTYPE);
|
|
|
|
|
root["Config"].AddEmptySubArray(AUTODESCREW);
|
|
|
|
|
root["Config"].AddEmptySubArray(FILLBLACK);
|
|
|
|
|
root["Config"].AddEmptySubArray(MULTIOUTPUT);
|
|
|
|
|
root["Config"].AddEmptySubArray(OUTHOLE);
|
|
|
|
|
root["Config"].AddEmptySubArray(OUTHOLERATIO);
|
2020-06-23 09:31:43 +00:00
|
|
|
|
root["Config"].AddEmptySubArray(HSVCORRECT);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
|
|
|
|
|
/*< feeder settings*/
|
|
|
|
|
root["Config"].AddEmptySubArray(ULTRADETECT);
|
|
|
|
|
root["Config"].AddEmptySubArray(BINDINGDETECT);
|
|
|
|
|
root["Config"].AddEmptySubArray(SCANCOUNT);
|
|
|
|
|
root["Config"].AddEmptySubArray(DOCORIENTATION);
|
|
|
|
|
root["Config"].AddEmptySubArray(AUTO_TEXT);
|
|
|
|
|
root["Config"].AddEmptySubArray(BACKROTATE180);
|
2020-11-16 10:05:04 +00:00
|
|
|
|
root["Config"].AddEmptySubArray(DOGEAR_DETECTION);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
root["Config"].AddEmptySubArray(SCREWDETECT);
|
|
|
|
|
root["Config"].AddEmptySubArray(SCREWLEVEL);
|
2020-12-09 08:02:51 +00:00
|
|
|
|
root["Config"].AddEmptySubArray(NOISE);
|
|
|
|
|
root["Config"].AddEmptySubArray(INDENT);
|
|
|
|
|
root["Config"].AddEmptySubArray(AUTOCROP_THRESHOLD);
|
|
|
|
|
root["Config"].AddEmptySubArray(ISCONVEX);
|
|
|
|
|
|
2020-06-20 03:07:40 +00:00
|
|
|
|
|
|
|
|
|
/*< other settings*/
|
|
|
|
|
root["Config"].AddEmptySubArray(ITEMCAPTION);
|
|
|
|
|
root["Config"].AddEmptySubArray(SAVEPATH);
|
|
|
|
|
for (int i = 0; i < cfgArray.size(); i++)
|
|
|
|
|
{
|
|
|
|
|
root["Config"][PIXTYPE].Add((int)cfgArray[i].pixtype);
|
2020-12-17 09:02:33 +00:00
|
|
|
|
root["Config"][AUTOMATICCOLOR].Add(i,(bool)cfgArray[i].automaticcolor);
|
|
|
|
|
root["Config"][AUTOMATICCOLORTYPR].Add((int)cfgArray[i].automaticcolortype);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
root["Config"][PAPARSIZE].Add((int)cfgArray[i].papertype);
|
|
|
|
|
root["Config"][PAPERALIGN].Add((int)cfgArray[i].paperAlign);
|
2020-12-10 02:01:22 +00:00
|
|
|
|
root["Config"][ENSIZECHECK].Add(i, (bool)cfgArray[i].en_sizecheck);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
root["Config"][AUTOCROP].Add(i, (bool)cfgArray[i].is_autocrop);
|
2020-07-11 10:43:17 +00:00
|
|
|
|
root["Config"][RESOLUTION].Add((int)cfgArray[i].resolution_dst);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
root["Config"][DUPLEX].Add(i,(bool)cfgArray[i].is_duplex);
|
|
|
|
|
root["Config"][DISCARBLANK].Add(i, (bool)cfgArray[i].is_autodiscradblank_normal);
|
|
|
|
|
root["Config"][DISCARBLANKVINCE].Add(i, (bool)cfgArray[i].is_autodiscradblank_vince);
|
2020-12-09 08:02:51 +00:00
|
|
|
|
root["Config"][DISCARBLANK_VALUE].Add((int)cfgArray[i].discardblank_percent);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
//root["Config"][DB_AREANUM].Add(cfgArray[i].DBlank_AreaNum);
|
|
|
|
|
//root["Config"][DB_DEVNMAX].Add(cfgArray[i].DBlank_DevnMax);
|
|
|
|
|
root["Config"][FLOD].Add(i, (bool)cfgArray[i].en_fold);
|
|
|
|
|
root["Config"][SWITCHFRONTBACK].Add(i,(bool)cfgArray[i].is_switchfrontback);
|
|
|
|
|
|
2020-07-11 10:43:17 +00:00
|
|
|
|
root["Config"][BRIGHTNESS].Add((int)cfgArray[i].brightness);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
root["Config"][AUTOCONTRAST].Add(i, (bool)cfgArray[i].is_autocontrast);
|
2020-07-11 10:43:17 +00:00
|
|
|
|
root["Config"][CONTRAST].Add((int)cfgArray[i].contrast);
|
|
|
|
|
root["Config"][GAMMA_].Add((double)cfgArray[i].gamma);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
|
|
|
|
|
root["Config"][FILTERTYPE].Add((int)cfgArray[i].filter);
|
|
|
|
|
root["Config"][ENHANCECOLOR].Add((int)cfgArray[i].enhance_color);
|
|
|
|
|
root["Config"][SHARPENTYPE].Add((int)cfgArray[i].sharpen);
|
|
|
|
|
root["Config"][AUTODESCREW].Add(i, (bool)cfgArray[i].autodescrew);
|
|
|
|
|
root["Config"][FILLBLACK].Add(i, (bool)cfgArray[i].fillbackground);
|
|
|
|
|
root["Config"][MULTIOUTPUT].Add(i, (bool)cfgArray[i].multi_output_red);
|
|
|
|
|
root["Config"][OUTHOLE].Add(i, (bool)cfgArray[i].fillhole.is_fillhole);
|
2020-07-11 10:43:17 +00:00
|
|
|
|
root["Config"][OUTHOLERATIO].Add((int)cfgArray[i].fillhole.fillholeratio);
|
2020-12-09 08:02:51 +00:00
|
|
|
|
root["Config"][DETACHNOISE].Add(i, (bool)cfgArray[i].detachnoise.is_detachnoise);
|
|
|
|
|
root["Config"][DETACHNOISEVALUE].Add((int)cfgArray[i].detachnoise.detachnoise);
|
2020-06-23 09:31:43 +00:00
|
|
|
|
root["Config"][HSVCORRECT].Add(i, (bool)cfgArray[i].hsvcorrect);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
|
|
|
|
|
root["Config"][ULTRADETECT].Add(i, (bool)cfgArray[i].hardwarecaps.en_doublefeed);
|
|
|
|
|
root["Config"][BINDINGDETECT].Add(i, (bool)cfgArray[i].hardwarecaps.en_stapledetect);
|
|
|
|
|
root["Config"][SCANCOUNT].Add((int)cfgArray[i].scannum);
|
2020-07-11 10:43:17 +00:00
|
|
|
|
root["Config"][DOCORIENTATION].Add((int)cfgArray[i].imageRotateDegree);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
root["Config"][AUTO_TEXT].Add(i, (bool)cfgArray[i].is_autotext);
|
|
|
|
|
root["Config"][BACKROTATE180].Add(i, (bool)cfgArray[i].is_backrotate180);
|
2020-12-09 08:02:51 +00:00
|
|
|
|
root["Config"][NOISE].Add((int)cfgArray[i].noise);
|
|
|
|
|
root["Config"][INDENT].Add((int)cfgArray[i].indent);
|
|
|
|
|
root["Config"][ISCONVEX].Add(i, (bool)cfgArray[i].is_convex);
|
|
|
|
|
root["Config"][AUTOCROP_THRESHOLD].Add((int)cfgArray[i].AutoCrop_threshold);
|
2020-11-16 10:05:04 +00:00
|
|
|
|
root["Config"][DOGEAR_DETECTION].Add(i, (bool)cfgArray[i].is_dogeardetection);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
root["Config"][SCREWDETECT].Add(i, (bool)cfgArray[i].hardwarecaps.en_skrewdetect);
|
2020-07-11 10:43:17 +00:00
|
|
|
|
root["Config"][SCREWLEVEL].Add((int)cfgArray[i].hardwarecaps.skrewdetectlevel);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
|
|
|
|
|
if (cfgArray[i].Caption.c_str() != NULL)
|
|
|
|
|
{
|
|
|
|
|
root["Config"][ITEMCAPTION].Add(cfgArray[i].Caption);
|
|
|
|
|
}
|
|
|
|
|
if (cfgArray[i].SavePath.c_str() != NULL)
|
|
|
|
|
{
|
|
|
|
|
root["Config"][SAVEPATH].Add(cfgArray[i].SavePath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
std::ofstream os;
|
|
|
|
|
os.open(filename.c_str());
|
|
|
|
|
os << root.ToFormattedString();
|
|
|
|
|
os.close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GScanCap GscanJsonConfig::ReadGscanCap()
|
|
|
|
|
{
|
|
|
|
|
TCHAR szIniFile[MAX_PATH] = { 0 };
|
|
|
|
|
SHGetSpecialFolderPath(NULL, szIniFile, CSIDL_LOCAL_APPDATA, TRUE);
|
|
|
|
|
_tcscat(szIniFile, HUAGAO_SCAN);
|
|
|
|
|
_tcscat(szIniFile, TWAIN_INIPATH);
|
|
|
|
|
_tcscat(szIniFile, TEXT("\\"));
|
|
|
|
|
std::string dirpath = TCHAR2STRING(szIniFile);
|
|
|
|
|
bool is_exist = isFolderExist((char*)dirpath.c_str());
|
|
|
|
|
if (!is_exist) {
|
|
|
|
|
createDirectory((char*)dirpath.c_str());
|
|
|
|
|
|
|
|
|
|
_tcscat(szIniFile, TWAIN_JSON_NAME);
|
|
|
|
|
std::string dstpath = TCHAR2STRING(szIniFile);
|
|
|
|
|
vector<GScanCap> vc;
|
|
|
|
|
vc.push_back(GetDefaultGscancapValue());
|
|
|
|
|
WriteJsonArrayToFile(vc, dstpath);
|
|
|
|
|
return vc[0];
|
|
|
|
|
}
|
|
|
|
|
_tcscat(szIniFile, TWAIN_JSON_NAME);
|
|
|
|
|
std::string s_default = TCHAR2STRING(szIniFile);
|
|
|
|
|
|
|
|
|
|
vector<GScanCap> vc;
|
|
|
|
|
vc = ReadGscanCapsVector(s_default.c_str());
|
|
|
|
|
if (vc.size() != 0)
|
|
|
|
|
{
|
|
|
|
|
return vc[0];
|
|
|
|
|
}
|
|
|
|
|
return GetDefaultGscancapValue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<GScanCap> GscanJsonConfig::ReadGscanCapsVector(const std::string gcapsfilepath)
|
|
|
|
|
{
|
|
|
|
|
std::vector<GScanCap> re;
|
|
|
|
|
FILE* file = fopen(gcapsfilepath.c_str(), "rb");
|
|
|
|
|
if (!file)
|
|
|
|
|
{
|
|
|
|
|
return re;
|
|
|
|
|
}
|
|
|
|
|
fseek(file, 0, SEEK_END);
|
|
|
|
|
long size = ftell(file);
|
|
|
|
|
fseek(file, 0, SEEK_SET);
|
|
|
|
|
std::string text;
|
|
|
|
|
char* buffer = new char[size + 1];
|
|
|
|
|
buffer[size] = 0;
|
|
|
|
|
if (!fread(buffer, 1, size, file) == (unsigned long)size)
|
|
|
|
|
{
|
|
|
|
|
return re;
|
|
|
|
|
}
|
|
|
|
|
text = buffer;
|
|
|
|
|
fclose(file);
|
|
|
|
|
delete[]buffer;
|
|
|
|
|
re = parseJsonFromString(text);
|
|
|
|
|
return re;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool GscanJsonConfig::DeleteJsonFile(std::string path)
|
|
|
|
|
{
|
|
|
|
|
return remove(path.c_str());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<GScanCap> GscanJsonConfig::parseJsonFromString(const std::string str)
|
|
|
|
|
{
|
|
|
|
|
neb::CJsonObject root(str);
|
|
|
|
|
vector<GScanCap> vcConfig;
|
|
|
|
|
int size = 0;
|
|
|
|
|
neb::CJsonObject itmPaparSize;
|
|
|
|
|
root["Config"].Get(PAPARSIZE, itmPaparSize);
|
|
|
|
|
size = itmPaparSize.GetArraySize();
|
|
|
|
|
if (size > 0)
|
|
|
|
|
{
|
|
|
|
|
neb::CJsonObject itmPixType;
|
|
|
|
|
root["Config"].Get(PIXTYPE, itmPixType);
|
2020-12-17 09:02:33 +00:00
|
|
|
|
neb::CJsonObject itmautomaticcolor;
|
|
|
|
|
root["Config"].Get(AUTOMATICCOLOR, itmautomaticcolor);
|
|
|
|
|
neb::CJsonObject itmautomaticcolortype;
|
|
|
|
|
root["Config"].Get(AUTOMATICCOLORTYPR, itmautomaticcolortype);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
neb::CJsonObject itmAutoCrop;
|
|
|
|
|
root["Config"].Get(AUTOCROP, itmAutoCrop);
|
|
|
|
|
neb::CJsonObject itmPaperAlign;
|
|
|
|
|
root["Config"].Get(PAPERALIGN, itmPaperAlign);
|
2020-12-10 02:01:22 +00:00
|
|
|
|
neb::CJsonObject itmSizeCheck;
|
|
|
|
|
root["Config"].Get(ENSIZECHECK, itmSizeCheck);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
neb::CJsonObject itmRes;
|
|
|
|
|
root["Config"].Get(RESOLUTION, itmRes);
|
|
|
|
|
neb::CJsonObject itmDulpex;
|
|
|
|
|
root["Config"].Get(DUPLEX, itmDulpex);
|
|
|
|
|
neb::CJsonObject itmDiscardBlk;
|
|
|
|
|
root["Config"].Get(DISCARBLANK, itmDiscardBlk);
|
|
|
|
|
neb::CJsonObject itmDiscardBlkVince;
|
|
|
|
|
root["Config"].Get(DISCARBLANKVINCE, itmDiscardBlkVince);
|
2020-07-11 10:43:17 +00:00
|
|
|
|
//neb::CJsonObject itmDBAreaNum;
|
|
|
|
|
//root["Config"].Get(DB_AREANUM, itmDBAreaNum);
|
|
|
|
|
//neb::CJsonObject itmDBDevnMax;
|
|
|
|
|
//root["Config"].Get(DB_DEVNMAX, itmDBDevnMax);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
neb::CJsonObject itmEnFlod;
|
|
|
|
|
root["Config"].Get(FLOD, itmEnFlod);
|
|
|
|
|
neb::CJsonObject itmEnSwitchFrontBack;
|
|
|
|
|
root["Config"].Get(SWITCHFRONTBACK, itmEnSwitchFrontBack);
|
2020-12-09 08:02:51 +00:00
|
|
|
|
neb::CJsonObject itmdiscarbrank_value;
|
|
|
|
|
root["Config"].Get(DISCARBLANK_VALUE, itmdiscarbrank_value);
|
|
|
|
|
|
2020-06-20 03:07:40 +00:00
|
|
|
|
|
|
|
|
|
neb::CJsonObject itmBrtnes;
|
|
|
|
|
root["Config"].Get(BRIGHTNESS, itmBrtnes);
|
|
|
|
|
neb::CJsonObject itmAutoCrnt;
|
|
|
|
|
root["Config"].Get(AUTOCONTRAST, itmAutoCrnt);
|
|
|
|
|
neb::CJsonObject itmContrast;
|
|
|
|
|
root["Config"].Get(CONTRAST, itmContrast);
|
|
|
|
|
neb::CJsonObject itmGamma;
|
|
|
|
|
root["Config"].Get(GAMMA_, itmGamma);
|
|
|
|
|
|
|
|
|
|
neb::CJsonObject itmFilter;
|
|
|
|
|
root["Config"].Get(FILTERTYPE, itmFilter);
|
|
|
|
|
neb::CJsonObject itmEnchace;
|
|
|
|
|
root["Config"].Get(ENHANCECOLOR, itmEnchace);
|
|
|
|
|
neb::CJsonObject itmSharpen;
|
|
|
|
|
root["Config"].Get(SHARPENTYPE, itmSharpen);
|
|
|
|
|
neb::CJsonObject itmAutoDescrew;
|
|
|
|
|
root["Config"].Get(AUTODESCREW, itmAutoDescrew);
|
|
|
|
|
neb::CJsonObject itmFillBlack;
|
|
|
|
|
root["Config"].Get(FILLBLACK, itmFillBlack);
|
|
|
|
|
neb::CJsonObject itmMultiOutput;
|
|
|
|
|
root["Config"].Get(MULTIOUTPUT, itmMultiOutput);
|
|
|
|
|
neb::CJsonObject itmOutHole;
|
|
|
|
|
root["Config"].Get(OUTHOLE, itmOutHole);
|
|
|
|
|
neb::CJsonObject itmOutHoleRatio;
|
|
|
|
|
root["Config"].Get(OUTHOLERATIO, itmOutHoleRatio);
|
2020-12-09 08:02:51 +00:00
|
|
|
|
neb::CJsonObject itmDetachNoise;
|
|
|
|
|
root["Config"].Get(DETACHNOISE, itmDetachNoise);
|
|
|
|
|
neb::CJsonObject itmDetachNoiseValue;
|
|
|
|
|
root["Config"].Get(DETACHNOISEVALUE, itmDetachNoiseValue);
|
2020-06-23 09:31:43 +00:00
|
|
|
|
neb::CJsonObject itmHsvCorrect;
|
|
|
|
|
root["Config"].Get(HSVCORRECT, itmHsvCorrect);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
|
|
|
|
|
neb::CJsonObject itmUltDetect;
|
|
|
|
|
root["Config"].Get(ULTRADETECT, itmUltDetect);
|
|
|
|
|
neb::CJsonObject itmBingdingDetect;
|
|
|
|
|
root["Config"].Get(BINDINGDETECT, itmBingdingDetect);
|
|
|
|
|
neb::CJsonObject itmScanCount;
|
|
|
|
|
root["Config"].Get(SCANCOUNT, itmScanCount);
|
|
|
|
|
neb::CJsonObject itmDocOrientation;
|
|
|
|
|
root["Config"].Get(DOCORIENTATION, itmDocOrientation);
|
|
|
|
|
neb::CJsonObject itmAutotext;
|
|
|
|
|
root["Config"].Get(AUTO_TEXT, itmAutotext);
|
|
|
|
|
neb::CJsonObject itmBackRotate;
|
|
|
|
|
root["Config"].Get(BACKROTATE180, itmBackRotate);
|
2020-12-09 08:02:51 +00:00
|
|
|
|
neb::CJsonObject itmNoise;
|
|
|
|
|
root["Config"].Get(NOISE, itmNoise);
|
|
|
|
|
neb::CJsonObject itmIndent;
|
|
|
|
|
root["Config"].Get(INDENT, itmIndent);
|
|
|
|
|
neb::CJsonObject itmisConvex;
|
|
|
|
|
root["Config"].Get(ISCONVEX, itmisConvex);
|
|
|
|
|
neb::CJsonObject itmAutoCrop_t;
|
|
|
|
|
root["Config"].Get(AUTOCROP_THRESHOLD, itmAutoCrop_t);
|
2020-11-16 10:05:04 +00:00
|
|
|
|
neb::CJsonObject itmdogeardetection;
|
|
|
|
|
root["Config"].Get(DOGEAR_DETECTION, itmdogeardetection);
|
2020-06-20 03:07:40 +00:00
|
|
|
|
neb::CJsonObject itmScrewDetct;
|
|
|
|
|
root["Config"].Get(SCREWDETECT, itmScrewDetct);
|
|
|
|
|
neb::CJsonObject itmScrewLevel;
|
|
|
|
|
root["Config"].Get(SCREWLEVEL, itmScrewLevel);
|
|
|
|
|
|
|
|
|
|
neb::CJsonObject itmCaption;
|
|
|
|
|
if (!root["Config"][ITEMCAPTION].IsEmpty())
|
|
|
|
|
{
|
|
|
|
|
root["Config"].Get(ITEMCAPTION, itmCaption);
|
|
|
|
|
}
|
|
|
|
|
neb::CJsonObject itmSavePtah;
|
|
|
|
|
if (!root["Config"][SAVEPATH].IsEmpty())
|
|
|
|
|
{
|
|
|
|
|
root["Config"].Get(SAVEPATH, itmSavePtah);
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < size; i++)
|
|
|
|
|
{
|
|
|
|
|
GScanCap cfp;
|
|
|
|
|
int i_value;
|
|
|
|
|
double f_value;
|
|
|
|
|
bool b_value;
|
|
|
|
|
std::string s_value;
|
|
|
|
|
|
|
|
|
|
itmPixType.Get(i, i_value);
|
|
|
|
|
cfp.pixtype = i_value;
|
2020-12-17 09:02:33 +00:00
|
|
|
|
itmautomaticcolor.Get(i, b_value);
|
|
|
|
|
cfp.automaticcolor = b_value;
|
|
|
|
|
itmautomaticcolortype.Get(i, i_value);
|
|
|
|
|
cfp.automaticcolortype = i_value;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
itmPaparSize.Get(i, i_value);
|
|
|
|
|
cfp.papertype = (byte)i_value;
|
|
|
|
|
itmPaperAlign.Get(i, i_value);
|
|
|
|
|
cfp.paperAlign = (PaperAlign)i_value;
|
2020-12-10 02:01:22 +00:00
|
|
|
|
itmSizeCheck.Get(i, b_value);
|
|
|
|
|
cfp.en_sizecheck = b_value ? 1 : 0;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
itmAutoCrop.Get(i, b_value);
|
|
|
|
|
cfp.is_autocrop = b_value ? 1 : 0;
|
|
|
|
|
itmRes.Get(i, i_value);
|
|
|
|
|
cfp.resolution_dst = i_value;
|
|
|
|
|
itmDulpex.Get(i, b_value);
|
|
|
|
|
cfp.is_duplex = b_value ? 1 : 0;
|
2020-12-09 08:02:51 +00:00
|
|
|
|
itmdiscarbrank_value.Get(i, i_value);
|
|
|
|
|
cfp.discardblank_percent = i_value;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
itmDiscardBlk.Get(i, b_value);
|
|
|
|
|
cfp.is_autodiscradblank_normal = b_value ? 1 : 0;
|
|
|
|
|
itmDiscardBlkVince.Get(i, b_value);
|
|
|
|
|
cfp.is_autodiscradblank_vince = b_value ? 1 : 0;
|
|
|
|
|
//itmDBAreaNum.Get(i, i_value);
|
|
|
|
|
//cfp.DBlank_AreaNum = i_value;
|
|
|
|
|
//itmDBDevnMax.Get(i, i_value);
|
|
|
|
|
//cfp.DBlank_DevnMax = i_value;
|
|
|
|
|
itmEnFlod.Get(i, b_value);
|
|
|
|
|
cfp.en_fold = b_value ? 1 : 0;
|
|
|
|
|
itmEnSwitchFrontBack.Get(i, b_value);
|
|
|
|
|
cfp.is_switchfrontback = b_value ? 1 : 0;
|
|
|
|
|
|
2020-07-11 10:43:17 +00:00
|
|
|
|
itmBrtnes.Get(i, i_value);
|
|
|
|
|
cfp.brightness = i_value;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
itmAutoCrnt.Get(i, b_value);
|
|
|
|
|
cfp.is_autocontrast = b_value ? 1 : 0;
|
2020-07-11 10:43:17 +00:00
|
|
|
|
itmContrast.Get(i, i_value);
|
|
|
|
|
cfp.contrast = i_value;
|
2020-07-07 03:19:18 +00:00
|
|
|
|
itmGamma.Get(i, f_value);
|
|
|
|
|
cfp.gamma = f_value;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
|
|
|
|
|
itmFilter.Get(i, i_value);
|
|
|
|
|
cfp.filter = i_value;
|
|
|
|
|
itmEnchace.Get(i, i_value);
|
|
|
|
|
cfp.enhance_color = i_value;
|
|
|
|
|
itmSharpen.Get(i, i_value);
|
|
|
|
|
cfp.sharpen = i_value;
|
|
|
|
|
itmAutoDescrew.Get(i, b_value);
|
|
|
|
|
cfp.autodescrew = b_value ? 1 : 0;
|
|
|
|
|
itmFillBlack.Get(i, b_value);
|
|
|
|
|
cfp.fillbackground = b_value ? 1 : 0;
|
|
|
|
|
itmMultiOutput.Get(i, b_value);
|
|
|
|
|
cfp.multi_output_red = b_value ? 1 : 0;
|
|
|
|
|
itmOutHole.Get(i, b_value);
|
|
|
|
|
cfp.fillhole.is_fillhole = b_value ? 1 : 0;
|
|
|
|
|
itmOutHoleRatio.Get(i, i_value);
|
|
|
|
|
cfp.fillhole.fillholeratio = i_value;
|
2020-12-09 08:02:51 +00:00
|
|
|
|
itmDetachNoise.Get(i, b_value);
|
|
|
|
|
cfp.detachnoise.is_detachnoise = b_value ? 1 : 0;
|
|
|
|
|
itmDetachNoiseValue.Get(i, i_value);
|
|
|
|
|
cfp.detachnoise.detachnoise = i_value;
|
2020-06-23 09:31:43 +00:00
|
|
|
|
itmHsvCorrect.Get(i, b_value);
|
|
|
|
|
cfp.hsvcorrect = b_value ? 1 : 0;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
|
|
|
|
|
itmUltDetect.Get(i, b_value);
|
|
|
|
|
cfp.hardwarecaps.en_doublefeed = b_value ? 1 : 0;
|
|
|
|
|
itmBingdingDetect.Get(i, b_value);
|
|
|
|
|
cfp.hardwarecaps.en_stapledetect = b_value ? 1 : 0;
|
|
|
|
|
itmScanCount.Get(i, i_value);
|
|
|
|
|
cfp.scannum = i_value;
|
2020-07-11 10:43:17 +00:00
|
|
|
|
itmDocOrientation.Get(i, i_value);
|
|
|
|
|
cfp.imageRotateDegree = i_value;
|
2020-12-09 08:02:51 +00:00
|
|
|
|
itmAutoCrop_t.Get(i, i_value);
|
|
|
|
|
cfp.AutoCrop_threshold = i_value;
|
|
|
|
|
itmNoise.Get(i, i_value);
|
|
|
|
|
cfp.noise = i_value;
|
|
|
|
|
itmIndent.Get(i, i_value);
|
|
|
|
|
cfp.indent = i_value;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
itmAutotext.Get(i, b_value);
|
|
|
|
|
cfp.is_autotext = b_value?1:0;
|
|
|
|
|
itmBackRotate.Get(i, b_value);
|
|
|
|
|
cfp.is_backrotate180 = b_value ? 1 : 0;
|
2020-12-09 08:02:51 +00:00
|
|
|
|
itmisConvex.Get(i, b_value);
|
|
|
|
|
cfp.is_convex = b_value ? 1 : 0;
|
2020-11-16 10:05:04 +00:00
|
|
|
|
itmdogeardetection.Get(i, b_value);
|
|
|
|
|
cfp.is_dogeardetection = b_value ? 1 : 0;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
itmScrewDetct.Get(i, b_value);
|
|
|
|
|
cfp.hardwarecaps.en_skrewdetect = b_value ? 1 : 0;
|
|
|
|
|
itmScrewLevel.Get(i, i_value);
|
2020-07-07 01:53:32 +00:00
|
|
|
|
cfp.hardwarecaps.skrewdetectlevel = i_value;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
|
|
|
|
|
if (!root["Config"][ITEMCAPTION].IsEmpty())
|
|
|
|
|
{
|
|
|
|
|
itmCaption.Get(i, s_value);
|
|
|
|
|
cfp.Caption = s_value;
|
|
|
|
|
}
|
|
|
|
|
if (!root["Config"][SAVEPATH].IsEmpty())
|
|
|
|
|
{
|
|
|
|
|
itmSavePtah.Get(i, s_value);
|
|
|
|
|
cfp.SavePath = s_value;
|
|
|
|
|
}
|
|
|
|
|
vcConfig.push_back(cfp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
GScanCap cfp;
|
|
|
|
|
int index;
|
|
|
|
|
bool bvalue;
|
2020-07-11 10:43:17 +00:00
|
|
|
|
double fvalue;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
std::string svalue;
|
|
|
|
|
|
|
|
|
|
root["Config"].Get(PIXTYPE, index);
|
|
|
|
|
cfp.pixtype = index;
|
2020-12-17 09:02:33 +00:00
|
|
|
|
root["Config"].Get(AUTOMATICCOLOR, bvalue);
|
|
|
|
|
cfp.automaticcolor = bvalue;
|
|
|
|
|
root["Config"].Get(AUTOMATICCOLORTYPR, index);
|
|
|
|
|
cfp.automaticcolortype = index;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
root["Config"].Get(PAPARSIZE, index);
|
|
|
|
|
cfp.papertype = index;
|
|
|
|
|
root["Config"].Get(PAPERALIGN, index);
|
|
|
|
|
cfp.paperAlign =(PaperAlign) index;
|
2020-12-10 02:01:22 +00:00
|
|
|
|
root["Config"].Get(ENSIZECHECK, bvalue);
|
|
|
|
|
cfp.en_sizecheck = bvalue ? 1 : 0;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
root["Config"].Get(AUTOCROP, bvalue);
|
|
|
|
|
cfp.is_autocrop = bvalue?1:0;
|
|
|
|
|
root["Config"].Get(RESOLUTION, index);
|
|
|
|
|
cfp.resolution_dst = index;
|
|
|
|
|
root["Config"].Get(DUPLEX, bvalue);
|
|
|
|
|
cfp.is_duplex = bvalue?1:0;
|
|
|
|
|
root["Config"].Get(DISCARBLANK, bvalue);
|
|
|
|
|
cfp.is_autodiscradblank_normal = bvalue?1:0;
|
|
|
|
|
root["Config"].Get(DISCARBLANKVINCE, bvalue);
|
|
|
|
|
cfp.is_autodiscradblank_vince = bvalue?1:0;
|
2020-12-09 08:02:51 +00:00
|
|
|
|
root["Config"].Get(DISCARBLANK_VALUE, index);
|
|
|
|
|
cfp.discardblank_percent = index ;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
//root["Config"].Get(DB_AREANUM, index);
|
|
|
|
|
//cfp.DBlank_AreaNum = index;
|
|
|
|
|
//root["Config"].Get(DB_DEVNMAX, index);
|
|
|
|
|
//cfp.DBlank_DevnMax = index;
|
|
|
|
|
root["Config"].Get(FLOD, bvalue);
|
|
|
|
|
cfp.en_fold = bvalue?1:0;
|
|
|
|
|
root["Config"].Get(SWITCHFRONTBACK, bvalue);
|
|
|
|
|
cfp.is_switchfrontback = bvalue?1:0;
|
|
|
|
|
|
2020-07-11 10:43:17 +00:00
|
|
|
|
root["Config"].Get(BRIGHTNESS, index);
|
|
|
|
|
cfp.brightness = index;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
root["Config"].Get(AUTOCONTRAST, bvalue);
|
|
|
|
|
cfp.is_autocontrast = bvalue?1:0;
|
|
|
|
|
root["Config"].Get(CONTRAST, index);
|
2020-07-11 10:43:17 +00:00
|
|
|
|
cfp.contrast = index;
|
|
|
|
|
root["Config"].Get(GAMMA_, fvalue);
|
|
|
|
|
cfp.gamma = fvalue;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
|
|
|
|
|
root["Config"].Get(FILTERTYPE, index);
|
|
|
|
|
cfp.filter = (byte)index;
|
|
|
|
|
root["Config"].Get(ENHANCECOLOR, index);
|
|
|
|
|
cfp.enhance_color =(byte) index;
|
|
|
|
|
root["config"].Get(SHARPENTYPE, index);
|
|
|
|
|
cfp.sharpen = (byte)index;
|
|
|
|
|
root["Config"].Get(AUTODESCREW, bvalue);
|
|
|
|
|
cfp.autodescrew = bvalue?1:0;
|
|
|
|
|
root["Config"].Get(FILLBLACK, bvalue);
|
|
|
|
|
cfp.fillbackground = bvalue?1:0;
|
|
|
|
|
root["Config"].Get(MULTIOUTPUT, bvalue);
|
|
|
|
|
cfp.multi_output_red = bvalue?1:0;
|
|
|
|
|
root["Config"].Get(OUTHOLE, bvalue);
|
|
|
|
|
cfp.fillhole.is_fillhole = bvalue?1:0;
|
|
|
|
|
root["Config"].Get(OUTHOLERATIO, index);
|
|
|
|
|
cfp.fillhole.fillholeratio = index;
|
2020-12-09 08:02:51 +00:00
|
|
|
|
root["Config"].Get(DETACHNOISE, bvalue);
|
|
|
|
|
cfp.detachnoise.is_detachnoise = bvalue ? 1 : 0;
|
|
|
|
|
root["Config"].Get(DETACHNOISEVALUE, index);
|
|
|
|
|
cfp.detachnoise.detachnoise = index;
|
2020-06-23 09:31:43 +00:00
|
|
|
|
root["Config"].Get(HSVCORRECT, bvalue);
|
|
|
|
|
cfp.hsvcorrect = bvalue ? 1 : 0;
|
2020-12-09 08:02:51 +00:00
|
|
|
|
root["Config"].Get(NOISE, index);
|
|
|
|
|
cfp.noise = index;
|
|
|
|
|
root["Config"].Get(INDENT, index);
|
|
|
|
|
cfp.indent = index;
|
|
|
|
|
root["Config"].Get(AUTOCROP_THRESHOLD, index);
|
|
|
|
|
cfp.AutoCrop_threshold = index;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
|
|
|
|
|
root["Config"].Get(ULTRADETECT, bvalue);
|
|
|
|
|
cfp.hardwarecaps.en_doublefeed = bvalue?1:0;
|
|
|
|
|
root["Config"].Get(BINDINGDETECT, bvalue);
|
|
|
|
|
cfp.hardwarecaps.en_stapledetect = bvalue ? 1 : 0;
|
|
|
|
|
root["Config"].Get(SCANCOUNT, index);
|
|
|
|
|
cfp.scannum = index;
|
|
|
|
|
root["Config"].Get(DOCORIENTATION, index);
|
2020-07-11 10:43:17 +00:00
|
|
|
|
cfp.imageRotateDegree = index;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
root["Config"].Get(AUTO_TEXT, bvalue);
|
|
|
|
|
cfp.is_autotext = bvalue?1:0;
|
|
|
|
|
root["Config"].Get(BACKROTATE180, bvalue);
|
|
|
|
|
cfp.is_backrotate180 = bvalue ? 1 : 0;
|
2020-12-09 08:02:51 +00:00
|
|
|
|
root["Config"].Get(ISCONVEX, bvalue);
|
|
|
|
|
cfp.is_convex = bvalue ? 1 : 0;
|
2020-11-16 10:05:04 +00:00
|
|
|
|
root["Config"].Get(DOGEAR_DETECTION, bvalue);
|
|
|
|
|
cfp.is_dogeardetection = bvalue ? 1 : 0;
|
2020-06-20 03:07:40 +00:00
|
|
|
|
root["Config"].Get(SCREWDETECT, bvalue);
|
|
|
|
|
cfp.hardwarecaps.en_skrewdetect = bvalue ? 1 : 0;
|
|
|
|
|
root["Config"].Get(SCREWLEVEL, index);
|
|
|
|
|
cfp.hardwarecaps.skrewdetectlevel = index;
|
|
|
|
|
|
|
|
|
|
if (!root["Config"][ITEMCAPTION].IsEmpty())
|
|
|
|
|
{
|
|
|
|
|
root["Config"].Get(ITEMCAPTION, svalue);
|
|
|
|
|
cfp.Caption = svalue;
|
|
|
|
|
}
|
|
|
|
|
if (!root["Config"][SAVEPATH].IsEmpty())
|
|
|
|
|
{
|
|
|
|
|
root["Config"].Get(SAVEPATH, svalue);
|
|
|
|
|
cfp.SavePath = svalue;
|
|
|
|
|
}
|
|
|
|
|
vcConfig.push_back(cfp);
|
|
|
|
|
}
|
|
|
|
|
return vcConfig;
|
|
|
|
|
}
|