修复部分属性BUG
This commit is contained in:
parent
86bcadd095
commit
9677f8354f
|
@ -223,13 +223,13 @@ namespace sane_opt_trans
|
|||
|
||||
const char* auto_color_type_from_twain(int val)
|
||||
{
|
||||
VALUE_FROM_TWAIN(g_auto_color_map, val);
|
||||
VALUE_FROM_TWAIN(g_color_mode_map, val);
|
||||
|
||||
return OPTION_VALUE_YSMS_24WCS;
|
||||
}
|
||||
int auto_color_type_to_twain(const char* val)
|
||||
{
|
||||
VALUE_TO_TWAIN(g_auto_color_map, val);
|
||||
VALUE_TO_TWAIN(g_color_mode_map, val);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -1611,6 +1611,8 @@ void huagao_ds::init_support_caps(void)
|
|||
{
|
||||
if(msg == Msg::Set)
|
||||
init = (int)data.currentItem<CapType::ISupportedSizes>();
|
||||
else
|
||||
data = Capability::createOneValue<CapType::ISupportedSizes>((Twpp::PaperSize)init);
|
||||
|
||||
SET_SANE_OPT(now, scanner_, ex_paper, &init);
|
||||
return now == SCANNER_ERR_OK ? success() : badValue();
|
||||
|
@ -1707,6 +1709,7 @@ void huagao_ds::init_support_caps(void)
|
|||
init = (int)data.currentItem<CapType::IPixelType>();
|
||||
int ret = SCANNER_ERR_OK;
|
||||
SET_SANE_OPT(ret, scanner_, ex_color_mode, &init);
|
||||
data = Capability::createOneValue<CapType::IPixelType>((Twpp::PixelType)init);
|
||||
return ret == SCANNER_ERR_OK ? success() : badValue();
|
||||
}
|
||||
switch (msg) {
|
||||
|
@ -1737,12 +1740,12 @@ void huagao_ds::init_support_caps(void)
|
|||
if (Msg::Set == msg) {
|
||||
auto mech = data.currentItem<CapType::IAutomaticColorEnabled>();
|
||||
int ret = SCANNER_ERR_OK, val = mech ? COLOR_AUTO_MATCH : COLOR_RGB;
|
||||
SET_SANE_OPT(ret, scanner_, color_mode, &val);
|
||||
SET_SANE_OPT(ret, scanner_, ex_auto_color_type, &val);
|
||||
|
||||
return success();
|
||||
}
|
||||
int cur = 0;
|
||||
GET_SANE_OPT(int, scanner_, color_mode, &cur, NULL, NULL, NULL);
|
||||
GET_SANE_OPT(int, scanner_, ex_auto_color_type, &cur, NULL, NULL, NULL);
|
||||
int twpt = cur == COLOR_AUTO_MATCH ? 1 : 0;
|
||||
return CapSupGetAllReset<int, Bool, CapType::IAutomaticColorEnabled>(msg, data, { FALSE,TRUE }, twpt, false, twpt ? 1 : 0, 0);
|
||||
};
|
||||
|
@ -1794,7 +1797,7 @@ void huagao_ds::init_support_caps(void)
|
|||
// q = (unsigned short)fif.detail;
|
||||
//return CapSupGetAllResetEx<unsigned short, UInt16, CapType::IJpegQuality>(msg, data, q, 80);
|
||||
unsigned short q = m_jpegQuality;
|
||||
return CapSupGetAllResetEx<unsigned short, UInt16, CapType::IJpegQuality>(msg, data, q, 80);
|
||||
return CapSupGetAllResetEx<unsigned short, UInt16, CapType::IJpegQuality>(msg, data, q, (UInt16)80);
|
||||
};
|
||||
|
||||
m_query[CapType::IOrientation] = msgSupportGetAllSetReset;
|
||||
|
@ -1965,7 +1968,9 @@ void huagao_ds::init_support_caps(void)
|
|||
m_autoscan = autoscan;
|
||||
return success();
|
||||
}
|
||||
return CapSupGetAllReset<Bool, Bool, CapType::AutoScan>(msg, data, m_autoscan, FALSE);
|
||||
//data = Capability::createOneValue<Bool>(CapType::AutoScan, m_autoscan);
|
||||
//return success();
|
||||
return CapSupGetAllReset<Bool, Bool, CapType::AutoScan>(msg, data, m_autoscan, FALSE);
|
||||
};
|
||||
|
||||
m_query[CapType::IAutoSize] = msgSupportGetAllSetReset;
|
||||
|
|
Loading…
Reference in New Issue