+ unsigned short s;
+ const unsigned short grey50=143, grey75=177, grey25=97;
+ float blah;
+
+ if (A_SNs_curve)
+ {
+ // The next formula is all about gaussian interpolation
+ blah = (( -128 * exp(-powf((float) i/64.0f + 2.0f , 2.0f))) +
+ ( -64 * exp(-powf((float) i/64.0f + 1.0f , 2.0f))) +
+ (grey25 * exp(-powf((float) i/64.0f - 1.0f , 2.0f))) +
+ (grey50 * exp(-powf((float) i/64.0f - 2.0f , 2.0f))) +
+ (grey75 * exp(-powf((float) i/64.0f - 3.0f , 2.0f))) +
+ ( 256 * exp(-powf((float) i/64.0f - 4.0f , 2.0f))) +
+ ( 320 * exp(-powf((float) i/64.0f - 5.0f , 2.0f))) +
+ ( 384 * exp(-powf((float) i/64.0f - 6.0f , 2.0f)))) / (1.772637f);
+ blah += 0.5f;
+ }
+ else
+ {
+ blah = i;
+ }
+
+ g = (unsigned char)(255.0*pow(blah/255.0,gamma));
+ //printf("%d : %d\n", i, g);
+ s = (g<<8) | g;