[comp.sys.mac.programmer] Need help animating with 24 bit card

pierce@radius.com (Pierce T. Wetter III) (06/06/90)

>I wrote a program about 2 years back which needed to
>change the color of circles on the screen at a very fast rate. I
>accomplished this by calling AnimatePallette. Of course this limited
>me to a maximum of 254 objects at any time due to our 8 bit card.  I
>now need to write a similar application which does the same thing except
>with many more objects... in the range of about a thousand.

>I thought it might be possible to do the same thing except with a
>24 bit card. 

  Funny you should ask about this, I just did this for PrecisionColor (radius's
 Monitor calibration gizmo, that I am responsible for writing the software to)

  You can animate colors on a 24 bit board, but there are some caveats:

    1: You can only do 256 arbitrary colors at at time.
    2: Other colors besides the one you wish to animate will animate as well.
    3: For non arbitrary colors, you can animate 256 shades of red, 256 of
       blue and 256 of green.


  The necessary technique is to use the gamma table to do your animation for 
  you. All the 24-bit cards on the mac have an 8-bit by 8-bit table in front
  of the dac. One way to animate a color is to pick an entry in all three
  of these tables. Lets pick ( 0xFE,0xFE,0xFE) as an example. If I draw a
  circle in that color and then change those particular entries in the gamma
  table to whatever color I want, the circle will change to that color. 
   (This is how the not-yet-released Turbo Precision Color works.)

   This still limits you to 254 colors (assuming you don't animate full white
  and full black). However, you can do more by animating your circles to just
  red, and just green and just blue. If you do that, then you can use all the
  colors ( N, 0, 0) & (0,N,0) and (0,0,N). If you don't mind your circles 
  overlapping when you animate (for instance, you could have an indicator LED
  colored (N,N,0). You can then animate red to be indicating one variable, and
  green to be the other variable. The LED will then take on any shade from red
 to green to yellow. This lets you have more animating circles, but you can 
 still only have 3x254=762 INDEPENDENT circles.

  Of course, this probably won't help you any, but I had fun talking about 
  what I was doing.

Pierce

P.S.: Since I mentioned it, its only fair to say that the new software
 is just a minor upgrade to support the 8..24 and 8..24GC. While I was at it
 I made it 3x faster, but that's beside the point.
-- 
My postings are my opinions, and my opinions are my own not that of my employer.
You can get me at radius!pierce@apple.com.
(Wha'ja want? Some cute signature file? Hah! I have real work to do.