[sane-devel] API addition request

m. allan noah kitno455 at gmail.com
Sat Jun 20 13:38:24 UTC 2009


On Sat, Jun 20, 2009 at 8:42 AM, Alessandro Zummo <azummo-lists at towertech.it
> wrote:

> On Sat, 20 Jun 2009 14:18:00 +0200
> Alessandro Zummo <azummo-lists at towertech.it> wrote:
>
> > > While we are at it, It would make my life easier if there were
> > > something to indicate whether the scan is from the flatbed or ADF, and
> > > if the latter, whether duplex or not.
> >
> >  agreed. should be easy too.
>
>  We could grow SANE_Parameter with a flags field and a version field:
>
> typedef struct
> {
>    SANE_Int version;
>    SANE_Word flags;
>    SANE_Frame format;
>    SANE_Bool last_frame;
>    SANE_Int bytes_per_line;
>    SANE_Int pixels_per_line;
>    SANE_Int lines;
>    SANE_Int depth;
> }
> SANE_Parameters;
>
> #define SANE_PARAMF_DUPLEX      (1L << 0)
> #define SANE_PARAMF_ADF         (1L << 1)
>
>  We could also add a media type field, with values
>  like paper, film negative, film positive, .....
>
>  Having a version field allows to extend it without
>  breaking compatibility.
>

We could do that, but then any front-end that uses sane would have to check
the backend version number and the params version number. I would be more
inclined to convert 'last_frame' to 'flags', then you can probably get by
without changing existing backends (other than a word substitution).

But, back to Jeffrey's request- is it enough to know ADF or not and Duplex
or not in the params struct, or do you need to know that sooner? Also, it
would be good to know which side of the duplex scan this is...

allan
-- 
"The truth is an offense, but not a sin"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20090620/d2d8551c/attachment.htm>


More information about the sane-devel mailing list