OpenGL Super Bible! Page 407 (Submit web site) 0xff, 0xff, 0,
OpenGL Super Bible! Page 407 0xff, 0xff, 0, 0, /* **************** */ 0xff, 0xff, 0, 0, /* **************** */ 0xff, 0xff, 0, 0, /* **************** */ 0×73, 0xce, 0, 0, /* *** **** *** */ 0×73, 0xce, 0, 0, /* *** **** *** */ 0×3f, 0xfc, 0, 0, /* ************ */ 0×1f, 0xf8, 0, 0, /* ********** */ 0×0f, 0xf0, 0, 0, /* ******** */ 0×03, 0xc0, 0, 0 /* **** */ }; glViewport(0, 0, rect->right, rect->bottom); glClearIndex(0.0); glClear(GL_COLOR_BUFFER_BIT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0, rect->right - 1.0, 0.0, rect->bottom - 1.0, -1.0, 1.0); /* * This bitmap is aligned to 4-byte boundaries */ glPixelTransferi(GL_UNPACK_ALIGNMENT, 4); glPixelTransferi(GL_INDEX_OFFSET, 1); for (i = 0; i < 100; i ++) { glRasterPos2i(rand() % rect->right, rand() % rect->bottom); glDrawPixels(16, 16, GL_COLOR_INDEX, GL_BITMAP, smiley); }; glFinish(); } Color Mapping Tables Sometimes it is necessary to apply color corrections that are more complicated than simple linear scale and offset. One application is gamma correction, in which the intensity of each color value is adjusted to a power curve that compensates for irregularities on your monitor or printer (see Figure 11-2). The glPixelMap function allows you to do this by specifying a lookup table, as follows: GLfloatlut[256]; GLfloatgamma_value; int i; gamma_value = 1.7; /* For NTSC video monitors */ for (i = 0; i < 256; i ++) lut[i] = pow(i / 255.0, 1.0 / gamma_value);
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.