diff options
Diffstat (limited to 'backend/avision.c')
| -rw-r--r-- | backend/avision.c | 41 | 
1 files changed, 29 insertions, 12 deletions
| diff --git a/backend/avision.c b/backend/avision.c index 862a275..e047a7f 100644 --- a/backend/avision.c +++ b/backend/avision.c @@ -16,9 +16,7 @@     General Public License for more details.     You should have received a copy of the GNU General Public License -   along with this program; if not, write to the Free Software -   Foundation, Inc., 59 Temple Place - Suite 330, Boston, -   MA 02111-1307, USA. +   along with this program.  If not, see <https://www.gnu.org/licenses/>.     As a special exception, the authors of SANE give permission for     additional uses of the libraries contained in this release of SANE. @@ -58,7 +56,7 @@     Copyright 2010, 2011 by                  "Mike Kelly" <mike@piratehaven.org> -   Additional Contributers: +   Additional Contributors:                  "Gunter Wagner"                    (some fixes and the transparency option)                  "Martin JelĂnek" <mates@sirrah.troja.mff.cuni.cz> @@ -303,6 +301,24 @@ static Avision_HWEntry Avision_Device_List [] =      /* status="complete" */      { NULL, NULL, +      0x0638, 0x1A33, +      "Avision", "AV186+", +      AV_INT_BUTTON | AV_CANCEL_BUTTON | AV_USE_GRAY_FILTER, +      { 0, {0, 0}, {{0, 0}, {0, 0}} } +    }, +    /* comment="duplex! sheetfed scanner" */ +    /* status="good" */ + +    { NULL, NULL, +      0x0638, 0x2AD9, +      "Avision", "AV188", +      AV_INT_BUTTON | AV_CANCEL_BUTTON | AV_USE_GRAY_FILTER, +      { 0, {0, 0}, {{0, 0}, {0, 0}} } +    }, +    /* comment="duplex! sheetfed scanner" */ +    /* status="untested" */ + +    { NULL, NULL,        0x0638, 0x0A2C,        "Avision", "AV220+",        AV_INT_BUTTON | AV_CANCEL_BUTTON, @@ -3619,7 +3635,7 @@ adf_reset (Avision_Scanner* s)      set_triple (rcmd.transferlen, size);      status = avision_cmd (&s->av_con, &rcmd, sizeof (rcmd), 0, 0, payload, &size);      if (status != SANE_STATUS_GOOD || size != (4-n)) { -      DBG (1, "adf_reset: read %lu failed (%s)\n", (2-n), +      DBG (1, "adf_reset: read %zu failed (%s)\n", (4-n),  	 sane_strstatus (status));        return (status);      } @@ -4152,7 +4168,7 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type,      av_con.usb_status = AVISION_USB_UNTESTED_STATUS;    /* set known USB status type */ -  if (attaching_hw && attaching_hw->feature_type & AV_INT_STATUS) +  if (attaching_hw && (attaching_hw->feature_type & AV_INT_STATUS))      av_con.usb_status = AVISION_USB_INT_STATUS;    DBG (3, "attach: opening %s\n", devname); @@ -4880,7 +4896,7 @@ send_tune_scan_length (Avision_Scanner* s)    set_double (payload.vertical, top);    /* set_double (payload.horizontal, 0); */ -  /* we alway send it, even for 0 as the scanner keeps it in RAM and +  /* we always send it, even for 0 as the scanner keeps it in RAM and       previous runs could already have set something */    status = avision_cmd (&s->av_con, &scmd, sizeof (scmd), @@ -6266,7 +6282,7 @@ set_window (Avision_Scanner* s)    cmd.window.avision.highlight = 0xFF;    cmd.window.avision.shadow = 0x00; -  /* mode dependant settings */ +  /* mode dependent settings */    switch (s->c_mode)      {      case AV_THRESHOLDED: @@ -6461,7 +6477,7 @@ get_background_raster (Avision_Scanner* s)      } /* end line pack */    /* deinterlace? */ -  if (s->avdimen.interlaced_duplex && dev->hw->feature_type & AV_2ND_LINE_INTERLACED) +  if (s->avdimen.interlaced_duplex && (dev->hw->feature_type & AV_2ND_LINE_INTERLACED))      {        uint8_t* deinterlaced = malloc (size * 2);        if (!deinterlaced) @@ -6474,7 +6490,7 @@ get_background_raster (Avision_Scanner* s)  	  uint8_t* src_raster;  	  /* for the quirky devices and some resolutions the interlacing differs */ -	  if (dev->hw->feature_type & AV_BACKGROUND_QUIRK && s->avdimen.hw_xres >= 150) +	  if ((dev->hw->feature_type & AV_BACKGROUND_QUIRK) && (s->avdimen.hw_xres >= 150))  	    dst_i = i / 2 + ((i+1) % 2) * (lines / 2);  	  dst_raster = deinterlaced + bytes_per_line * dst_i; @@ -7626,7 +7642,7 @@ reader_process (void *data)  	      /* interlaced? save the back data to the rear buffer */  	      if ( (deinterlace == STRIPE && absline % (lines_per_stripe*2) >= lines_per_stripe) ||  		   (deinterlace == HALF   && absline >= total_size / s->avdimen.hw_bytes_per_line / 2) || -		   (deinterlace == LINE   && absline & 0x1) ) /* last bit equals % 2 */ +		   (deinterlace == LINE   && (absline & 0x1)) ) /* last bit equals % 2 */  		{  		  DBG (9, "reader_process: saving rear line %d to temporary file.\n", absline);  		  fwrite (ptr, s->avdimen.hw_bytes_per_line, 1, rear_fp); @@ -7644,7 +7660,7 @@ reader_process (void *data)  	  DBG (9, "reader_process: after deinterlacing: useful_bytes: %d, stripe_fill: %d\n",  	       useful_bytes, stripe_fill);  	} -      if (dev->hw->feature_type & AV_ADF_FLIPPING_DUPLEX && s->source_mode == AV_ADF_DUPLEX && !(s->page % 2) && !s->duplex_rear_valid) { +      if ((dev->hw->feature_type & AV_ADF_FLIPPING_DUPLEX) && s->source_mode == AV_ADF_DUPLEX && !(s->page % 2) && !s->duplex_rear_valid) {          /* Here we flip the image by writing the lines from the end of the file to the beginning. */  	unsigned int absline = (processed_bytes - stripe_fill) / s->avdimen.hw_bytes_per_line;  	unsigned int abslines = absline + useful_bytes / s->avdimen.hw_bytes_per_line; @@ -7838,6 +7854,7 @@ reader_process (void *data)  	  s->avdimen.hw_yres == s->avdimen.yres) /* No scaling */  	{            fwrite (out_data, useful_bytes, 1, fp); +          line += useful_bytes / s->avdimen.hw_bytes_per_line;  	}        else /* Software scaling - watch out - this code bites back! */  	{ | 
