Re: SANE API & file format

From: Stephen Williams (steve@icarus.com)
Date: Thu May 03 2001 - 13:42:38 PDT

  • Next message: Henning Meier-Geinitz: "Re: Canon backend"

    henning@meier-geinitz.de said:
    > So somebody must go on and write an new standard for SANE 2 (see
    > LEVEL2 in SANE distribution).

    Here are some ramblings on the matter. It doesn't seem all that
    hard...

    The problem is that a JFIF stream (for example) does not sit well
    with the SANE_Parameters structure. In particular, the pixels_per_line
    and bytes_per_line values are not defines.

    I suppose the right thing to do is simply ignore these for all but the
    5 core frame format types.

    Other then that, supporting new formats should be easy and backwards
    compatible. Just create a well-known-type "transfer-type" with the
    default always set to TRANSFER_TYPE_SANE that acts like the existing
    in-memory transfer. Existing tools that are not aware of transfer types
    will automatically get this. A scanner driver that only supports the
    TRANSFER_TYPE_SANE type need not even implement type type.

    If an application is aware of transfer types, it can ask the driver
    for the word list constraint to get a list of the transfer types that
    the driver supports. If the driver does not support "transfer-type"
    then the application supports TRANSFER_TYPE_SANE.

    If the driver supports "transfer-type", then the list includes
    TRANSFER_TYPE_SANE and any other formats it supports, which should
    at least include TRANSFER_TYPE_JFIF and others that hardware can
    produce. The application can then compare the list of formats that
    the driver supports along with its own (implicit) list of supported
    types, then do whatever seems natural for the application with the
    types. For example, scanimage_ex may choose to support JFIF images
    by writing them to a file foo.jpg.

    Most formats will be variable size streams. To account for that, the
    application should always read to the EOF to get everything that is
    the format.

    -- 
    Steve Williams                "The woods are lovely, dark and deep.
    steve@icarus.com              But I have promises to keep,
    steve@picturel.com            and lines to code before I sleep,
    http://www.picturel.com       And lines to code before I sleep."
    

    -- 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 May 03 2001 - 13:34:26 PDT