home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!news.service.uci.edu!ucivax!gateway
- From: kanderso@liege.ICS.UCI.EDU (Kenneth Anderson)
- Subject: Palettes and Color Tables
- Message-ID: <9301241717.aa26369@Paris.ics.uci.edu>
- Newsgroups: comp.sys.mac.programmer
- Lines: 50
- Date: 25 Jan 93 01:17:19 GMT
-
- In the course of messing around with PICTs, I discovered the PICT Utilities.
- I have written a small program, which allows you to select a PICT file,
- read it in, and then print out some information on the PICT in a window.
-
- In making the call to GetPictInfo, I requested that both a Color Table and
- a Palette be returned. Then, in my information window, I print out the
- following values
-
- The Palette's pmEntries => -2900
- The Color Table's seed => -190028262
- The Color Table flags => 9849
- The Color Table Size => 882
-
- These are not the values that I expected. When I did the call to GetPictInfo,
- I requested 256 colors. I assumed that this meant that the returned Palette
- and Color Table would have 256 entries each, but that's what I get for
- assuming!
-
- Oh by the way, the GetPictInfo call returns 32 as the Picture's depth. Is
- this a legal value? I was expecting 24 since I was reading a PICT created by
- POV-RAY, a ray tracer for the Mac.
-
- I am using the function NumToString to convert the values stored in the
- PictInfo data structure from numbers into strings, and then I use DrawString
- to print the values to my window.
-
- There are several questions that I would love to have people comment on:
-
- 1. Are there cases where GetPictInfo will not return a valid Palette/Color
- Table?
-
- 2. Is it reasonable to assume that the Palette and the Color Table returned
- by GetPictInfo will contain the same information?
-
- 3. Can someone give me a description of what the fundamental distinction is
- between a Palette and a Color Table? I.E. when would you want to use one
- over the other?
-
- Thanks in advance,
-
- Ken
-
- P.S. Please respond to the newsgroup, I read it each day, and won't miss
- any responses...
-
- P.P.S. Thanks to those people who answered my question about converting
- a Handle to a PicHandle. It turned out that when I read in the
- Data Fork of the PICT file, I forgot (actually I didn't even know
- I was supposed to do this) to skip the 512 byte header. Once I
- did that, I could convert the Handle to a PicHandle no problems...
-