The scan mode of the preview and the scan

From: Mitsuru Okaniwa (m-okaniwa@bea.hi-ho.ne.jp)
Date: Thu Dec 07 2000 - 19:49:54 PST

  • Next message: Jeffrey H. Ingber: "Re: Which scanners REALLY provide 36 bit output? HP?"

    Hi
    I could use the xscanimage with the CanoScanFB620S by many and kind help of
    Mr.Abel Deuring.
    I have the next problem to modify "Fine color" in the Scan mode of the
    preview and the scan.
    In addition to "Fine color" scan mode, CanoScanFB620S has the "Color" scan
    mode.
    But the preview and the scan speed in "Fine color" scan mode is very slower
    than the speed in "Color" scan mode.
    So, I would like to modify in the following way.

    When I select "Fine color" scan mode in the pulldown menu of xscanimage, at
    the only preview running "Color" scan mode is selected behind the GUI. And
    at the actual scanning by pushing the button of "Scan", "Fine color" scan
    mode is selected.

    The source code about this is the following part of the canon-sane.c.
    ===========================================================================
    #if 1
      DBG (3, "sane_start: sending DEFINE SCAN MODE for scan control
    conditions\n");
      memset (wbuf, 0, sizeof (wbuf));
      wbuf[0] = 0x20;
      wbuf[1] = 14;

      /* modification for FB620S */
      if ( s->hw->info.model == FB620 && strcmp (mode_str, "Fine color") == 0)
      {

       wbuf[15] = 1 << 3; <=====This parameter is "1" then "Fine color" is
    available.

      }
      else

       wbuf[15] = 0; <=====This parameter is "0" then "Fine color" is not
    available.

      /* For preview use always normal speed: */
      if (s->val[OPT_PREVIEW].w == SANE_FALSE)
        wbuf[11] = s->scanning_speed;
      status = define_scan_mode (s->fd, SCAN_CONTROL_CONDITIONS, wbuf);
      if (status != SANE_STATUS_GOOD)
      {
        DBG (1, "define scan mode failed: %s\n", sane_strstatus (status));
        return (status);
      }

      DBG (3, "sane_start: sending GET SCAN MODE for scan control
    conditions\n");
      memset (ebuf, 0, sizeof (ebuf));
      buf_size = sizeof (ebuf);
      status = get_scan_mode (s->fd, SCAN_CONTROL_CONDITIONS, ebuf, &buf_size);
      if (status != SANE_STATUS_GOOD)
      {
        DBG (1, "sane_start: GET SCAN MODE for scan control conditions
    failed\n");
        sanei_scsi_close (s->fd);
        return (SANE_STATUS_INVAL);
      }
      for (i=0; i<buf_size; i++)
      {
        DBG(3, "scan mode byte[%d] = %d\n", i, ebuf[i]);
      }
    #endif
    ===========================================================================
    I would like to change this program as follows.

    When I select the "Fine color" scan mode...
    1. At the preview running, "wbuf[15] = 0" in the define_scan_mode function
    is selected.
    2. At the actual "Scan" not the preview, "wbuf[15] = 1 << 3" in the
    define_scan_mode function is selected.

    But if I select the "Fine color" scan mode, wbuf[15] = 1 << 3 in the
    define_scan_mode function is running at both the preview and the actual
    scan.
    I don't know the way of the modification about this problem.
    Does anybody have a good idea ?

    The canon backend files are in the Web page of "SANE backend for Canon
    scanners".
    regards,

    -----------------------------
    Mitsuru Okaniwa
    email : m-okaniwa@bea.hi-ho.ne.jp
    tel : (Japan)0566-26-6105
    -----------------------------

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Thu Dec 07 2000 - 19:50:03 PST