[sane-devel] HP5470c scanner nearly working!

Martijn van Oosterhout Martijn van Oosterhout <kleptog@svana.org>
Fri, 21 Feb 2003 10:44:13 +1100


--lrZ03NoBR/3+SXJZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Feb 20, 2003 at 09:19:26PM +0100, Bertrik Sikken wrote:
> Martijn van Oosterhout wrote:
> >1. Actually use results of calibration scans. Anyone who has an idea how
> >scanners are calibrated, point me at some info, please.
> >
> With my hp3300 I do this by scanning an area on the inside of the scanner,
> which is mostly white but with a small square black area.
> I then determine the color of the darkest pixel and call this the black
> level. From the white area, several lines are averaged into a single
> white line, which gives a white level for each CCD pixel.
> Then a table is calculated which contains a gain and offset value for
> each color component (R,G,B) of each CCD pixel. The gain is
> proportional to as (white(x) - 'black') and I use simply a value
> proportional to 'black' for the offset.

Ok, Windows is doing two scans, one for the white and one for the black so
you have two values per CCD rather than one black value. What you describe =
is
basically what I was thinking of anyway, though I didn't know there was a
bit structure. It looked more like a min/max pair. I'll have another look.

> The table can be used not only for gamma correction, but also for
> brightness and contrast compensation. Infact, if a backend presents
> this table to xsane, then xsane will use it automatically for
> gamma, brightness and contrast and the backend does not even
> need to know how to calculate gamma.

That's cool. Maybe I should do that.

> >5. Turn it into a SANE backend. Hopefully this will not be hard.
> >
> I won't mind helping you with this.
> What I did with the hp3300 was to put the core functionality in one
> source file. Then on top of this, I could put either a sane interface
> (which is quite simple) or a frontend for a console testtool.

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.

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

--lrZ03NoBR/3+SXJZ
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+VWhNY5Twig3Ge+YRAhUkAKCEO+3UTqKnxhhio84itcMStVyirwCgpOHY
AXXxkuClDvlb4MB95gq+TRQ=
=ozr+
-----END PGP SIGNATURE-----

--lrZ03NoBR/3+SXJZ--