[sane-devel] List of "sane_control_option" options?

abel deuring adeuring at gmx.net
Sun May 10 14:46:08 UTC 2009


On 10.05.2009 15:49, Mark Pemburn wrote:
> Hi again,
> 
>     Almost immediately after sending my request, I think I figured out what I 
> need to do:  Call "sane_get_option_descriptor" with the SANE handle and integer 
> "0" as the second argument (SANE_Int n) and it'll return a pointer to a 
> structure of type SANE_Option_Descriptor.  One of the members of this structure 
> contains the an integer that tells _how many_ options are available from this 
> particular device (not sure which but I'll test it out and see).  By iterating 
> over calls to sane_get_option_descriptor supplied with values of 1 to n-1, 
> you'll get a full list of available options and what to do with them.  Is this 
> correct?  Anything I missed?

Yes, it is correct.

> 
> Mark
> 
> Earlier I wrote:
>>     I'm pretty new to SANE so please forgive my ignorance.  After several 
>> weeks of brain busting with new languages and concepts, I've made quite a bit 
>> of progress on my Mac OS X scanner interface using Cocoa/Objective-C.  I can 
>> get the list of available scanners, get the SANE handle and, in moment of 
>> ecstasy this past Thursday, was finally able to activate the scanner and 
>> retrieve data.  I still haven't figure out exactly how to display the results 
>> but this will come in time.  The next thing I want to tackle is setting 
>> options for the scanner, something I gather is done with 
>> "sane_control_option".  Is there a list of all of the available options and 
>> the valid values for each?  I've searched all over but haven't turned anything 

There is a list of "well-known options" (you found it already, I assume
;), but there is nothing like a complete list of options. There is no
way to predict what fancy features a scanner ḿight have: Some ADF
scanners can detect double feeds or have a small printer attached
allowing you to print serial numbers on scanned documents, other
scanners allow you to select the light colour; a slide scanner might
allow you to select a specific slide from a tray with multiple slides.
For more examples, look into the source code of some backends ;)

If you want to write GUI widgets, I'd strongly recommend to work with
the test backend. Firstly, it "scans" much faster than any real scanner,
and secondly, you'll get examples for every Sane option, giving you the
best opportunity to ensure that your code can indeed deal with sorts of,
erm, weird Sane options.

Abel

>> up yet.  Your help will be greatly appreciated.
>>
>> Regards,
>>
>> Mark Pemburn
>> --------------------------------------------------------------------------------
>>
>> --
>> sane-devel mailing list: sane-devel at lists.alioth.debian.org
>> http://lists.alioth.debian.org/mailman/listinfo/sane-devel
>> Unsubscribe: Send mail with subject "unsubscribe your_password"
>>              to sane-devel-request at lists.alioth.debian.org
> 
> 
> 
> ------------------------------------------------------------------------
> 
> --
> sane-devel mailing list: sane-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/sane-devel
> Unsubscribe: Send mail with subject "unsubscribe your_password"
>              to sane-devel-request at lists.alioth.debian.org




More information about the sane-devel mailing list