Utah Raster Toolkit  9999-git
URT Development version (post-3.1b)
Functions
gamma.c File Reference
#include <math.h>
#include "round.h"
Include dependency graph for gamma.c:

Go to the source code of this file.

Functions

int gamma (int x, float gamma_value)
 

Function Documentation

int gamma ( int  x,
float  gamma_value 
)

Definition at line 24 of file gamma.c.

27 {
28  static int gammamap[256];
29  static float gv = 0.0;
30 
31  if (gv != gamma_value) {
32  int i;
33 
34  gv = gamma_value;
35  for (i = 0 ; i < 256 ; i++)
36  gammamap[i] =
37  round_positive(255.0 * pow( i/255.0, 1.0/gv));
38  }
39 
40  return gammamap[x];
41 }
int gammamap[256]
Definition: rletopaint.c:59
static int x
Definition: getami.c:691
#define round_positive(x)
Definition: round.h:38
int i
Definition: rletorla.c:82