Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!caen!uflorida!gatech!ncsuvx!news From: hudacko@ecevl1.enet.dec.com (Ted SCUDako) Newsgroups: comp.windows.x Subject: Re: How to get 24-bit pictures on DECstation 5000/200PXG? Message-ID: <1991Feb8.193425@ecevl1.enet.dec.com> Date: 9 Feb 91 00:44:56 GMT References: <9102060022.AA04657@lightning.McRCIM.McGill.EDU> Sender: news@ncsuvx.ncsu.edu (USENET News System) Reply-To: hudacko@ecevl1.enet.dec.com (Ted SCUDako) Organization: Digital Equipment Corporation Lines: 44 In article <9102060022.AA04657@lightning.McRCIM.McGill.EDU>, mouse@lightning.mcrcim.mcgill.EDU writes: |> Path: ncsuvx!lll-winken!uwm.edu!wuarchive!zaphod.mps.ohio-state.edu!usc!snorke elwacker.mit.edu!bloom-beacon!dont-send-mail-to-path-lines |> From: mouse@lightning.mcrcim.mcgill.EDU |> Newsgroups: comp.windows.x |> Subject: Re: How to get 24-bit pictures on DECstation 5000/200PXG? |> Message-ID: <9102060022.AA04657@lightning.McRCIM.McGill.EDU> |> Date: 6 Feb 91 00:22:56 GMT |> Sender: daemon@athena.mit.edu (Mr Background) |> Organization: The Internet |> Lines: 73 |> In your case, you want a colormap created on the DirectColor or |> TrueColor visual; from what you said above, I think you want the |> TrueColor one. |> |> + Use XMatchVisualInfo to find a 24-bit TrueColor visual. |> |> + If it's the default visual, use the default colormap; |> if not, create a colormap for it. |> |> + Create a window with the visual and colormap you just found. |> |> + Construct your 24-bit pixel values by using the red-mask, green-mask, |> and blue-mask values for the Visual to plug your RGB values into a |> 24-bit word. Here is the protocol document's description of these |> three mask values: |> The red-mask, green-mask, and blue-mask are only defined for |> DirectColor and TrueColor. Each has one contiguous set of bits |> set to 1 with no intersections. Usually each mask has the same |> number of bits set to 1. |> If you have only a few colors to use and don't want to mess with |> figuring out the shifts and masks you need, you can just XAllocColor |> for each color. |> I'm working on displaying 2D raster graphics on a 24bit-plane TrueColor DECstation 5000/200 and this discussion and suggestion seems pretty much to correlate with what I've been doing. However, using the XAllocColor() routine for every pixel in your image makes things really slow. Ted Hudacko