On Thu, 20 Jul 2006, Rene Rebe wrote: > On Tuesday 18 July 2006 19:35, m. allan noah wrote: >>> As far as I know, xsane automatically calculates and downloads a gamma >>> table for brightness / contrast / gamma if the backend advertises it. >> >> interesting! do you know of a backend that does this? i would like to see >> the option structures which are used... of course, not everyone uses >> xsane, so i might have to steal the code from it :) > > I think xsane does it for any backend with gamma tables.
as defined by having an option named by the macro SANE_NAME_GAMMA_VECTOR? > The Avision backend has gamma tables as well as emulation. The calculation > of brightness/contrast was pasted from an old gimp version and might have > the undesired, imperfect effects as you outlined in your previous mail. > > Watch for brightness_contrast_func and send_gamma in the avision.c. > yes, after looking at your implementation and doing quite a bit of reading, it appears that my previous mail may have been incorrect in its assertion of those defects. it would seem that brightness/contrast as normally used have relationship that varies quite a bit depending on the author of the software package in question :) i have played a bit with the xsane histogram, and watched its affect on the brightness/contrast/gamma sliders. it would seem that really more than 3 controls are needed, and saneopts.h agrees, listing option names for highlight, shadow, white point, and black point, in addition to gamma. several 'levels' type controls i found documented on the web use those 5 options instead of 3 separate controls (brightness/contrast/gamma) it seems, looking thru several backends, that there are quite a few backends that use some form of gamma table internally, and could perhaps benefit from some code sharing at the sanei level, as well as the xsane level. i need to do more research. allan -- "so don't tell us it can't be done, putting down what you don't know. money isn't our god, integrity will free our souls" - Max Cavalera
