CopyBits vs CopyMask

Member
Posts: 45
Joined: 2002.04
Post: #1
Is there any advantage to using one over the other?

in my case, I'd be using the transparent copy mode of CopyBits to filter out the background, the problem of course is that all of my graphics have to have a pure white background and cannot be anti-aliased otherwise they have the blended pixel border..


is there a speed improvement in using CopyMask over Bits?

Hank

/* Drunk...... fix later.... */
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #2
CopyBits is faster than CopyMask, and don't even think about using CopyDeepMask Grin
Quote this message in a reply
Pancho
Unregistered
 
Post: #3
Hi guys, I have a question. If CopyBits with the transparent copy mode is much faster than copy mask, why then would anybody use CopyMask ? Because of the anti-aliased graphics ?

I have this idea:

You have your GWorld with the sprites perfectly anti-aliased, and you have your GWorld with the masks. So then you create a third GWorld with a background of some weird colour you're not planning to use anywhere else in your game, lets say pink. You use CopyMask to copy the perfectly anti-aliased pictures onto the pink background GWorld. Then you can use CopyBits with the transparent copy mode and you can save space by deleting the other 2 GWorlds (the mask and the anti-aliased sprites).

So the question is: if this is feasible, why isn't anybody doing it ? Anythign wrong with this logic ?

Pancho
Quote this message in a reply
henryj
Unregistered
 
Post: #4
You'll get pink fringing around your sprites where the background bleeds under the anti aliased pixels.

Have a go at writing your own copymask. The carbon version has to work in all sorts of different cases. You should be able to write a specialised version for your sprites that will be faster...
Maybe.
The fact of the matter is that anti aliasing is slow. There is no way round this.

Go here...

http://search.lists.apple.com/mac-games-dev

and do a search on copybits and copymask
Quote this message in a reply
henryj
Unregistered
 
Post: #5
Here are some quotes I found after a quick search...
"Conventional wisdom will say that CopyBits with a mask region is faster than CopyMask. However, I have found, at least with recent Systems on PowerPCs, that there is not really any noticeable difference between CopyBits with a mask region and CopyMask using a maskbits with a bit depth of 1."

"Remember both CopyBits & CopyMask are generic routines that handle color translation and scaling. If you are copying from/to the same size/depth buffers and only want to mask out a specific color then you can write a much faster blitter yourself. "

Look for anything by George Warner. He's a clever bugger.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Fast 2d rendering - CopyBits LongJumper 5 3,276 Sep 10, 2003 01:58 PM
Last Post: Josh