🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #11328

Re: BltMaskBitMap function needed

#11328
From: Jim Mackraz
Date: Fri, 03 Feb 1989 20:04
45 lines
2503 bytes
In article <254@vixen.uucp> joe@vixen.UUCP (Joe Hitchens) writes:
)
)I need source code for a function to blit from a source BitMap to a
)destination BitMap through a mask.
)What would be perfect is one that is identical to BltMaskBitMapRastPort()
)except that instead of the destination being a RastPort, the destination
)is a BitMap.
)
)Or alternatively, I could use BltMaskBitMapRastPort() if I knew that there
)was no significantly greater overhead in using it, when the RastPort in
)question was allocated and initialized by my own code, i.e., not attached
)to a Window, [ ... ]
)joe@vixen.uucp

Correctomundo, Joe.  Just point an "unlayered" rastport at it and the overhead
will be low.  Certain bookkeeping will be respected, such as the rastport
mask, but I don't think you will have a performance problem from these things,
compared to blitting overhead.

The first thing most of the rastport routines do is check to see if there is
a layer hanging off of the rastport, and if there is they get into a clipping
kind of thing.  Otherwise, they are quite clean.  It was a priority to make
unlayered rendering very fast; I know Dale took this as a mission from God.

You can even allocate the rastport on your stack ;^)

But wait: it might be that this particular call, BltMaskBitMapRastPort()
performs its function in a non-optimal way, so that it CAN do layered operations.
I've heard something about reserving one of the source operands for layer
masking or something.  You can probably do a masked blit much more directly
using the blitter yourself.

Hmmm.  The principle is sound, but in this case, you might want to go direct.
You can try this first, though.

If you want to go faster, get a copy of BlitLab and go direct.  This is probably
best saved until you perceive actual performance problems.

	jimm

-- 
Jim Mackraz, I and I Computing	   	"Like you said when we crawled down
{cbmvax,well,oliveb}!amiga!jimm          from the trees: We're in transition."
							- Gang of Four
Opinions are my own.  Comments are not to be taken as Commodore official policy.
Technical Details
Message-ID: <3305@amiga.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!amiga!jimm
References: <254@vixen.uucp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!amiga!jimm
From: jimm@amiga.UUCP (Jim Mackraz)
Newsgroups: comp.sys.amiga.tech
Subject: Re: BltMaskBitMap function needed
Message-ID: <3305@amiga.UUCP>
Date: 3 Feb 89 20:04:21 GMT
References: <254@vixen.uucp>
Reply-To: jimm@cloyd.UUCP (Jim Mackraz)
Organization: Commodore-Amiga Inc, Los Gatos CA
Lines: 45