[sane-devel] HP5470c scanner nearly working!

Martijn van Oosterhout Martijn van Oosterhout <kleptog@svana.org>
Sun, 23 Feb 2003 00:58:56 +1100


--WplhKdTI2c8ulnbP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Feb 22, 2003 at 02:06:31PM +0100, Bertrik Sikken wrote:
> Martijn van Oosterhout wrote:
> >Thanks for that. My main questions are: what functions do you need to
> >implement and is it backend push or caller pull for the data? Maybe I'll
> >look through the source for the hp3300 driver to see what I can do.
> >
> There is a document somewhere on www.mostang.com/sane which describes
> the sane api quite well.

I havn't found this document yet, but I'm making good progress.

> The frontend pulls data from the backend (by means of the sane_read=20
> function)
>=20
> The sane api allows a lot of flexibility for scanner settings, by letting
> the scanner backend present a set of options to the scanner frontend.
> For example the backend can present the vertical scan position as
> a value in the range 0..300 with unit mm. Another example is scan
> resolution which can take on one of a set of discrete values
> {75, 150, 300, 600, 1200} with unit dpi.
> You can probably copy the mechanism for informing the frontend about
> these options and for setting / getting the values of these options
> from other backends without making a lot of changes.

Yep, I've been copying and pasting from the hp3300 backend. Maybe not a good
choice but it seems to be working OK. At the moment I can see by stracing
xscanimage that it's opening my .so but it's just exiting saying it didn't
find anything. Obviously the dlopen() isn't succeeding but I'm not getting
an error.

> Some important functions in the sane api are
> * sane_get_parameters, which reports the actual size in pixels and bytes
> if the scan would be done with the currently set scanner settings.
> So you may need to convert from mm to pixels here.

At what stage is this function called? Because I can get the scanner to give
me the actual values rather than my guesses, but it's not good if it's going
to be called dozens of times before the actual scan starts.

> * sane_start, which indicates that image capture should be started.
> Here you could probably convert the scan options into values / tables
> that the scanner hardware understands.
> * sane_read, which reads chunks of image data.

Can I safely assume the caller of sane_read will provide a buffer >10K.
Probably not hey? So I have to buffer possibly down to the subpixel level.

Thanks anyway,
--=20
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Support bacteria! They're the only culture some people have.

--WplhKdTI2c8ulnbP
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+V4IgY5Twig3Ge+YRAsG8AKDLqAroBeVNuKSaREtuTl1QXBPBrwCgy/fl
Y2z/wzoivQDjJnsB7udhQNQ=
=2t6m
-----END PGP SIGNATURE-----

--WplhKdTI2c8ulnbP--