### Thanks. I was able to find

Thanks. I was able to find the function in curves.cpp. Its more complicated that I thought.

I m guessing that gamma is pwr and gamma is ts. I don't know what mode is but 1 seems to work for me.

```void LibRaw::gamma_curve(double pwr, double ts, int mode, int imax)
{
int i;
double g, bnd = {0, 0}, r;

g = pwr;
g = ts;
g = g = g = 0;
bnd[g >= 1] = 1;
if (g && (g - 1) * (g - 1) <= 0)
{
for (i = 0; i < 48; i++)
{
g = (bnd + bnd) / 2;
if (g)
bnd[(pow(g / g, -g) - 1) / g - 1 / g > -1] = g;
else
bnd[g / exp(1 - 1 / g) < g] = g;
}
g = g / g;
if (g)
g = g * (1 / g - 1);
}
if (g)
g = 1 / (g * SQR(g) / 2 - g * (1 - g) +
(1 - pow(g, 1 + g)) * (1 + g) / (1 + g)) -
1;
else
g = 1 / (g * SQR(g) / 2 + 1 - g - g -
g * g * (log(g) - 1)) -
1;
if (!mode--)
{
memcpy(gamm, g, sizeof gamm);
return;
}
for (i = 0; i < 0x10000; i++)
{
curve[i] = 0xffff;
if ((r = (double)i / imax) < 1)
curve[i] =
0x10000 *
(mode ? (r < g ? r * g
: (g ? pow(r, g) * (1 + g) - g
: log(r) * g + 1))
: (r < g ? r / g
: (g ? pow((r + g) / (1 + g), 1 / g)
: exp((r - 1) / g))));
}
}```