twain3.0/huagao/Device/G400ScanConfig.cpp

34 lines
1.1 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "G400ScanConfig.h"
G400ScanConfig::G400ScanConfig(GScanCap& gcap)
{
cfg.params.doubleFeeded = gcap.hardwarecaps.en_doublefeed == 0 ? 0 : 1;
cfg.params.dpi = G400_DPI::G400_D200;//gcap.resolution_dst <= 200.0f ? G400_DPI::G400_D200 : (gcap.resolution_dst <= 300.0f ? G400_DPI::G400_D300 : G400_DPI::G400_D600);
cfg.params.enableLed = 1;
if (gcap.filter != 3 || gcap.enhance_color)
cfg.params.isColor = 1;
else
cfg.params.isColor = SupPixelTypes[gcap.pixtype];
cfg.params.enableStable = 0;//gcap.hardwarecaps.en_stapledetect==0?0:1;
cfg.params.isCorrect = 1;//1 »úÆ÷УÕý
PaperStatus ps = { gcap.papertype,gcap.paperAlign };
cfg.params.pageSize = SupPaperTyps[ps];
CSize size;
#ifdef G300
size = PaperSize.GetPaperSize(TwSS::A4, 200.0f, gcap.paperAlign);//G300 ×î´óÖ§³ÖA4·ùÃæ
#else
size = PaperSize.GetPaperSize(gcap.papertype, 200.0f, gcap.paperAlign);
#endif// G300
cfg.params.dstHeight = (int)((size.cy+200)/100);
cfg.params.reversed1 = cfg.params.reversed2 = 0;
}
G400ScanConfig::~G400ScanConfig()
{
}
unsigned int G400ScanConfig::GetData()
{
return cfg.value;
}