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