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