general purpose bit blitter

Hans Jespersen hjespers at attcan.UUCP
Fri Oct 20 23:47:10 AEST 1989


dean at image.soe.clarkson.edu (Dean Swan):
> Along the lines of RAM access, I need to plot waveforms and such in a window.
> I wrote a line drawing routine that calls WRASTOP, but it is painfully slow.
> I suspect that it is because WRASTOP issues a refresh to the window, before
> doing a blit evertime it is called.  I've thought about reimplementing it to
> build a bitmap in user memory of the line and then just doing a single WRASTOP
> call to copy it to the window, but that seems like an awful lot of work just
> to draw a line.  Can anyone help?

WRASTOP will accept destination bitmaps (dstbase) other than the screen.
You define an array like this:

unsigned short Bitmap[WIDTH * HEIGHT / 16];

and then use WRASTOP like this:

/* repeat until Bitmap is what you want on the screen */
for(;;){
	wrastop( w, srcbase, srcwidth, Bitmap, WIDTH/8, srcx, srcy, 
	         dstx, dsty, width, height, srcop, dstop, pattern);
}
/* Wack Bitmap onto screen */
wrastop( w, Bitmap, WIDTH/8, 0, 0, 0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
         SRCSRC, DSTSRC, 0);

BUT, if all you are doing is building a line it would be even better to
just fiddle with the bits in Bitmap[] directly. (ie. Bitmap[offset] |= 0x0001)
and then print the Bitmap on the screen.
    
-- 
Hans Jespersen                UUCP: uunet!attcan!hjespers
AT&T Canada Inc.                
Toronto, Ontario              "Yabba Dabba Doo" -- F. Flintstone



More information about the Unix-pc.general mailing list