Page 406 (Web hosting faq) OpenGL Super Bible! Table 11-2 OpenGL
Friday, November 9th, 2007Page 406 OpenGL Super Bible! Table 11-2 OpenGL Pixel Types Type Description GL_BYTE Signed 8-bit values (from 128 to 127) GL_UNSIGNED_BYTE Unsigned 8-bit values (from 0 to 255) GL_BITMAP Bitmap image (from 0 to 1) Remapping Colors When using GL_COLOR_INDEX colors, you can remap the colors in your pixmap or bitmap using the glPixelMap or glPixelTransfer functions. The glPixelTransfer function lets you specify scaling and offsets for color index and RGB values. For example, here is the code to brighten an RGB image by 10%: glPixelTransferf(GL_RED_SCALE, 1.1) glPixelTransferf(GL_GREEN_SCALE, 1.1); glPixelTransferf(GL_BLUE_SCALE, 1.1); Similarly, to offset the color indices of a bitmap to the palette entries you have defined for it, use glPixelTransferi(GL_INDEX_OFFSET, bitmap_entry); In the smiley bitmap example (Listing 11-7), we might use this to remap the two colors in the bitmap to difference indices: Listing 11-7 Repaint Window function to draw smiley faces void RepaintWindow(RECT *rect) /* I - Client area rectangle */ { int i; /* Looping var */ static GLubyte smiley[] = /* 16×16 smiley face */ { 0×03, 0xc0, 0, 0, /* **** */ 0×0f, 0xf0, 0, 0, /* ******** */ 0×1e, 0×78, 0, 0, /* **** **** */ 0×39, 0×9c, 0, 0, /* *** ** *** */ 0×77, 0xee, 0, 0, /* *** ****** *** */ 0×6f, 0xf6, 0, 0, /* ** ******** ** */ 0xff, 0xff, 0, 0, /* **************** */
We recommend high quality webhost to host and run your jsp application: christian web host services.