[sane-devel] brightness/contrast/gamma LUT ideas?
m. allan noah
anoah at pfeiffer.edu
Tue Jul 18 13:03:32 UTC 2006
On Tue, 11 Jul 2006, m. allan noah wrote:
>>> i need suggestions or pointers to code that i could use. what things i can
>>> find are far over my head, but i have a simple brightness adjustment that
>>> shifts the linear slope of the in-out function up or down, and a crude
>>> contrast setting that changes the slope of the function around the center
>>> of the table. i think both of these methods are likely too simplistic.
>>>
>>> anyone?
>>>
>> you might want to have a look @ plustek-usbmap.c, where the brightness &
>> contrast adjustment isdone for the plustek backend. It's quite simple
>> and works okay (tm) ;)
>>
>
so i came up with something similar to your code, except the user contrast
setting is scaled to range from 0 to ~90 degrees, then converted to
radians, then mashed thru a bit of trig (TOA) to give me the slope. this
gives a linear scale instead of the sine scale of direct multiplication.
the line is then recentered vertically, so that it crosses middle gray at
the middle of the input range, making 0 contrast middle gray instead of
black.
user brightness setting is then scaled such that it covers the range
required to move the contrast line completely off the table, so that full
brightness is always white, and minimum brightness is always black,
regardless of contrast setting.
the function is send_lut() in backend/fujitsu.c, and it should be generic
enough to work with other backends table widths, though fujitsu only uses
8 and 10 bit tables.
should i add this to sanei_* somewhere, and make it even more generic?
could other backends use it?
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
More information about the sane-devel
mailing list