[sane-standard] Button handling

abel deuring adeuring at gmx.net
Mon Jan 22 02:08:32 CET 2007


Étienne Bersac wrote:

> Ok, thanks, i misunderstood this. Off-topic, can you explain what
> actually is calibration, and how often is that needed ?

CCD elements (and other sensors) do not necessarily respond
uniformly over the entire area to the same light intensity.
Moreover, the colour spectrum of the lamp might change for half an
hour or so after being switched on. (Some companies did not switch
the lamps of good old drum scanners during weekends...) So most
scanners have outside the "real" scan area a white area and a black
area (where "white" and "black" would need a better definition...);
for calibration, the scan head is moved to these areas and the
output signal is measured. Some CCD elements may return for example
10 for the black level, others may return 5 etc, and the white level
may vary between, say, 220 and 250 for 8 bit ADCs. The firmware (or
perhaps even on or the other backend?) remember the values for each
sensor element, and "scales" the output data accordingly to the
range 0..255 or 0..1024 or whatever the ADC resolution allows.

>> Cleanup of Sane1 options will not work. Why should anyone put much
>> work into cleanup of old code, when you can expect that work on new
>> code will start quite soon?
> 
> Whatever version you call it, (1.1 or 2.0), SANE needs a clean up in
> option names and value variation in backends. That's doable in SANE 1, i
> mean keeping the current SANE API (excluding Well-Known-Option by using
> an external Well-Known options reference), keeping binary compatibility.

Some backends are no longer maintained... The best you can do for
Sane1 is to "collect" a list of available options.

> 
>> As explained above, some scanners have "UI elements" like
>> "function-wheel" that are so vague that you can't give a better
>> option name.
> 
> Ok.
> 
> Is there an easy way to know if an option is for frontend itself or for
> user ? For example, the plustek backend show 5 "button" option for my
> CanoScan N1220U, and xsane shows an unsensitive checkbox for this
> button, in a "buttons" frame. That's useless and even annoying for
> end-users. Why is that option shown ? Is there a way for backend to
> tell : this option is not for user. I think about SANE_CAP_HARD_SELECT.
> Am i wrong ?

>From http://www.sane-project.org/html/doc011.html :
"SANE_CAP_HARD_SELECT
 	The option value can be set by user-intervention (e.g., by
flipping a switch). The user-interface should prompt the user to
execute the appropriate action to set such an option. This
capability is mutually exclusive with SANE_CAP_SOFT_SELECT (either
one of them can be set, but not both simultaneously)."

So, SANE_CAP_HARD_SELECT is used (a) for buttons, switches etc, ie.
"UI elements" of a scanner, that a user can set and (b) for hardware
status, like a sensor that detects the presence of a document in an
ADF, or the "ink level" of an imprinter.

Abel



More information about the sane-standard mailing list