Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
3.2 KiB

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