twain3.0/huagao/Device/scn_config.cpp

44 lines
1.2 KiB
C++
Raw Normal View History

#include "stdafx.h"
#include "scn_config.h"
#include "math.h"
hgConfigClass::hgConfigClass(GScanCap param)
{
PaperStatus ps = { param.papertype,param.paperAlign };
m_param.paper = ContainspaperTypesKey(ps) ? SupPaperTyps[ps] : 0;
m_param.color = ContainsPixTypeKey(param.hardwarecaps.capturepixtype) ? SupPixelTypes[param.hardwarecaps.capturepixtype] : 2;
m_param.dpi = 1;//Ĭ<><C4AC> 200dpi ContainsResolutionKey(param.resolution_native) ? SupResolutions[param.resolution_native] :
m_param.double_feed_enbale = param.hardwarecaps.en_doublefeed;
m_param.stable_enbale = param.hardwarecaps.en_stapledetect;
m_param.screw_detect_enable = param.hardwarecaps.en_skrewdetect;
m_param.screw_detect_level = m_param.screw_detect_enable? secrewMaps[param.hardwarecaps.skrewdetectlevel]:0;
m_param.pc_correct = 0;
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;
}