[sane-devel] HP5470c scanner nearly working!

Martijn van Oosterhout kleptog at svana.org
Thu Feb 20 23:44:13 GMT 2003


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.

-- 
Martijn van Oosterhout   <kleptog at svana.org>   http://svana.org/kleptog/
> Support bacteria! They're the only culture some people have.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/sane-devel/attachments/20030221/dd66ee46/attachment.sig>


More information about the sane-devel mailing list