[sane-devel] HP5470c scanner nearly working!

Martijn van Oosterhout Martijn van Oosterhout <kleptog@svana.org>
Sun, 23 Feb 2003 10:25:46 +1100


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

On Sat, Feb 22, 2003 at 03:54:37PM +0100, Henning Meier-Geinitz wrote:
> Hi,
>=20
> On Sun, Feb 23, 2003 at 12:58:56AM +1100, Martijn van Oosterhout wrote:
> It's called the "SANE Standard" or "Programmer's Manual". It can be
> found on the documentation page: http://www.mostang.com/sane/docs.html
>=20
> Some tips are also in doc/backend-writing.txt. E.g. for writing
> portable code.

Thanks, I found them. I'm reading them now. Actually, I have one addition
for the backend-writing.txt

* Please do not assume that `void *' has the same size as `int'.  On some
  systems, it's `long' and the size of this type may be bigger than that of
  an int (this is true for practially any of the 64-bit systems). Where this
  comes up is with opaque handles. For example:

  int OpaqueHandle;
  MyScanner *s =3D (MyScanner *)OpaqueHandle;

  will FAIL on most 64 bit systems. Please use `void *' or better
  `SANE_Handle'.


> > 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 lev=
el.
>=20
> No. The buffer can be as low as 1 byte. In backends that need to do
> image manipulation, usually a buffer of one or multiple scan lines is
> used. Especially if you need to do line distance correction (CCD
> scanners), you may need 10 or more lines of each color.

Heh. I wonder if all backends really support a buffer that small. Nice
stress test :)

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

--9amGYk9869ThD9tj
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+WAb6Y5Twig3Ge+YRAsl1AJ46PETiuAqEeiQTypJsdQtpvJnN8wCg1zWK
0zspflfr9nUlb9OOVnQ622Y=
=1S2+
-----END PGP SIGNATURE-----

--9amGYk9869ThD9tj--