添加不同dpi畸变设置
This commit is contained in:
parent
a285d89660
commit
6a0ecd826c
|
@ -329,6 +329,18 @@ enum Scanner_Reg_Defs
|
||||||
SR_CLR_ROLLER_NUM,
|
SR_CLR_ROLLER_NUM,
|
||||||
SR_GET_ROLLER_NUM,
|
SR_GET_ROLLER_NUM,
|
||||||
SR_CLR_SCANN_NUM,
|
SR_CLR_SCANN_NUM,
|
||||||
|
SR_GET_H_200_RATIO,
|
||||||
|
SR_SET_H_200_RATIO,
|
||||||
|
SR_GET_V_200_RATIO,
|
||||||
|
SR_SET_V_200_RATIO,
|
||||||
|
SR_GET_H_300_RATIO,
|
||||||
|
SR_SET_H_300_RATIO,
|
||||||
|
SR_GET_V_300_RATIO,
|
||||||
|
SR_SET_V_300_RATIO,
|
||||||
|
SR_GET_H_600_RATIO,
|
||||||
|
SR_SET_H_600_RATIO,
|
||||||
|
SR_GET_V_600_RATIO,
|
||||||
|
SR_SET_V_600_RATIO,
|
||||||
SR_UPDATA_START = 0x100,
|
SR_UPDATA_START = 0x100,
|
||||||
SR_UPDATA_STAUTUS = 0x101,
|
SR_UPDATA_STAUTUS = 0x101,
|
||||||
SR_UPDATA_MD5_RELUST = 0x102,
|
SR_UPDATA_MD5_RELUST = 0x102,
|
||||||
|
|
|
@ -200,11 +200,23 @@ std::string gscan3399::GetKernelVersion()
|
||||||
void gscan3399::SetRatio(int tyepe, int ration,int dpi)
|
void gscan3399::SetRatio(int tyepe, int ration,int dpi)
|
||||||
{
|
{
|
||||||
scanner_write_reg(m_usb, tyepe == 0 ? SR_SET_H_RATIO : SR_SET_V_RATIO, ration);
|
scanner_write_reg(m_usb, tyepe == 0 ? SR_SET_H_RATIO : SR_SET_V_RATIO, ration);
|
||||||
|
if (dpi == 1)
|
||||||
|
scanner_write_reg(m_usb, tyepe == 0 ? SR_SET_H_200_RATIO : SR_SET_V_200_RATIO, ration);
|
||||||
|
else if(dpi == 2)
|
||||||
|
scanner_write_reg(m_usb, tyepe == 0 ? SR_SET_H_300_RATIO : SR_SET_V_300_RATIO, ration);
|
||||||
|
else
|
||||||
|
scanner_write_reg(m_usb, tyepe == 0 ? SR_SET_H_600_RATIO : SR_SET_V_600_RATIO, ration);
|
||||||
}
|
}
|
||||||
void gscan3399::GetRatio(int type, int& ratio,int dpi)
|
void gscan3399::GetRatio(int type, int& ratio,int dpi)
|
||||||
{
|
{
|
||||||
ratio = scanner_read_reg(m_usb, type == 0 ? SR_GET_H_RATIO : SR_GET_V_RATIO);
|
if (dpi == 1)
|
||||||
|
ratio = scanner_read_reg(m_usb, type == 0 ? SR_GET_H_200_RATIO : SR_GET_V_200_RATIO);
|
||||||
|
else if (dpi == 2)
|
||||||
|
ratio = scanner_read_reg(m_usb, type == 0 ? SR_GET_H_300_RATIO : SR_GET_V_300_RATIO);
|
||||||
|
else
|
||||||
|
ratio = scanner_read_reg(m_usb, type == 0 ? SR_GET_H_600_RATIO : SR_GET_V_600_RATIO);
|
||||||
|
if(*((float*)&ratio) >1.2 || *((float*)&ratio) < 0.8)
|
||||||
|
ratio = scanner_read_reg(m_usb, type == 0 ? SR_GET_H_RATIO : SR_GET_V_RATIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gscan3399::Reboot(bool loader)
|
void gscan3399::Reboot(bool loader)
|
||||||
|
|
Loading…
Reference in New Issue