[sane-devel] Unknown tables
Bertrik Sikken
bertrik@zonnet.nl
Mon, 13 Sep 2004 08:54:24 +0200
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.
Indeed, I can imagine that those tables are used for offset / gain
correction of individual CCD pixels. The values you describe could
then be the default fill for a neutral offset/gain setting.
In that case, the first table looks like the offset. The second table
looks like the gain (in fixed point format, where 0x4000 represents
a gain of 1, 0x2000 is a gain of 0.5, 0x8000 is a gain of 2, etc.)
I think you're right that there is one set of gain/offset tables
for each colour.
Once thing that does not quite match is the size of the table:
I would expect the number of table entries to be equal to the
number of pixels in the CCD, but 2040 pixels is not even enough
to reach 300 DPI.
Bertrik