修复颜色增强属性BUG
This commit is contained in:
parent
3f8f50e322
commit
bf80eb1cbd
|
@ -721,6 +721,8 @@ struct
|
|||
}g_enhance[] = { {Filter::Red, ENHANCE_RED}, {Filter::Green, ENHANCE_GREEN}, {Filter::Blue, ENHANCE_BLUE}, {Filter::None, ENHANCE_NONE} };
|
||||
Filter from_sane_enhance(int sane)
|
||||
{
|
||||
return (Filter)sane;
|
||||
|
||||
for (int i = 0; i < _countof(g_filter); ++i)
|
||||
{
|
||||
if (g_filter[i].sane == sane)
|
||||
|
@ -731,6 +733,8 @@ Filter from_sane_enhance(int sane)
|
|||
}
|
||||
int to_sane_enhance(Filter twain)
|
||||
{
|
||||
return (int)twain;
|
||||
|
||||
for (int i = 0; i < _countof(g_filter); ++i)
|
||||
{
|
||||
if (g_filter[i].twain == twain)
|
||||
|
@ -3201,19 +3205,19 @@ void huagao_ds::init_support_caps(void)
|
|||
if (Msg::Set == msg || Msg::Reset == msg) {
|
||||
if (Msg::Set == msg)
|
||||
def = data.currentItem<UInt32>();
|
||||
int ret = SCANNER_ERR_OK;
|
||||
SET_SANE_OPT_EX(ret, scanner_, ex_color_enhance, &def);
|
||||
int ret = SCANNER_ERR_OK, val = to_sane_enhance((Filter)def);;
|
||||
SET_SANE_OPT_EX(ret, scanner_, ex_color_enhance, &val);
|
||||
return ret == SCANNER_ERR_OK ? success() : badValue();
|
||||
}
|
||||
|
||||
std::list<Filter> vs;
|
||||
Filter now = from_sane_filter(cur), init = from_sane_filter(def);
|
||||
std::list<UInt32> vs;
|
||||
UInt32 now = (UInt32)from_sane_enhance(cur), init = (UInt32)from_sane_enhance(def);
|
||||
UInt32 curInd = distance<int>(vals, cur), defInd = distance<int>(vals, def);
|
||||
|
||||
for (size_t i = sane_opts::RANGE_POS_ENUM_BEGIN; i < vals.size(); ++i)
|
||||
vs.push_back(from_sane_filter(vals[i]));
|
||||
vs.push_back((UInt32)from_sane_enhance(vals[i]));
|
||||
UInt32 val = (UInt32)now;
|
||||
return CapSupGetAllResetEx<UInt32, Filter, (CapType)CapTypeEx::CAP_TYPE_EX_ENHANCE_COLOR>(msg, data, vs, val, init, curInd, defInd);
|
||||
return CapSupGetAllResetEx<UInt32, UInt32, (CapType)CapTypeEx::CAP_TYPE_EX_ENHANCE_COLOR>(msg, data, vs, val, init, curInd, defInd);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue