home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / graphics / 13296 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  2.0 KB

  1. Path: sparky!uunet!news.larc.nasa.gov!mollusk.larc.nasa.gov!user
  2. From: judith@mermaid.larc.nasa.gov (Judith Moore)
  3. Newsgroups: comp.graphics
  4. Subject: Color data help needed
  5. Followup-To: comp.graphics
  6. Date: 31 Dec 1992 19:03:39 GMT
  7. Organization: NASA/Langley Research Institute
  8. Lines: 39
  9. Distribution: world
  10. Message-ID: <judith-311292135444@mollusk.larc.nasa.gov>
  11. NNTP-Posting-Host: mollusk.larc.nasa.gov
  12.  
  13. A few days ago I posted this to comp.windows.x, and while
  14. I received many suggestions, nothing quite worked.
  15.  
  16.  >I'm new to X-windows and am writing an application for which I
  17.  >need to use a series of (different) 256-color color tables on 
  18.  >a single open window -- that is, with the same image displayed, I
  19.  >want to change the entire colormap an arbitrary number of times.
  20.  >I'm having a lot of trouble making X understand this. Can anyone
  21.  >supply a cookbook of the sequence of events and functions to 
  22.  >thoroughly quash the previous colormap and allow a new one to 
  23.  >color the picture?
  24.  
  25. I've flailed away until I'm blue (Azure? Cyan?) in the face, and
  26. now I wonder if I'm not going about the problem the wrong way.
  27.  
  28. I'm working with 1-byte image data, where the byte values 
  29. represent various signal levels. It is mighty convenient
  30. to setup a smoothly-graduated 256-element color table (going,
  31. say, from black through red, orange, & yellow to white), dump
  32. the image to the screen, and have the data values automatically
  33. correlate with color intensity. That is, I don't have to fritz
  34. around with the data at all to get the kind of display I want.
  35. In fact, the color table I construct _doesn't_ have 256
  36. unique values -- more like 70 or 80 with a number of contiguous
  37. duplicates.  
  38.  
  39. My new question is, is there some other convenient way of
  40. mapping 8-bit values to a table of maybe 100->128 colors?  My
  41. applications need to do this as quickly as possible, and I 
  42. _don't_ want to lose my original data.
  43.  
  44. Any help, references, cogitation, or (ideally) source code
  45. would be much appreciated.
  46.  
  47.  
  48. Thanks.
  49. Judith Moore
  50.  
  51. judith@mermaid.larc.nasa.gov
  52.