[sane-devel] Unknown tables

JKD JKD@JKDSoft.cjb.net
Mon, 13 Sep 2004 18:56:27 +0200


El Mon, 13 de Sep de 2004, a las 08:59:16AM +0000, gerard klaver dijo:
> On Sun, 2004-09-12 at 15:21, JKD wrote:
> > Debugging the windows library that manages my scanner I see that the
> > first thing the driver does is create six tables with unknown purposes
> > at the moment. Theese tables are created in the following way.
> > 
> > 1 - Loop with 3 iterations. I think one iteration per colour (not sure)
> > 2 - In each iteration, 2 tables are created. All tables have the same
> > size (0xff0 bytes = 4080.) and contains data of two bytes size (0x7f8 words = 2040.)
> > 3 - The first table in each iteration is filled with zeroes.
> > 4 - The second table in each iteration is filled with 0x7f8 words with value 0x4000 (16384.)
> > 
> > It seems to be minimum values and maximum values for something but I'm
> > not sure of that. Could anyone have any idea about the purpose of theese
> > values? Gain values or something else ?. Gamma tables have only 255
> > posible values and I've located them.
> > 
> > Sincerelly, JKD
> 
> 
> Could be calibration tables, but you didn't mention the backend and
> scanner you are using?
> 
> -- 
> ----------
> m.vr.gr.
> Gerard Klaver


Thank you for your answers. The library that I'm debugging belongs to
hp3970 scanner. Well, I've debugged a bit more. Those buffers seem to
be calibration tables created when program starts (I know that because
I found a function in which programmer wrote a debug string
"FreeCalBuffer" to free those tables). However library use them depending
on a variable. If this variable contains 0x00 then, in each scanning
process, the same tables are created dinamically with a variable size
(scan width * 2) filled with the same values described on a previous
post.

Despite of having experience on reverse engineering I don't know very
much about how those tables work and how gain values are used. If anyone
is able to help me, with information about this topic, or some reference/s
via the internet, that could be great to work a bit faster without messing
about discovering how those things work.

Sincerelly, JKD

P.D.: I apologize about my english level