Home | History | Annotate | Download | only in test

Lines Matching refs:gamma

2 /* Bring up a window and manipulate the gamma on it */
18 /* Turn a normal gamma value into an appropriate gamma ramp */
19 void CalculateGamma(double gamma, Uint16 *ramp)
23 gamma = 1.0 / gamma;
25 value = (int)(pow((double)i/256.0, gamma)*65535.0 + 0.5);
77 float gamma;
104 SDL_WM_SetCaption("SDL gamma test", "testgamma");
106 /* Set the desired gamma, if any */
107 gamma = 1.0f;
109 gamma = (float)atof(*argv);
111 if ( SDL_SetGamma(gamma, gamma, gamma) < 0 ) {
112 fprintf(stderr, "Unable to set gamma: %s\n", SDL_GetError());
116 #if 0 /* This isn't supported. Integrating the gamma ramps isn't exact */
117 /* See what gamma was actually set */
120 printf("Couldn't get gamma: %s\n", SDL_GetError());
122 printf("Set gamma values: R=%2.2f, G=%2.2f, B=%2.2f\n",
157 gamma += 0.2f;
158 SDL_SetGamma(gamma, gamma, gamma);
161 gamma -= 0.2f;
162 SDL_SetGamma(gamma, gamma, gamma);
175 /* Perform a gamma flash to red using color ramps */
176 while ( gamma < 10.0 ) {
177 /* Increase the red gamma and decrease everything else... */
178 gamma += 0.1f;
179 CalculateGamma(gamma, red_ramp);
180 CalculateGamma(1.0/gamma, ramp);