kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Use session for pixel coordinates during calibration
rodzic
28b216513e
commit
ab62a1448c
|
@ -1793,21 +1793,20 @@ static void gl124_send_shading_data(Genesys_Device* dev, const Genesys_Sensor& s
|
|||
uint8_t* data, int size)
|
||||
{
|
||||
DBG_HELPER_ARGS(dbg, "writing %d bytes of shading data", size);
|
||||
uint32_t addr, length, strpixel ,endpixel, x, factor, segcnt, pixels, i;
|
||||
uint32_t addr, length, x, factor, segcnt, pixels, i;
|
||||
uint32_t lines, channels;
|
||||
uint16_t dpiset,dpihw;
|
||||
uint8_t *ptr, *src;
|
||||
|
||||
/* logical size of a color as seen by generic code of the frontend */
|
||||
length = (uint32_t) (size / 3);
|
||||
strpixel = dev->reg.get24(REG_STRPIXEL);
|
||||
endpixel = dev->reg.get24(REG_ENDPIXEL);
|
||||
std::uint32_t strpixel = dev->session.pixel_startx;
|
||||
std::uint32_t endpixel = dev->session.pixel_endx;
|
||||
segcnt = dev->reg.get24(REG_SEGCNT);
|
||||
if(endpixel==0)
|
||||
{
|
||||
endpixel=segcnt;
|
||||
}
|
||||
DBG( DBG_io2, "%s: STRPIXEL=%d, ENDPIXEL=%d, PIXELS=%d, SEGCNT=%d\n",__func__,strpixel,endpixel,endpixel-strpixel,segcnt);
|
||||
|
||||
/* compute deletion factor */
|
||||
dpiset = dev->reg.get16(REG_DPISET);
|
||||
|
|
|
@ -4271,7 +4271,7 @@ static void gl841_send_shading_data(Genesys_Device* dev, const Genesys_Sensor& s
|
|||
DBG_HELPER_ARGS(dbg, "writing %d bytes of shading data", size);
|
||||
uint32_t length, x, factor, pixels, i;
|
||||
uint32_t lines, channels;
|
||||
uint16_t dpiset, dpihw, strpixel ,endpixel, beginpixel;
|
||||
uint16_t dpiset, dpihw, beginpixel;
|
||||
uint8_t *ptr,*src;
|
||||
|
||||
/* old method if no SHDAREA */
|
||||
|
@ -4287,10 +4287,8 @@ static void gl841_send_shading_data(Genesys_Device* dev, const Genesys_Sensor& s
|
|||
|
||||
/* data is whole line, we extract only the part for the scanned area */
|
||||
length = (uint32_t) (size / 3);
|
||||
strpixel = dev->reg.get16(REG_STRPIXEL);
|
||||
endpixel = dev->reg.get16(REG_ENDPIXEL);
|
||||
DBG(DBG_io2, "%s: STRPIXEL=%d, ENDPIXEL=%d, PIXELS=%d\n", __func__, strpixel, endpixel,
|
||||
endpixel-strpixel);
|
||||
unsigned strpixel = dev->session.pixel_startx;
|
||||
unsigned endpixel = dev->session.pixel_endx;
|
||||
|
||||
/* compute deletion/average factor */
|
||||
dpiset = dev->reg.get16(REG_DPISET);
|
||||
|
|
|
@ -1571,7 +1571,7 @@ static void gl846_send_shading_data(Genesys_Device* dev, const Genesys_Sensor& s
|
|||
{
|
||||
DBG_HELPER_ARGS(dbg, "writing %d bytes of shading data", size);
|
||||
uint32_t addr, length, i, x, factor, pixels;
|
||||
uint32_t dpiset, dpihw, strpixel, endpixel;
|
||||
uint32_t dpiset, dpihw;
|
||||
uint32_t lines;
|
||||
uint8_t val,*ptr,*src;
|
||||
|
||||
|
@ -1582,13 +1582,11 @@ static void gl846_send_shading_data(Genesys_Device* dev, const Genesys_Sensor& s
|
|||
write(0x10068000,0x00000dd8)
|
||||
*/
|
||||
length = (uint32_t) (size / 3);
|
||||
strpixel = dev->reg.get16(REG_STRPIXEL);
|
||||
endpixel = dev->reg.get16(REG_ENDPIXEL);
|
||||
unsigned strpixel = dev->session.pixel_startx;
|
||||
unsigned endpixel = dev->session.pixel_endx;
|
||||
|
||||
/* compute deletion factor */
|
||||
dpiset = dev->reg.get16(REG_DPISET);
|
||||
DBG(DBG_io2, "%s: STRPIXEL=%d, ENDPIXEL=%d, PIXELS=%d, DPISET=%d\n", __func__, strpixel, endpixel,
|
||||
endpixel-strpixel, dpiset);
|
||||
dpihw = sensor.get_register_hwdpi(dpiset);
|
||||
factor=dpihw/dpiset;
|
||||
DBG(DBG_io2, "%s: factor=%d\n", __func__, factor);
|
||||
|
|
|
@ -1620,7 +1620,7 @@ static void gl847_send_shading_data(Genesys_Device* dev, const Genesys_Sensor& s
|
|||
{
|
||||
DBG_HELPER_ARGS(dbg, "writing %d bytes of shading data", size);
|
||||
uint32_t addr, length, i, x, factor, pixels;
|
||||
uint32_t dpiset, dpihw, strpixel, endpixel;
|
||||
uint32_t dpiset, dpihw;
|
||||
uint32_t lines;
|
||||
uint8_t val,*ptr,*src;
|
||||
|
||||
|
@ -1631,13 +1631,11 @@ static void gl847_send_shading_data(Genesys_Device* dev, const Genesys_Sensor& s
|
|||
write(0x10068000,0x00000dd8)
|
||||
*/
|
||||
length = (uint32_t) (size / 3);
|
||||
strpixel = dev->reg.get16(REG_STRPIXEL);
|
||||
endpixel = dev->reg.get16(REG_ENDPIXEL);
|
||||
std::uint32_t strpixel = dev->session.pixel_startx;
|
||||
std::uint32_t endpixel = dev->session.pixel_endx;
|
||||
|
||||
/* compute deletion factor */
|
||||
dpiset = dev->reg.get16(REG_DPISET);
|
||||
DBG(DBG_io2, "%s: STRPIXEL=%d, ENDPIXEL=%d, PIXELS=%d, DPISET=%d\n", __func__, strpixel, endpixel,
|
||||
endpixel-strpixel, dpiset);
|
||||
dpihw = sensor.get_register_hwdpi(dpiset);
|
||||
factor=dpihw/dpiset;
|
||||
DBG(DBG_io2, "%s: factor=%d\n", __func__, factor);
|
||||
|
|
Ładowanie…
Reference in New Issue