home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / mac / programm / 13934 < prev    next >
Encoding:
Text File  |  1992-08-13  |  1.9 KB  |  37 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!destroyer!gumby!kzoo!k044477
  3. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  4. Subject: Re: HELP: Color mapping and copybits
  5. Message-ID: <1992Aug13.140905.7600@hobbes.kzoo.edu>
  6. Organization: Kalamazoo College
  7. References: <m0mITTz-0006ChC@gluttony.reed.edu>
  8. Date: Thu, 13 Aug 1992 14:09:05 GMT
  9. Lines: 26
  10.  
  11. gluttony@reed.edu!gluttony.reed.edu!pcalahan (Patrick John Calahan) writes:
  12. >I have two offscreen pixmaps, one 4bits deep and one 8bits deep.
  13. >Each has its own color table of 16 and 256 colors respectively.  I want to  
  14. >be able to copy one to the other with copybits and have the colors
  15. >be mapped using the color tables (im using apple standard colors for
  16. >both tables).  The problem is, as I understand it, copybits uses the
  17. >current gDevice's color table for the destPixmap.  What do I do?
  18.  
  19. Make sure the current GDevice is set up the way you want it.  :-)  That
  20. will usually mean making your own;  but if you get lucky and one of the
  21. screens is set up right, then no one will stop you from mooching off it.
  22.  
  23. TN120's listing 3 is great source code for making your own.
  24.  
  25. (BTW, it's more appropriate to say "CopyBits uses the current GDevice's
  26. color environment" than "...color table."  For example, I don't think
  27. CopyBits will even look at the GDevice's color table beyond checking
  28. ctSeeds to see if it can do a fast copy.  If the fast-copy is ruled out,
  29. CopyBits uses the _inverse_ table to decide where to map all the colors.
  30. Or the destination might even use direct color, in which case there
  31. isn't any "GDevice's color table."  :-)  Sorry about all that, I just
  32. felt like picking a nit...  :-)
  33. -- 
  34.  Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
  35.  The essence of OOP:  "After some hacking, I finally got the program to
  36.  work, but I'm still not sure why."  - David Marcovitz (marcovitz@uiuc.edu)
  37.