[xfree] Re: [sane-devel] Option not active

stef stef-listes@wanadoo.fr
Thu, 14 Aug 2003 21:16:46 +0000


On Thu, Aug 14, 2003 at 11:57:49AM +0530, aneesh m raj wrote:
> Hi Stef,
> Im writing a frontend, I have tried to set the custom-gamma to 1 ,but it is
> saying that the custom-gamma option is not active.Stef, i have a doubt the
> gamma value is from 0 to 255 then why do we need 1024 bytes?Suppose I want
> to set the gamma-table with value 250 does that mean that I have to set each
> SANE_Int(out of 1024) to 250 or will it be sufficient to alloc 1024 memory
> and set 250 to that.
> Thanks for ur help
> Aneesh

	Hello,

	there's currently a bug that prevent use of the custom gamma option. I'll
fix it soon in CVS. 
	The 1024 bytes size is 256*sizeof(SANE_Int). It is used by the scanner to
correct the values it scans. The value at index 0 is used for a scanned value of
0, index 1 for a scanned value of 1, ... up to 255. A gamma table that would
give exactly what is scanned would be a "ramp": gamma[i]=i . But it does not
give nice scans. The default gamma table is like a ramp for the middle, but has
a bigger slope at the start and a smaller at the end, certainly to cope with the
native behavior of the CCD.
	You can have an example, and do some tests, with xscanimage. Well, once
my fix will be in CVS, and if you use it.

	You can look at the default gamma table line 331 of umax_pp_low.c in the
sane-backend sources. Also, gamma tables are declared line 139 of umax_pp.h .

Regards,
	Stef