Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!ub!acsu.buffalo.edu From: marsha@acsu.buffalo.edu (john c marsha) Newsgroups: comp.graphics Subject: 24 bit SUN Rasterfile and Quaternions Keywords: HELP!!!!! Message-ID: <81735@eerie.acsu.Buffalo.EDU> Date: 30 Jun 91 16:07:45 GMT Sender: news@acsu.Buffalo.EDU Organization: SUNY Buffalo Lines: 42 Nntp-Posting-Host: lictor.acsu.buffalo.edu ANY advice on this would be EXTREMELY helpful (i'm at the end of my rope) I am almost finished with a program that raytraces Quaternions. I am using an intensity function which returns the intensity values in red, blue, and green for each pixel. I'd like to see the results placed in a SUN Rasterfile format (RT_STANDARD,RGB_EQUAL_RGB is what i'm using now) but here are the problems: 1) With the ras_depth = 8, there are 256 color to choose from. Does anyone have a good algorithim for creating a 256 color colormap from the calculated intensites? (e.g. If red[0],green[0],blue[0] intensites represent the first pixel on the screen, how can a colormap be created that allows red[500], green[500], blue[500] be the 501st (0 to 500 is 501 numbers) pixel and still access 256 colors, obviously some of the intensites have to be comprimised.) 2) Is it possible for a SUN rasterfile to support 24 or higher bit depth? With 24 Bits: One could reference 16,777,215 colors. (this would mean a 200x200 image would have a length of 120,000 bytes and the colormap length would be 360,000 bytes) 3) Isn't there a way to just say "here is the Red, Green and Blue intensites (relative to some scale i.e. 0 dark 255 bright) without using an actual image map? (ras_length = 0 but the maplength would be depth * width * height * 3 (one for each color). r[0],b[0],g[0] would actually be the pixel 0,0, not the "reference" to the color) ARRRRGH!!!!! (I have the image but I cant see it properly!!!!!!!) If this is making no sense, i'll re-word it for a kind, helping soul. Kevin (using a friend's account) BTW: If it helps, I'm running this on a SUN Sparc IPC w/ a 1024x1024 (?) screen.