diff --git a/docs/G100-G200.txt b/docs/G100-G200.txt
index 293182f..9b2f8ba 100644
--- a/docs/G100-G200.txt
+++ b/docs/G100-G200.txt
@@ -1,6 +1,6 @@
{
"device_type": "G100",
- "option_count": 47,
+ "option_count": 53,
"1": {
"category": "base",
"name": "cfg-1",
@@ -35,7 +35,7 @@
"type": "string",
"cur": "24位彩色",
"default": "24位彩色",
- "size": 24,
+ "size": 32,
"range": ["24位彩色", "256级灰度", "黑白", "颜色自动识别"]
},
"5": {
@@ -46,7 +46,7 @@
"type": "string",
"cur": "不除色",
"default": "不除色",
- "size": 20,
+ "size": 24,
"range": ["不除色", "除红色", "除绿色", "除蓝色", "红色增强", "绿色增强", "蓝色增强"],
"depend_or": ["4==256级灰度", "4==黑白"]
},
@@ -132,12 +132,82 @@
"type": "string",
"cur": "匹配原始尺寸",
"default": "匹配原始尺寸",
- "size": 44,
+ "size": 48,
"range": ["A3", "8开", "A4", "A4横向", "16开", "16开横向", "A5", "A5横向", "A6", "A6横向", "B4", "B5", "B5横向", "B6", "B6横向", "Letter", "Letter横向", "Double Letter", "LEGAL", "匹配原始尺寸", "最大扫描尺寸自动裁切", "最大扫描尺寸", "三联试卷"]
},
"13": {
"category": "base",
"name": "cfg-13",
+ "title": "自定义扫描区域",
+ "desc": "自定义扫描区域",
+ "type": "bool",
+ "cur": false,
+ "default": false,
+ "size": 4
+ },
+ "14": {
+ "category": "base",
+ "name": "tl-x",
+ "title": "扫描区域左侧(mm)",
+ "desc": "自定义扫描区域左上角x坐标",
+ "type": "float",
+ "cur": 0.000000,
+ "default": 0.000000,
+ "size": 4,
+ "range": {
+ "min": 0.000000,
+ "max": 210.000000
+ },
+ "depend_and": ["13==true"]
+ },
+ "15": {
+ "category": "base",
+ "name": "br-x",
+ "title": "扫描区域右侧(mm)",
+ "desc": "自定义扫描区域右下角x坐标",
+ "type": "float",
+ "cur": 210.000000,
+ "default": 210.000000,
+ "size": 4,
+ "range": {
+ "min": 0.000000,
+ "max": 210.000000
+ },
+ "depend_and": ["13==true"]
+ },
+ "16": {
+ "category": "base",
+ "name": "tl-y",
+ "title": "扫描区域上侧(mm)",
+ "desc": "自定义扫描区域左上角y坐标",
+ "type": "float",
+ "cur": 0.000000,
+ "default": 0.000000,
+ "size": 4,
+ "range": {
+ "min": 0.000000,
+ "max": 297.000000
+ },
+ "depend_and": ["13==true"]
+ },
+ "17": {
+ "category": "base",
+ "name": "br-y",
+ "title": "扫描区域下侧(mm)",
+ "desc": "自定义扫描区域右下角y坐标",
+ "type": "float",
+ "cur": 297.000000,
+ "default": 297.000000,
+ "size": 4,
+ "range": {
+ "min": 0.000000,
+ "max": 297.000000
+ },
+ "depend_and": ["13==true"]
+ },
+ "18": {
+ "category": "base",
+ "name": "cfg-18",
"title": "扫描页面",
"desc": "设置页面扫描方式",
"type": "string",
@@ -146,9 +216,9 @@
"size": 40,
"range": ["单面", "双面", "跳过空白页(通用)", "跳过空白页(发票纸)", "对折"]
},
- "14": {
+ "19": {
"category": "base",
- "name": "cfg-14",
+ "name": "cfg-19",
"title": " 跳过空白页灵敏度",
"desc": "灵敏度越高,则越容易跳过",
"type": "int",
@@ -159,11 +229,11 @@
"min": 1,
"max": 100
},
- "depend_or": ["13==跳过空白页(通用)", "13==跳过空白页(发票纸)"]
+ "depend_or": ["18==跳过空白页(通用)", "18==跳过空白页(发票纸)"]
},
- "15": {
+ "20": {
"category": "base",
- "name": "cfg-15",
+ "name": "cfg-20",
"title": "分辨率",
"desc": "扫描仪分辨率",
"type": "int",
@@ -175,42 +245,42 @@
"max": 300
}
},
- "16": {
+ "21": {
"category": "base",
- "name": "cfg-16",
+ "name": "cfg-21",
"title": "交换正反面",
"desc": "交换正反面",
"type": "bool",
"cur": false,
"default": false,
"size": 4,
- "depend_and": ["13!=单面"]
+ "depend_and": ["18!=单面"]
},
- "17": {
+ "22": {
"category": "base",
- "name": "cfg-17",
+ "name": "cfg-22",
"title": "图像拆分",
"desc": "自动拆分图像",
"type": "bool",
"cur": false,
"default": false,
"size": 4,
- "depend_or": ["13!=对折"]
+ "depend_or": ["18!=对折"]
},
- "18": {
+ "23": {
"category": "base",
- "name": "cfg-18",
+ "name": "cfg-23",
"title": "自动纠偏",
"desc": "自动纠偏",
"type": "bool",
"cur": true,
"default": true,
"size": 4,
- "depend_or": ["13!=对折"]
+ "depend_or": ["18!=对折"]
},
- "19": {
+ "24": {
"category": "base",
- "name": "cfg-19",
+ "name": "cfg-24",
"title": "穿孔移除",
"desc": "移除纸张中的穿孔",
"type": "bool",
@@ -218,9 +288,9 @@
"default": false,
"size": 4
},
- "20": {
+ "25": {
"category": "base",
- "name": "cfg-20",
+ "name": "cfg-25",
"title": " 穿孔搜索范围占幅面比例",
"desc": "穿孔搜索范围占幅面比例",
"type": "float",
@@ -231,18 +301,28 @@
"min": 0.010000,
"max": 0.500000
},
- "depend_or": ["19==true"]
+ "depend_or": ["24==true"]
},
- "21": {
+ "26": {
"category": "base",
"name": "grp-2",
"title": "亮度",
"type": "group"
},
- "22": {
+ "27": {
"category": "base",
- "name": "cfg-22",
- "title": "亮度",
+ "name": "cfg-27",
+ "title": "启用色调曲线",
+ "desc": "通过色调曲线来设置图像伽玛值",
+ "type": "bool",
+ "cur": false,
+ "default": false,
+ "size": 4
+ },
+ "28": {
+ "category": "base",
+ "name": "cfg-28",
+ "title": "亮度值",
"desc": "调整图片亮度",
"type": "int",
"cur": 128,
@@ -251,11 +331,12 @@
"range": {
"min": 1,
"max": 255
- }
+ },
+ "depend_and": ["27==false"]
},
- "23": {
+ "29": {
"category": "base",
- "name": "cfg-23",
+ "name": "cfg-29",
"title": "对比度",
"desc": "调整图片对比度",
"type": "int",
@@ -265,12 +346,13 @@
"range": {
"min": 1,
"max": 7
- }
+ },
+ "depend_and": ["27==false"]
},
- "24": {
+ "30": {
"category": "base",
- "name": "cfg-24",
- "title": "伽玛",
+ "name": "cfg-30",
+ "title": "伽玛值",
"desc": "调整图片伽玛值",
"type": "float",
"cur": 1.000000,
@@ -279,28 +361,29 @@
"range": {
"min": 0.010000,
"max": 5.000000
- }
+ },
+ "depend_and": ["27==false"]
},
- "25": {
+ "31": {
"category": "base",
"name": "grp-3",
"title": "图像处理",
"type": "group"
},
- "26": {
+ "32": {
"category": "base",
- "name": "cfg-26",
+ "name": "cfg-32",
"title": "锐化与模糊",
"desc": "锐化与模糊",
"type": "string",
"cur": "无",
"default": "无",
- "size": 20,
+ "size": 24,
"range": ["无", "锐化", "进一步锐化", "模糊", "进一步模糊"]
},
- "27": {
+ "33": {
"category": "base",
- "name": "cfg-27",
+ "name": "cfg-33",
"title": "消除黑框",
"desc": "消除黑框",
"type": "bool",
@@ -308,20 +391,20 @@
"default": true,
"size": 4
},
- "28": {
+ "34": {
"category": "base",
- "name": "cfg-28",
+ "name": "cfg-34",
"title": "深色样张",
"desc": "深色样张",
"type": "bool",
"cur": false,
"default": false,
"size": 4,
- "depend_and": ["13!=对折", "27!=true", "12!=匹配原始尺寸", "12!=最大扫描尺寸", "12!=最大扫描尺寸自动裁切", "18!=true"]
+ "depend_and": ["18!=对折", "33!=true", "12!=匹配原始尺寸", "12!=最大扫描尺寸", "12!=最大扫描尺寸自动裁切", "23!=true"]
},
- "29": {
+ "35": {
"category": "advanced",
- "name": "cfg-29",
+ "name": "cfg-35",
"title": "阈值",
"desc": "阈值",
"type": "int",
@@ -332,11 +415,11 @@
"min": 30,
"max": 50
},
- "depend_or": ["27==true", "12==匹配原始尺寸", "12==最大扫描尺寸", "12==最大扫描尺寸自动裁切", "18==true"]
+ "depend_or": ["33==true", "12==匹配原始尺寸", "12==最大扫描尺寸", "12==最大扫描尺寸自动裁切", "23==true"]
},
- "30": {
+ "36": {
"category": "advanced",
- "name": "cfg-30",
+ "name": "cfg-36",
"title": "背景抗噪等级",
"desc": "背景抗噪等级",
"type": "int",
@@ -347,11 +430,11 @@
"min": 1,
"max": 20
},
- "depend_or": ["27==true", "12==匹配原始尺寸", "12==最大扫描尺寸", "12==最大扫描尺寸自动裁切", "18==true"]
+ "depend_or": ["33==true", "12==匹配原始尺寸", "12==最大扫描尺寸", "12==最大扫描尺寸自动裁切", "23==true"]
},
- "31": {
+ "37": {
"category": "advanced",
- "name": "cfg-31",
+ "name": "cfg-37",
"title": "边缘缩进",
"desc": "边缘缩进",
"type": "int",
@@ -362,11 +445,11 @@
"min": 5,
"max": 30
},
- "depend_or": ["27==true", "12==匹配原始尺寸", "12==最大扫描尺寸自动裁切", "18==true", "12==最大扫描尺寸"]
+ "depend_or": ["33==true", "12==匹配原始尺寸", "12==最大扫描尺寸自动裁切", "23==true", "12==最大扫描尺寸"]
},
- "32": {
+ "38": {
"category": "advanced",
- "name": "cfg-32",
+ "name": "cfg-38",
"title": "背景填充方式",
"desc": "背景填充方式",
"type": "string",
@@ -374,11 +457,11 @@
"default": "凸多边形",
"size": 40,
"range": ["凸多边形", "凹多边形"],
- "depend_or": ["27==true"]
+ "depend_or": ["33==true"]
},
- "33": {
+ "39": {
"category": "base",
- "name": "cfg-33",
+ "name": "cfg-39",
"title": "防止渗透",
"desc": "",
"type": "bool",
@@ -386,21 +469,21 @@
"default": false,
"size": 4
},
- "34": {
+ "40": {
"category": "base",
- "name": "cfg-34",
+ "name": "cfg-40",
"title": " 防止渗透等级",
"desc": "",
"type": "string",
"cur": "较弱",
"default": "较弱",
- "size": 12,
+ "size": 16,
"range": ["较弱", "弱", "一般", "强", "较强"],
- "depend_or": ["33==true"]
+ "depend_or": ["39==true"]
},
- "35": {
+ "41": {
"category": "base",
- "name": "cfg-35",
+ "name": "cfg-41",
"title": "去除摩尔纹",
"desc": "",
"type": "bool",
@@ -408,9 +491,9 @@
"default": false,
"size": 4
},
- "36": {
+ "42": {
"category": "base",
- "name": "cfg-36",
+ "name": "cfg-42",
"title": "错误扩散",
"desc": "",
"type": "bool",
@@ -418,9 +501,9 @@
"default": false,
"size": 4
},
- "37": {
+ "43": {
"category": "base",
- "name": "cfg-37",
+ "name": "cfg-43",
"title": "除网纹",
"desc": "",
"type": "bool",
@@ -428,81 +511,17 @@
"default": false,
"size": 4
},
- "38": {
+ "44": {
"category": "base",
"name": "grp-4",
"title": "送纸方式设置",
"type": "group"
},
- "39": {
- "category": "base",
- "name": "cfg-39",
- "title": "超声波检测",
- "desc": "超声波检测送纸状态",
- "type": "bool",
- "cur": true,
- "default": true,
- "size": 4
- },
- "40": {
- "category": "base",
- "name": "cfg-40",
- "title": "装订检测",
- "desc": "检测纸张上是否有钉书钉",
- "type": "bool",
- "cur": false,
- "default": false,
- "size": 4
- },
- "41": {
- "category": "base",
- "name": "cfg-41",
- "title": "扫描张数",
- "desc": "扫描纸张数量",
- "type": "string",
- "cur": "连续扫描",
- "default": "连续扫描",
- "size": 24,
- "range": ["连续扫描", "扫描指定张数"]
- },
- "42": {
- "category": "base",
- "name": "cfg-42",
- "title": " 扫描数量",
- "desc": "扫描指定数量",
- "type": "int",
- "cur": 1,
- "default": 1,
- "size": 4,
- "depend_or": ["41==扫描指定张数"]
- },
- "43": {
- "category": "base",
- "name": "cfg-43",
- "title": "文稿方向",
- "desc": "文稿方向",
- "type": "string",
- "cur": "0°",
- "default": "0°",
- "size": 40,
- "range": ["0°", "90°", "180°", "-90°", "自动文本方向识别°"]
- },
- "44": {
- "category": "base",
- "name": "cfg-44",
- "title": "背面旋转180°",
- "desc": "背面扫描的图像旋转180°",
- "type": "bool",
- "cur": false,
- "default": false,
- "size": 4,
- "depend_and": ["13!=单面", "13!=对折", "43!=自动文本方向识别°"]
- },
"45": {
"category": "base",
"name": "cfg-45",
- "title": "歪斜检测",
- "desc": "纸张歪斜检测",
+ "title": "超声波检测",
+ "desc": "超声波检测送纸状态",
"type": "bool",
"cur": true,
"default": true,
@@ -511,6 +530,70 @@
"46": {
"category": "base",
"name": "cfg-46",
+ "title": "装订检测",
+ "desc": "检测纸张上是否有钉书钉",
+ "type": "bool",
+ "cur": false,
+ "default": false,
+ "size": 4
+ },
+ "47": {
+ "category": "base",
+ "name": "cfg-47",
+ "title": "扫描张数",
+ "desc": "扫描纸张数量",
+ "type": "string",
+ "cur": "连续扫描",
+ "default": "连续扫描",
+ "size": 32,
+ "range": ["连续扫描", "扫描指定张数"]
+ },
+ "48": {
+ "category": "base",
+ "name": "cfg-48",
+ "title": " 扫描数量",
+ "desc": "扫描指定数量",
+ "type": "int",
+ "cur": 1,
+ "default": 1,
+ "size": 4,
+ "depend_or": ["47==扫描指定张数"]
+ },
+ "49": {
+ "category": "base",
+ "name": "cfg-49",
+ "title": "文稿方向",
+ "desc": "文稿方向",
+ "type": "string",
+ "cur": "0°",
+ "default": "0°",
+ "size": 40,
+ "range": ["0°", "90°", "180°", "-90°", "自动文本方向识别°"]
+ },
+ "50": {
+ "category": "base",
+ "name": "cfg-50",
+ "title": "背面旋转180°",
+ "desc": "背面扫描的图像旋转180°",
+ "type": "bool",
+ "cur": false,
+ "default": false,
+ "size": 4,
+ "depend_and": ["18!=单面", "18!=对折", "49!=自动文本方向识别°"]
+ },
+ "51": {
+ "category": "base",
+ "name": "cfg-51",
+ "title": "歪斜检测",
+ "desc": "纸张歪斜检测",
+ "type": "bool",
+ "cur": true,
+ "default": true,
+ "size": 4
+ },
+ "52": {
+ "category": "base",
+ "name": "cfg-52",
"title": " 歪斜检测复杂度",
"desc": "纸张歪斜检测复杂度",
"type": "int",
@@ -521,6 +604,6 @@
"min": 1,
"max": 5
},
- "depend_or": ["45==true"]
+ "depend_or": ["51==true"]
}
}
\ No newline at end of file
diff --git a/tools/apps/hgjson/hgjson.vcxproj b/tools/apps/hgjson/hgjson.vcxproj
index 040a144..a363fe6 100644
--- a/tools/apps/hgjson/hgjson.vcxproj
+++ b/tools/apps/hgjson/hgjson.vcxproj
@@ -44,13 +44,13 @@
true
- $(SolutionDir)..\sdk\Include\;$(IncludePath)
+ $(SolutionDir)..\sdk\Include\;$(SolutionDir)..\..\..\sdk\Include\;$(IncludePath)
$(SolutionDir)..\sdk\lib\;$(LibraryPath)
$(OutDir)$(ProjectName)\
false
- $(SolutionDir)..\sdk\Include\;$(IncludePath)
+ $(SolutionDir)..\sdk\Include\;$(SolutionDir)..\..\..\sdk\Include\;$(IncludePath)
$(SolutionDir)..\sdk\lib\;$(LibraryPath)
$(OutDir)$(ProjectName)\
diff --git a/tools/apps/hgjson/hgjsonDlg.cpp b/tools/apps/hgjson/hgjsonDlg.cpp
index bbbb4d6..bdddb79 100644
--- a/tools/apps/hgjson/hgjsonDlg.cpp
+++ b/tools/apps/hgjson/hgjsonDlg.cpp
@@ -17,6 +17,7 @@
#include
#include
#include
+#include
#define TREE_ITEM_PRODUCT MAKELONG(MAKEWORD('P', 'R'), MAKEWORD('D', 'T'))
#define TREE_ITEM_GROUP MAKELONG(MAKEWORD('G', 'R'), MAKEWORD('U', 'P'))
@@ -27,15 +28,6 @@
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// sane data types:
-typedef unsigned char SANE_Byte;
-typedef int SANE_Word;
-typedef SANE_Word SANE_Bool;
-typedef SANE_Word SANE_Int;
-typedef char SANE_Char;
-typedef SANE_Char *SANE_String;
-typedef const SANE_Char *SANE_String_Const;
-typedef void *SANE_Handle;
-typedef SANE_Word SANE_Fixed;
namespace coding
@@ -6240,19 +6232,23 @@ void ChgjsonDlg::set_control_status(const HGITEM& item)
void* ChgjsonDlg::create_json(int item, std::vector* def_h)
{
known_file_util::IJsonW* jsn = known_file_util::create_jsonW();
- wchar_t buf[128] = { 0 };
+ wchar_t buf[128] = { 0 };
+ int prefer_size = 0;
jsn->set_value(L"category", hg_items_[item].advanced ? L"advanced" : L"base");
- if(hg_items_[item].title == L"\u4F3D\u739B")
- jsn->set_value(L"name", L"gamma");
+ if (hg_items_[item].title == L"\u81EA\u5B9A\u4E49\u4F3D\u739B")
+ {
+ jsn->set_value(L"name", coding::a2u(KNOWN_OPT_NAME_CUSTOM_GAMMA).c_str());
+ prefer_size = 3 * 256 * sizeof(SANE_Int);
+ }
else if (hg_items_[item].title == L"\u626B\u63CF\u533A\u57DF\u5DE6\u4FA7\uFF08mm\uFF09")
- jsn->set_value(L"name", L"tl-x");
+ jsn->set_value(L"name", coding::a2u(KNOWN_OPT_NAME_CUSTOM_AREA_LEFT).c_str());
else if (hg_items_[item].title == L"\u626B\u63CF\u533A\u57DF\u4E0A\u4FA7\uFF08mm\uFF09")
- jsn->set_value(L"name", L"tl-y");
+ jsn->set_value(L"name", coding::a2u(KNOWN_OPT_NAME_CUSTOM_AREA_TOP).c_str());
else if (hg_items_[item].title == L"\u626B\u63CF\u533A\u57DF\u53F3\u4FA7\uFF08mm\uFF09")
- jsn->set_value(L"name", L"br-x");
+ jsn->set_value(L"name", coding::a2u(KNOWN_OPT_NAME_CUSTOM_AREA_RIGHT).c_str());
else if (hg_items_[item].title == L"\u626B\u63CF\u533A\u57DF\u4E0B\u4FA7\uFF08mm\uFF09")
- jsn->set_value(L"name", L"br-y");
+ jsn->set_value(L"name", coding::a2u(KNOWN_OPT_NAME_CUSTOM_AREA_BOTTOM).c_str());
else
{
swprintf_s(buf, _countof(buf) - 1, L"cfg-%d", hg_items_[item].index);
@@ -6358,6 +6354,8 @@ void* ChgjsonDlg::create_json(int item, std::vector* def_h)
jsn->set_value(L"depend_and", d);
d->release();
}
+ if(prefer_size)
+ jsn->set_value(L"size", prefer_size);
return jsn;
}
diff --git a/tools/solution/Release/hgjson.exe b/tools/solution/Release/hgjson.exe
index 79f1ba1..33f57cd 100644
Binary files a/tools/solution/Release/hgjson.exe and b/tools/solution/Release/hgjson.exe differ