home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / windows / x / 21636 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.4 KB

  1. Path: sparky!uunet!ogicse!usenet.coe.montana.edu!saimiri.primate.wisc.edu!doug.cae.wisc.edu!castlab!spy
  2. From: spy@castlab.uucp (Mark W. Spychalla)
  3. Newsgroups: comp.windows.x
  4. Subject: How do I compute 24 bit TrueColor pixel value from RGB color?
  5. Message-ID: <1993Jan26.203113.8117@doug.cae.wisc.edu>
  6. Date: 27 Jan 93 02:31:12 GMT
  7. Article-I.D.: doug.1993Jan26.203113.8117
  8. Organization: University of Wisconsin- Madison
  9. Lines: 26
  10.  
  11.  
  12. Hello,
  13.  
  14.     Does anyone know how to portably determine what pixel value should be
  15. used for an RGB color on a 24 bit display?
  16.  
  17.     A few years ago I had brief access to a 24 bit DECstation 5000/200
  18. PXG turbo that I remember used:
  19.  
  20.    pixel_value = (red << 16) | (green << 8) | blue;
  21.  
  22. Today, I was able finally to use another 24 bit machine again (an Iris!) for
  23. a few minutes and it used:
  24.  
  25.    pixel_value = (blue << 16) | (green << 8) | red;
  26.  
  27. So I believe the pixel value computation for a TrueColor visual is server
  28. dependent.  I have written several X graphics programs (x3d, xdart) and
  29. am  now finishing up work on a new renderer with my friend Abe.   I want to
  30. improve the portability of my code and have it work on all 24 bit servers,
  31. so I will appreciate any suggestions on determining how to perform the
  32. correct pixel value computation.
  33.  
  34. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  35.    Mark Spychalla (spy@dpls.dacc.wisc.edu)
  36. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  37.