[sane-devel] Does driver know it is scannning or previewing now with XSane?
m. allan noah
kitno455 at gmail.com
Fri Jun 20 14:03:23 UTC 2008
On Thu, Jun 19, 2008 at 10:51 PM, eagleskycloud <eagleskycloud at gmail.com> wrote:
>>you can expose the sensor, as we have added some well-known option
>>names for this with sane 1.1. (which still needs the spec to be
>>updated, but i've not had time)
>
> While scannning multi-page with ADF, upper application tolds scanner
> firmware to detect the sensor status and firmware will return the status to
> upper application. Upper application could judge whether to continue
> scanning by the status of sensor. Maybe the sensor of each scanner vendor is
> different and only their driver could get the sensor status via
> communication with firmware. If there is no page in ADF, the drvier will
> return SANE_STATUS_NO_DOCS to XSane.XSane could determine whether to
> continue scan by the sensor status returned by driver.
You dont need to have the front-end read the sensors for this to work,
it works right now: the front-end asks the backend for the next image,
and the backend asks the scanner for the next page (or the status of
the sensor) and returns either the next page, or SANE_STATUS_NO_DOCS.
the front-end need not care if this information was derived from a
sensor or a scanner error message.
>
>>there is a preview option mentioned in the standard, but it does not
>>seem to be implemented consistently, and i dont know if xsane calls
>>it.
>
>>how will your scanner act differently in preview mode? isn't it just
>>the same as any other low resolution scan?
>
> Preview on flatbed scan , ADF simplex scan, and ADF duplex scan is same as
> low resolution scan.They all scan a image . But there is difference in
> preview on ADF duplex scan. when I achieve ADF duplex , front image and back
> image of a paper scan at the same time. XSane fetches the back image after
> the total front image has been fetched. Below is the code flow of ADF duplex
> ADF scan:
snip
>
> Code flow of preview on ADF duplex ADF scan is same as above. Because
> preview on ADF duplex ADF scan only need to acquire a image(the front
> image), the back image is still acquire while preview on ADF duplex
> scan.This will cause XSane crash. If there is a option to only indicate
> preview,the XSane crash problem would be avoid.
the front-end should call sane_cancel() after the preview scan, and
your backend should throw away the backside data, and put the scanner
in a reasonable state to continue.
allan
>
>
>
> 2008/6/19 m. allan noah <kitno455 at gmail.com>:
>>
>> 2008/6/18 eagleskycloud <eagleskycloud at gmail.com>:
>> > Hi,
>> >
>> > I have two question :
>> > 1.To scan multi images,input a number in left corner edit box to
>> > indicate
>> > the image number of XSane would scan
>> >
>> > There is a sensor In ADF. It could detecte are there papers in
>> > ADF.Upper application could know whether there are papers in ADF by
>> > status
>> > of the sensor. Which is the better way to achieve scanning multi images
>> > between input a number of scanning image and add a function?
>>
>> Xsane's multi-page support is not as good as other front-ends, so you
>> should not think that is the only way to do it. in fact, most other
>> multi-page capable front-ends just scan until the backend returns
>> SANE_STATUS_NO_DOCS, if that is 1 page or 100 pages.
>>
>> you can expose the sensor, as we have added some well-known option
>> names for this with sane 1.1. (which still needs the spec to be
>> updated, but i've not had time)
>>
>> >
>> > 2.Does driver know it is scannning or previewing now with XSane?
>> > I have achieved ADF duplex scan. I want to know how to judge it is
>> > scanning or previewing in my driver ,so I could handle the ADF duplex
>> > preview
>>
>> there is a preview option mentioned in the standard, but it does not
>> seem to be implemented consistently, and i dont know if xsane calls
>> it.
>>
>> how will your scanner act differently in preview mode? isn't it just
>> the same as any other low resolution scan?
>>
>> allan
>> --
>> "The truth is an offense, but not a sin"
>
>
--
"The truth is an offense, but not a sin"
More information about the sane-devel
mailing list