Another suggestion. Since this curve is to be applied repeatedly, there is no sense wasting time always computing the correction with slow floating point math. Build a table as an array of ints. Fill it properly in the setup code, using the gamma value you have chosen.
Then as you need it, use tableCorrection[x] instead of x. Much faster; no floating point involved.