[sane-devel] Preview mode puzzle (re-send in text mode -- sorry)
m. allan noah
kitno455 at gmail.com
Tue May 26 14:55:29 UTC 2009
On Tue, May 26, 2009 at 10:09 AM, Mark Pemburn <mark at pemburn.com> wrote:
> Hi,
>
> In my Mac/OS X project, I've reached the point where I can set the mode,
> resolution and depth and I now want to tackle the preview mode. In my early
> tests, it seems that setting the preview option to SANE_TRUE does _not_ do
> what I expect -- that is, it doesn't override the current settings of the
> other options. The API doc says:
>
> "A backend is free to override the resolution value with its own choice for
> preview mode, but it is advised to leave this choice to the frontend
> wherever possible.
> This option is not mandatory, but if a backend does support it, it must
> implement it in a manner consistent with the above definition."
>
> The puzzle is, how do I know if the backend has chosen to override the
> currently set resolution value? Unless I can divine this, it looks like
> I'll have to save the current settings, reset to what I decide is a suitable
> resolution, etc., then reset to the saved settings. Is this correct?
you cut out:
"The setting of this option must not affect any other option. That is,
as far as the other options are concerned, the preview mode is
completely side effect free. A backend can assume that the frontend
will take care of appropriately setting the scan resolution for
preview mode (through option resolution)"
IMHO, you should setup the parameters you want for your preview, and
then set the preview option if it exists, and then honor the
parameters that the backend gives you after sane_start. This technique
then works for machines that dont have a preview option. For the
machines that do, they may have to do something different, but you
will get it thru the params.
As a side note, beware of making an automatic preview. ADF machines
dont like that :)
allan
>
> Regards,
>
> Mark
>
>
> --
> 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
>
--
"The truth is an offense, but not a sin"
More information about the sane-devel
mailing list