twain协议增加脏污检测

This commit is contained in:
yangjiaxuan 2023-11-02 15:31:32 +08:00
parent 43ecb3f8cf
commit 90c021bc64
2 changed files with 15 additions and 1 deletions

View File

@ -2926,6 +2926,18 @@ COM_API_IMPLEMENT(scanner, bool, get_option_info(int sn, value_type* type, value
\ \
return true; \ return true; \
} }
#define SIMPLE_BOOL_INFO(id, rdo) \
if (sn == id) \
{ \
if (type) \
*type = VAL_TYPE_BOOL; \
if (limit) \
*limit = rdo ? VAL_LIMIT_READONLY : VAL_LIMIT_NONE; \
if (bytes) \
*bytes = sizeof(int); \
\
return true; \
}
SIMPLE_STR_INFO(SANE_OPT_ID_DRIVER_VERSION, true); SIMPLE_STR_INFO(SANE_OPT_ID_DRIVER_VERSION, true);
@ -2951,6 +2963,7 @@ COM_API_IMPLEMENT(scanner, bool, get_option_info(int sn, value_type* type, value
SIMPLE_INT_INFO(SANE_OPT_ID_PID, true); SIMPLE_INT_INFO(SANE_OPT_ID_PID, true);
SIMPLE_INT_INFO(SANE_OPT_ID_ROLLER_LIFE, true); SIMPLE_INT_INFO(SANE_OPT_ID_ROLLER_LIFE, true);
SIMPLE_STR_INFO(SANE_OPT_ID_INITIAL_BOOT_TIME, true); SIMPLE_STR_INFO(SANE_OPT_ID_INITIAL_BOOT_TIME, true);
SIMPLE_BOOL_INFO(SANE_OPT_ID_LENS_DIRTY, false);
sn = transfer_id(sn); sn = transfer_id(sn);
if (sn == -1) if (sn == -1)

View File

@ -3530,7 +3530,8 @@ void huagao_ds::init_support_caps_ex(void)
ADD_SANE_CAP(FOLD_TYPE); ADD_SANE_CAP(FOLD_TYPE);
ADD_SANE_CAP(COLOR_CORRECTION); ADD_SANE_CAP(COLOR_CORRECTION);
ADD_SANE_CAP(DISCARDBLANK); ADD_SANE_CAP(DISCARDBLANK);
ADD_SANE_CAP(LENS_DIRTY);
#define GET_ONLY_CAP(name, ctype, ttype) \ #define GET_ONLY_CAP(name, ctype, ttype) \
m_query[(CapType)SANE_OPT_ID_##name] = MsgSupport::GetCurrent; \ m_query[(CapType)SANE_OPT_ID_##name] = MsgSupport::GetCurrent; \
m_caps[(CapType)SANE_OPT_ID_##name] = [this](Msg msg, Capability& data) -> Result { \ m_caps[(CapType)SANE_OPT_ID_##name] = [this](Msg msg, Capability& data) -> Result { \