Merge branch 'master' of http://192.168.100.140:8099/sane/code_device
This commit is contained in:
commit
86bbca92cb
|
@ -2506,6 +2506,8 @@ int hg_scanner::device_io_control(unsigned long code, void* data, unsigned* len)
|
|||
SANE_Gamma* v = (SANE_Gamma*)data;
|
||||
|
||||
memcpy(v, custom_gamma_val_, sizeof(*custom_gamma_val_));
|
||||
if (len)
|
||||
*len = image_prc_param_.bits.color_mode;
|
||||
|
||||
return SCANNER_ERR_OK;
|
||||
}
|
||||
|
|
|
@ -506,15 +506,38 @@ extern "C"
|
|||
}
|
||||
std::string local_data_path(void)
|
||||
{
|
||||
#ifdef WIN32
|
||||
std::string env("LOCALAPPDATA"), lead("");
|
||||
#else
|
||||
std::string env("HOME"), lead(".");
|
||||
#endif
|
||||
char* tmp = getenv(env.c_str());
|
||||
std::string home(tmp ? tmp : "");
|
||||
static std::string local_data_path("");
|
||||
static bool load_first = true;
|
||||
|
||||
home += PATH_SEPARATOR + lead;
|
||||
if (load_first)
|
||||
{
|
||||
simple_ini first;
|
||||
|
||||
load_first = false;
|
||||
if (first.load((get_scanner_path() + "first.cfg").c_str()) == 0)
|
||||
{
|
||||
std::string env = first.get("constraints", "local_data_path");
|
||||
if (env.length())
|
||||
local_data_path = env;
|
||||
}
|
||||
}
|
||||
|
||||
std::string home(local_data_path);
|
||||
|
||||
if (home.empty())
|
||||
{
|
||||
#ifdef WIN32
|
||||
std::string env("LOCALAPPDATA"), lead("");
|
||||
#else
|
||||
std::string env("HOME"), lead(".");
|
||||
#endif
|
||||
char* tmp = getenv(env.c_str());
|
||||
|
||||
if (tmp)
|
||||
home = tmp;
|
||||
|
||||
home += PATH_SEPARATOR + lead;
|
||||
}
|
||||
|
||||
#ifdef OEM_HANWANG
|
||||
home += "HanvonScan";
|
||||
|
|
Loading…
Reference in New Issue