1Randi Rost 2Hewlett-Packard 3970-229-2447 4rost@tortola.fc.hp.com 5 6----------------------------------------------------------------------------- 7 8 9OpenGL RGBA Image Rendering Pipeline (destination is an RGBA visual) 10 111. Image data exist in main memory (as either RGBA or color index values) 122. Extract subimage, performing byte swapping if necessary 133. If pixels are RGBA pixels, convert all components to floats (logically, 14 but not always necessary in practice) 154. If pixels are RGBA pixels, convert all component groups to full RGBA 16 (again, logically, but not necessary in practice) 175a. If pixels are RGBA pixels, perform ax+b operation on each component 185b. If pixels are color index pixels, perform index shift and offset on 19 each index value 206a. If pixels are RGBA values, go through lookup table (OpenGL RGBA to RGBA 21 lookup, controlled by GL_MAP_COLOR) 226b. If pixels are color index values, go through lookup table (OpenGL color 23 index to RGBA lookup, controlled by GL_MAP_COLOR) 247. LUT (COLOR_TABLE_SGI from the SGI_color_table extension) 258. Convolve (including post-convolution scale and bias) 269. LUT (POST_CONVOLUTION_COLOR_TABLE_SGI, from SGI_color_table extension) 2710. Color matrix (including post-color matrix scale and bias) 2811. LUT (POST_COLOR_MATRIX_COLOR_TABLE_SGI, from SGI_color_table extension) 2912. Histogram, min/max 3013. Zoom 3114. Write fragments to the display (includes normal per-fragment operations: 32 texture, fog, blend, etc.) 33 34Notes: 35 36Steps #1-6 and #13-14 are in core OpenGL. The rest come from the imaging 37extensions. Steps #7, 9, 11 come from the SGI_color_table extension. 38Step #8 comes from the EXT_convolution extension. Step #10 comes from 39the SGI_color_matrix extension. Step #12 comes from the EXT_histogram 40extension. 41 42You may notice there is nothing to support image rotation. I would propose 43that we add an affine transformation stage after step #9 in order to support 44image scale, rotate, and translate with proper resampling controls. To follow 45the example set for the convolve and color matrix extensions, we may want 46to follow this with a LUT that would be the means for accomplishing 47window-level mapping. 48 49The zoom function defined by core OpenGL seems insufficient and occurs at the 50wrong point in the pipeline. 51 52How are the typical imaging scale/rotate/resample operations performed in 53the SGI model? Steps 1-9 are performed on an image that is being loaded into 54texture memory. A rectangle is drawn with the geometry, texture coordinates, 55and texturing controls to provide the proper scaling/rotation/resampling 56behavior. This approach seems to have several drawbacks: 57 58 1) The programming model is not simple 59 2) On many architectures, traffic on the graphics bus may be 60 doubled (write to texture memory, followed by a read from 61 texture memory and write into the framebuffer) 62 3) Requires texture mapping hardware to have reasonable performance 63 64The attached extension specification proposes adding an image transformation 65step that occurs immediately after step #9. This image transformation step 66supports image scale/rotate/translate operations, followed by proper 67resampling, followed by another color lookup table that can be used for 68window level mapping. 69 70