kopia lustrzana https://gitlab.com/sane-project/backends
odd/even handling step2
- shading coefficients are too short and truncate picture - need to compute startx - SHDAREA should be doablemerge-requests/1/head
rodzic
304d84d5e1
commit
a78b0edee7
|
@ -3972,8 +3972,7 @@ genesys_flatbed_calibration (Genesys_Device * dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pixels_per_line = (SANE_UNFIX (dev->model->x_size) * dev->settings.xres) /
|
pixels_per_line = (SANE_UNFIX (dev->model->x_size) * dev->settings.xres) / MM_PER_INCH;
|
||||||
MM_PER_INCH;
|
|
||||||
|
|
||||||
/* send default shading data */
|
/* send default shading data */
|
||||||
status = sanei_genesys_init_shading_data (dev, pixels_per_line);
|
status = sanei_genesys_init_shading_data (dev, pixels_per_line);
|
||||||
|
@ -4983,7 +4982,7 @@ genesys_fill_read_buffer (Genesys_Device * dev)
|
||||||
#ifdef SANE_DEBUG_LOG_RAW_DATA
|
#ifdef SANE_DEBUG_LOG_RAW_DATA
|
||||||
if (rawfile != NULL)
|
if (rawfile != NULL)
|
||||||
{
|
{
|
||||||
fwrite (dev->oe_buffer.buffer, dev->oe_buffer.size, 1, rawfile);
|
fwrite (dev->oe_buffer.buffer, dev->oe_buffer.avail, 1, rawfile);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -5030,7 +5029,7 @@ genesys_fill_read_buffer (Genesys_Device * dev)
|
||||||
#ifdef SANE_DEBUG_LOG_RAW_DATA
|
#ifdef SANE_DEBUG_LOG_RAW_DATA
|
||||||
if (rawfile != NULL)
|
if (rawfile != NULL)
|
||||||
{
|
{
|
||||||
fwrite (dev->oe_buffer.buffer, dev->oe_buffer.size, 1, rawfile);
|
fwrite (dev->oe_buffer.buffer, dev->oe_buffer.avail, 1, rawfile);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -5165,6 +5164,7 @@ genesys_read_ordered_data (Genesys_Device * dev, SANE_Byte * destination,
|
||||||
rawfile = fopen ("raw.pnm", "wb");
|
rawfile = fopen ("raw.pnm", "wb");
|
||||||
if (rawfile != NULL)
|
if (rawfile != NULL)
|
||||||
{
|
{
|
||||||
|
if (!(dev->model->flags & GENESYS_FLAG_ODD_EVEN_CIS))
|
||||||
fprintf (rawfile,
|
fprintf (rawfile,
|
||||||
"P%c\n%d %d\n%d\n",
|
"P%c\n%d %d\n%d\n",
|
||||||
dev->current_setup.channels == 1 ?
|
dev->current_setup.channels == 1 ?
|
||||||
|
@ -5172,6 +5172,14 @@ genesys_read_ordered_data (Genesys_Device * dev, SANE_Byte * destination,
|
||||||
dev->current_setup.pixels,
|
dev->current_setup.pixels,
|
||||||
dev->current_setup.lines,
|
dev->current_setup.lines,
|
||||||
(1 << dev->current_setup.depth) - 1);
|
(1 << dev->current_setup.depth) - 1);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fprintf (rawfile,
|
||||||
|
"P5\n%d %d\n%d\n",
|
||||||
|
dev->sensor.sensor_pixels*3,
|
||||||
|
dev->current_setup.lines,
|
||||||
|
(1 << dev->current_setup.depth) - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -432,7 +432,7 @@ static Genesys_Sensor Sensor[] = {
|
||||||
87, /* black pixels */
|
87, /* black pixels */
|
||||||
16, /* dummy pixels */
|
16, /* dummy pixels */
|
||||||
0,
|
0,
|
||||||
10272,
|
10272, /* 10272 */
|
||||||
210,
|
210,
|
||||||
200,
|
200,
|
||||||
{0x00, 0x00, 0x00, 0x00},
|
{0x00, 0x00, 0x00, 0x00},
|
||||||
|
@ -935,7 +935,7 @@ static Genesys_Model canon_lide_100_model = {
|
||||||
{16, 8, 0}, /* possible depths in gray mode */
|
{16, 8, 0}, /* possible depths in gray mode */
|
||||||
{16, 8, 0}, /* possible depths in color mode */
|
{16, 8, 0}, /* possible depths in color mode */
|
||||||
|
|
||||||
SANE_FIX (6.95), /* Start of scan area in mm (x) */
|
SANE_FIX (6.0), /* Start of scan area in mm (x) 6.95 */
|
||||||
SANE_FIX (30.0), /* Start of scan area in mm (y) */
|
SANE_FIX (30.0), /* Start of scan area in mm (y) */
|
||||||
SANE_FIX (216.07), /* Size of scan area in mm (x) */
|
SANE_FIX (216.07), /* Size of scan area in mm (x) */
|
||||||
SANE_FIX (299.0), /* Size of scan area in mm (y) */
|
SANE_FIX (299.0), /* Size of scan area in mm (y) */
|
||||||
|
|
|
@ -1428,7 +1428,14 @@ gl847_init_optical_regs_scan (Genesys_Device * dev,
|
||||||
exposure_time,
|
exposure_time,
|
||||||
used_res, start, pixels, channels, depth, half_ccd, flags);
|
used_res, start, pixels, channels, depth, half_ccd, flags);
|
||||||
|
|
||||||
used_pixels = dev->sensor.sensor_pixels;
|
if(pixels<dev->sensor.sensor_pixels)
|
||||||
|
{
|
||||||
|
used_pixels = dev->sensor.sensor_pixels;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
used_pixels = pixels;
|
||||||
|
}
|
||||||
end = start + used_pixels;
|
end = start + used_pixels;
|
||||||
|
|
||||||
status = gl847_set_fe (dev, AFE_SET);
|
status = gl847_set_fe (dev, AFE_SET);
|
||||||
|
@ -1451,7 +1458,9 @@ gl847_init_optical_regs_scan (Genesys_Device * dev,
|
||||||
(dev->model->flags & GENESYS_FLAG_NO_CALIBRATION))
|
(dev->model->flags & GENESYS_FLAG_NO_CALIBRATION))
|
||||||
r->value &= ~REG01_DVDSET;
|
r->value &= ~REG01_DVDSET;
|
||||||
else
|
else
|
||||||
r->value |= REG01_DVDSET;
|
{
|
||||||
|
r->value |= REG01_DVDSET | REG01_SHDAREA;
|
||||||
|
}
|
||||||
|
|
||||||
/* average looks better than deletion, and we are already set up to
|
/* average looks better than deletion, and we are already set up to
|
||||||
use one of the average enabled resolutions */
|
use one of the average enabled resolutions */
|
||||||
|
@ -1561,11 +1570,12 @@ gl847_init_optical_regs_scan (Genesys_Device * dev,
|
||||||
dev->bpl = words_per_line;
|
dev->bpl = words_per_line;
|
||||||
dev->cur=0;
|
dev->cur=0;
|
||||||
dev->len=pixels/2;
|
dev->len=pixels/2;
|
||||||
dev->dist=0;
|
dev->dist=used_pixels/2;
|
||||||
|
dev->dist=10272/2; /* XXX STEF XXX */
|
||||||
dev->skip=0;
|
dev->skip=0;
|
||||||
|
|
||||||
RIE (sanei_genesys_buffer_free (&(dev->oe_buffer)));
|
RIE (sanei_genesys_buffer_free (&(dev->oe_buffer)));
|
||||||
RIE (sanei_genesys_buffer_alloc (&(dev->oe_buffer), ((used_pixels*channels*10)/dev->bpl)*dev->bpl));
|
RIE (sanei_genesys_buffer_alloc (&(dev->oe_buffer), (dev->bpl)));
|
||||||
|
|
||||||
words_per_line *= channels;
|
words_per_line *= channels;
|
||||||
|
|
||||||
|
@ -1760,13 +1770,13 @@ independent of our calculated values:
|
||||||
/* compute scan parameters values */
|
/* compute scan parameters values */
|
||||||
/* pixels are allways given at half or full CCD optical resolution */
|
/* pixels are allways given at half or full CCD optical resolution */
|
||||||
/* use detected left margin and fixed value */
|
/* use detected left margin and fixed value */
|
||||||
/* start */
|
/* start */
|
||||||
/* add x coordinates */
|
/* add x coordinates */
|
||||||
start =
|
start =
|
||||||
((dev->sensor.CCD_start_xoffset + startx) * used_res) /
|
((dev->sensor.CCD_start_xoffset + startx) * used_res) /
|
||||||
dev->sensor.optical_res;
|
dev->sensor.optical_res;
|
||||||
|
|
||||||
/* needs to be aligned for used_res */
|
/* needs to be aligned for used_res */
|
||||||
start = (start * optical_res) / used_res;
|
start = (start * optical_res) / used_res;
|
||||||
|
|
||||||
start += dev->sensor.dummy_pixel + 1;
|
start += dev->sensor.dummy_pixel + 1;
|
||||||
|
@ -1775,7 +1785,7 @@ independent of our calculated values:
|
||||||
start |= 1;
|
start |= 1;
|
||||||
|
|
||||||
/* compute correct pixels number */
|
/* compute correct pixels number */
|
||||||
/* pixels */
|
/* pixels */
|
||||||
used_pixels = (pixels * optical_res) / xres;
|
used_pixels = (pixels * optical_res) / xres;
|
||||||
|
|
||||||
/* round up pixels number if needed */
|
/* round up pixels number if needed */
|
||||||
|
@ -3316,16 +3326,17 @@ gl847_init_regs_for_shading (Genesys_Device * dev)
|
||||||
memcpy (dev->calib_reg, dev->reg,
|
memcpy (dev->calib_reg, dev->reg,
|
||||||
GENESYS_GL847_MAX_REGS * sizeof (Genesys_Register_Set));
|
GENESYS_GL847_MAX_REGS * sizeof (Genesys_Register_Set));
|
||||||
|
|
||||||
|
dev->calib_pixels = dev->sensor.sensor_pixels;
|
||||||
|
|
||||||
status = gl847_init_scan_regs (dev,
|
status = gl847_init_scan_regs (dev,
|
||||||
dev->calib_reg,
|
dev->calib_reg,
|
||||||
dev->settings.xres,
|
dev->settings.xres,
|
||||||
dev->motor.base_ydpi,
|
dev->motor.base_ydpi,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
(dev->sensor.sensor_pixels *
|
dev->calib_pixels,
|
||||||
dev->settings.xres) /
|
dev->model->shading_lines,
|
||||||
dev->sensor.optical_res,
|
16,
|
||||||
dev->model->shading_lines, 16,
|
|
||||||
dev->calib_channels,
|
dev->calib_channels,
|
||||||
dev->settings.color_filter,
|
dev->settings.color_filter,
|
||||||
SCAN_FLAG_DISABLE_SHADING |
|
SCAN_FLAG_DISABLE_SHADING |
|
||||||
|
@ -3335,7 +3346,6 @@ gl847_init_regs_for_shading (Genesys_Device * dev)
|
||||||
SCAN_FLAG_IGNORE_LINE_DISTANCE |
|
SCAN_FLAG_IGNORE_LINE_DISTANCE |
|
||||||
SCAN_FLAG_USE_OPTICAL_RES);
|
SCAN_FLAG_USE_OPTICAL_RES);
|
||||||
|
|
||||||
dev->calib_pixels = dev->current_setup.pixels;
|
|
||||||
|
|
||||||
if (status != SANE_STATUS_GOOD)
|
if (status != SANE_STATUS_GOOD)
|
||||||
{
|
{
|
||||||
|
|
Ładowanie…
Reference in New Issue