[sane-devel] sane_control_option question

Fred Odendaal freshshelf at rogers.com
Sun Oct 16 22:15:24 UTC 2005


Thanks,
Henning Meier-Geinitz wrote:

>Hi,
>
>On Fri, Oct 14, 2005 at 12:20:44AM -0400, Fred Odendaal wrote:
>  
>
>>The SANE API defines the sane_control_option as:
>>
>>SANE_Status sane_control_option (SANE_Handle h, SANE_Int n,
>>                                SANE_Action a, void *v,
>>                                SANE_Int * i);
>>
>>Where the argument i is used to convey information back to the frontend. 
>>How do I tell the front end to reload options (SANE_INFO_RELOAD_OPTIONS) 
>>when it supplies a null argument for i?
>>    
>>
>
>You can't. If the frontend send NULL, it's not interested in reloading
>the options.
>  
>
That's what I thought, but I wanted to make sure there wasn't some 
undocumented "back door".

>  
>
>>I want to have the user set the y resolution and have the x resolution 
>>automatically update correspondingly. This works  for xscanimage, but 
>>not xsane.
>>    
>>
>
>I'm a bit surprised that xsane send NULL. Are you sure that his is the
>case? At least for the "normal" options it honors reload requests.
>  
>
Yes, I'm also quite surprised. It works fine with xscanimage, but 
doesn't when I use xsane. So I compared the debug output.

xscanimage:
[lexmark] sane_get_option_descriptor: handle=0x9625108, option = 3
[lexmark] sane_control_option: handle=0x9625108, opt=3, act=1, 
val=0xbff19b84, info=0xbff19a4c

xsane:
[lexmark] sane_get_option_descriptor: handle=0x95f2a80, option = 3
[lexmark] sane_get_option_descriptor: handle=0x95f2a80, option = 3
[lexmark] sane_control_option: handle=0x95f2a80, opt=3, act=1, 
val=0xbfeda2fc, info=(nil)

>If the x resolution directly depends on y, can't you just use one
>resolution (option "resolution") and set the other one in the backend
>accordingly?
>  
>
Yes. I just wanted the user to know that when he set 1200dpi the actual 
resolution is 600x1200 as you've shown for the gt68xx backend below.

>Typically "resolution" means "X resolution". E.g. for most scanners
>supported by the gt68xx backend you can select these resolutions:
>
>Resolution    X      Y
>100           100    100
>300           300    300
>600           600    600
>1200          600    1200
>
>So only one resolution is selected by the frontend and the backend
>decides which X and Y resolutions it uses.
>  
>
Does the gt68xx backend report back the true x and y resolutions to the 
front end so the user know what he is getting? Or, is this just 
described in the man page or other documentation?

regards,
Fred
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20051016/e7b58836/attachment.htm


More information about the sane-devel mailing list