All pastes #292525 Raw Edit

brecht

public c v1 · immutable
#292525 ·published 2006-12-26 17:00 UTC
rendered paste body
static float powtable[256];void make_pow_table(float gamma){  int a;    for (a = 0; a <256; a++) {    float f = a/255.0f;    powtable[a] = pow(f, gamma);  }}void lookup_pow_table(float f, float gamma){  int a = (int)(f*255);  if (a >= 0 && a <= 255)    return powtable[a];  else    return pow(a, gamma);}