2020-03-11 01:58:06 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
#include "scn_config.h"
|
|
|
|
#include "math.h"
|
|
|
|
|
|
|
|
hgConfigClass::hgConfigClass(GScanCap param)
|
|
|
|
{
|
2020-05-16 01:59:44 +00:00
|
|
|
m_param = { 0 };
|
2020-03-11 01:58:06 +00:00
|
|
|
PaperStatus ps = { param.papertype,param.paperAlign };
|
|
|
|
m_param.paper = ContainspaperTypesKey(ps) ? SupPaperTyps[ps] : 0;
|
2020-06-23 09:16:45 +00:00
|
|
|
if(param.filter!=3||param.enhance_color!=0||param.hsvcorrect)
|
2020-06-20 03:15:56 +00:00
|
|
|
m_param.color = 1;//color
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_param.color = ContainsPixTypeKey(param.pixtype) ? SupPixelTypes[param.pixtype] : 2;
|
|
|
|
|
|
|
|
}
|
|
|
|
m_param.dpi = ContainsResolutionKey(param.resolution_native) ? SupResolutions[param.resolution_native] : 1;
|
|
|
|
m_param.double_feed_enbale = (unsigned int)param.hardwarecaps.en_doublefeed;
|
|
|
|
m_param.stable_enbale =(unsigned int) param.hardwarecaps.en_stapledetect;
|
|
|
|
m_param.screw_detect_enable = (unsigned int)param.hardwarecaps.en_skrewdetect;
|
|
|
|
m_param.screw_detect_level = (unsigned int)m_param.screw_detect_enable? secrewMaps[param.hardwarecaps.skrewdetectlevel]:0;
|
2020-04-18 03:18:06 +00:00
|
|
|
#ifdef G200
|
2020-03-11 01:58:06 +00:00
|
|
|
m_param.pc_correct = 0;
|
2020-04-18 03:18:06 +00:00
|
|
|
#endif
|
2020-03-11 01:58:06 +00:00
|
|
|
m_param.unused_one = m_param.unused_two = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hgConfigClass::ContainspaperTypesKey(PaperStatus key)
|
|
|
|
{
|
|
|
|
if (SupPaperTyps.count(key) > 0)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hgConfigClass::ContainsPixTypeKey(uint16_t key)
|
|
|
|
{
|
|
|
|
if (SupPixelTypes.count(key)>0)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hgConfigClass::ContainsResolutionKey(float key)
|
|
|
|
{
|
|
|
|
if ( SupResolutions.count(key)>0)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
2020-05-16 01:59:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int hgConfigClass::GetData()
|
|
|
|
{
|
|
|
|
return m_param.value;
|
|
|
|
}
|