Xref: utzoo comp.sys.amiga:41675 comp.sys.amiga.tech:7591 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rice!uw-beaver!Teknowledge.COM!polya!rokicki From: rokicki@polya.Stanford.EDU (Tomas G. Rokicki) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: mirror image blits Message-ID: <12453@polya.Stanford.EDU> Date: 15 Oct 89 08:32:29 GMT Followup-To: comp.sys.amiga.tech Organization: Computer Science Department, Stanford University Lines: 27 You people want to blit mirror image? Here's some ideas. First, most obvious solution. Do a single pixel column at a time. For an mxn blit, by d bitplanes, you will need m*d blits, each n words long, for a total of 3*m*n*d memory references not counting setup (which is appreciable in this case.) A slight improvement is to try to do each bit0->bit15 in one blit. Problem with this is you need one channel to increment and the other to decrement. This can be done with modulos, using a width of 1, providing the width in words times the height of your rectangle is <= 1024, and that your rectangle spans the entire bitmap. If these conditions are met, a total of 16 blits are all that is required. Best, though, is simple table lookup: char table[256] ; for (i=0; i<256; i++) for (b=0; b<8; b++) if (i & (1 << b)) table[i] |= (128 >> b) ; Now, for each byte in the source image, look it up in the table, and if necessary, shift it some bits. Very fast, very easy. -tom