Newsgroups: comp.sys.amiga.graphics
Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!lethe!compus!cccan!entity
From: entity@cccan.uucp (Cybernetworx)
Subject: Re: Help using the Blitter in C or in ASM!!
Message-ID: <1991Jun21.134610.8533@cccan.uucp>
Organization: CCCAN
References: <1991Jun19.110423.48153@cc.usu.edu>
Date: Fri, 21 Jun 91 13:46:10 GMT

In article <1991Jun19.110423.48153@cc.usu.edu> slmt9@cc.usu.edu writes:
>
>	This is another plea for help. 
>
>	I need to be able to blit a piece of one picture onto another piece
>of a a picture. Here the catch. I want to be able to see through the parts of
>the picture that were black on the source of blit.

Ok what you are referring to requires a blitter mask.  What a mask lets
you do is say which bits are solid, and which ones can you see through.
The way a mask is construcuted is to 'OR' all the bitplane bits together.
ie.  if for a given pixel position within your bitmap, any pixel on any
bitplane is a 1, your mask will also contain a 1, otherwise it will be
a 0.  The easiest way to create masks is to a) write yourself a small
proggy that'll do it, or b) use some PD utility like IFFmaster to do it
for you automatically.
 
Once you have the image mask, you can then do the blit.  If you are using
system routines, you would want to use BltMaskBitMapRastPort() which lets
you specify a minterm and a pointer to the mask.
 
If you are going to use the hardware directly, you could do it the following
way: bltAptx=mask, bltBptx=source, bltCptx=destination, bltDptx=destination.
Actually, the C DMA channel is used to point to the background, but since
this is usually the destination, you set it to same value as D channel. 
Finally, use a minterm of $CA.
 
Using this, only those bits of the image will be blitted which have a 
corresponding 1 in the mask bitplane.
 
>	Thanks in advance,
>	Joshua
>	SLMT9@cc.usu.edu
-- 
          __
    __   ///
    \\\ ///               UUCP:   ...uunet!utai!lsuc!becker!cccan!entity
 CYBERNETWORX             INET:   entity@cccan.UUCP
