home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 22088 < prev    next >
Encoding:
Internet Message Format  |  1993-01-24  |  2.3 KB

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