Re: A float point arithmetic in kernel extension
Re: A float point arithmetic in kernel extension
- Subject: Re: A float point arithmetic in kernel extension
- From: Graham J Lee <email@hidden>
- Date: Wed, 8 Mar 2006 10:19:02 +0000
On 8 Mar 2006, at 02:39, wlq wrote:
I want to calculate gamma curve in kernel extension.
Now that you can do with some lookup tables[*], and using fixed-point
(i.e. integers). Given that a "gamma" curve has a single parameter
gamma, and maps luminosity to input signal via a power law (L=x^gamma
give or take a constant), we can rearrange this stuff:
L=exp(gamma*log(x))
where the log is natural (i.e. base e). You can do tables for log
and exp; that's all our computers used to do when they were salaried
staff. The error on your final answer is proportional to the
accuracy of your lookups/interpolations.
This all presupposes that you *need* to be using the kernel for this...
[*]which is indeed how a NeXT would have done it, only in hardware.
--
Graham Lee GPG Key ID: 01D5B9D8
UNIX Systems Manager,
Oxford Physics Practical Course
http://users.ox.ac.uk/~wadh1342 01865 273450
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden