[sane-devel] Standard option definitions
Henning Meier-Geinitz
henning at meier-geinitz.de
Mon Mar 25 19:35:55 GMT 2002
Hi,
On Mon, Mar 25, 2002 at 10:06:12AM -0800, Dave Close wrote:
> Again, I never saw this on the list, only in a personal copy to me.
> Unfortunately, I tend to ignore off-list replies to list posts.
The post was on the list, at least I read it here.
> I had mentioned SANE_DESC_SCAN_SPEED, SANE_DESC_CAL_LAMP_DEN,
> SANE_DESC_SCAN_LAMP_DEN, and SANE_DESC_SELECT_LAMP_DENSITY. All of
> these are listed in saneopts.h. If they are hardware-dependent, they
> should not appear there, but should appear only in the header file
> associated with the specific backend.
I don't know why they have been added, it's long time ago. Generally,
saneopts.h is just a list of common descriptions to help authors and
avoid similar names for the same option. They are not a standard for
how an option is implemented. The backend auther even doesn't need to
use these names.
> Note that nearly all options are implemented differently for different
> scanners. The fact that the implementation varies is no reason for an
> option not to be standard, or "well known". My assertion is that any
> option which appears in saneopts.h should be considered well known and
> its usage should be well defined.
Not all options in saneopts.h are well-known, only those in the
standard. Only well-known options must use the same types etc.
> I also don't see why scanning speed should be less standardized than
> brightness or contrast (for example), or specifically for the scanning
> mode (gray, mono, lineart, etc).
All this is hardware-dependant and therefore curently no well-known
option. Not all scanners have brightness or contrast. Some habe
halftone mode, others haven't. Some even don't have a color mode.
For some Mustek scanners there are 5 speed options (slowest to
fastest). For other scanners there may be 20 or only 2. I don't think
it makes much sense to standardize this.
There will be more well-known options in the next version if the SANE
standard but I don't think "speed" should be one of them.
> Can anyone answer my specific question about the LAMP options: should I
> understand that "density" is, in some sense, equivalent to "intensity"?
I have no idea.
> >In general the frontend does not need to know about the options.
>
> That may be true in the general case. I prefaced my post by noting that
> "our practice is to provide a standard user interface for all of our
> scanners." In a production environment, with technicians working on
> several scanners and work generated by departments which never see the
> scanners, a standard interface helps a great deal. We may be unique but
> I suspect there are other production situations among SANE users. SANE
> is not defined, so far as I know, as a hobbiest protocol only.
SANE is a standard that describes communication between a backend that
knows the hardware and a frontend that doesn't (and shouldn't). That's
why the hardware parameters are encapsulated in SANE options. SANE
doesn't mean: every scanner looks the same. It doesn't.
To solve your problem: you may want to write a meta backend that
translates the options of the various backends you use to something
you like. Maybe you can use dll.c as a base. Or just change the source
of the backends you use if you like.
Bye,
Henning
More information about the sane-devel
mailing list