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;
|
SANE_Gamma* v = (SANE_Gamma*)data;
|
||||||
|
|
||||||
memcpy(v, custom_gamma_val_, sizeof(*custom_gamma_val_));
|
memcpy(v, custom_gamma_val_, sizeof(*custom_gamma_val_));
|
||||||
|
if (len)
|
||||||
|
*len = image_prc_param_.bits.color_mode;
|
||||||
|
|
||||||
return SCANNER_ERR_OK;
|
return SCANNER_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -506,15 +506,38 @@ extern "C"
|
||||||
}
|
}
|
||||||
std::string local_data_path(void)
|
std::string local_data_path(void)
|
||||||
{
|
{
|
||||||
|
static std::string local_data_path("");
|
||||||
|
static bool load_first = true;
|
||||||
|
|
||||||
|
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
|
#ifdef WIN32
|
||||||
std::string env("LOCALAPPDATA"), lead("");
|
std::string env("LOCALAPPDATA"), lead("");
|
||||||
#else
|
#else
|
||||||
std::string env("HOME"), lead(".");
|
std::string env("HOME"), lead(".");
|
||||||
#endif
|
#endif
|
||||||
char* tmp = getenv(env.c_str());
|
char* tmp = getenv(env.c_str());
|
||||||
std::string home(tmp ? tmp : "");
|
|
||||||
|
if (tmp)
|
||||||
|
home = tmp;
|
||||||
|
|
||||||
home += PATH_SEPARATOR + lead;
|
home += PATH_SEPARATOR + lead;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef OEM_HANWANG
|
#ifdef OEM_HANWANG
|
||||||
home += "HanvonScan";
|
home += "HanvonScan";
|
||||||
|
|
Loading…
Reference in New Issue