[comp.sys.amiga] a "mirror image" blit

A_HINDS%HVRFORD.BITNET@cornellc.cit.cornell.edu (10/14/89)

        I posted this message before, but received no answers, so I'll try
again.  What I need to do is take source bitmap, and blit its mirror image
into the destination bitmap.  Now I know this can be done with low-level
bliter calls, but I can't seem to figure out quite how to do it.
        For example, if the area to be blitted is a 10x10 square, I want
what was (0,0) in the source to become (0,9) in the destination, etc.
        Any help would be greately appreciated.  I thank you in advance.
(I don't have uucp access, so a public posting would be better.)

Alexander Hinds
A_HINDS@HVRFORD

jgary@ms.uky.edu (James E. Gary) (10/14/89)

In article <1646@nigel.udel.EDU> A_HINDS%HVRFORD.BITNET@cornellc.cit.cornell.edu writes:
>
>again.  What I need to do is take source bitmap, and blit its mirror image
>into the destination bitmap.  Now I know this can be done with low-level
>Alexander Hinds
>A_HINDS@HVRFORD

Me too. Can this be done quickly? I tried doing something like this
in real time with a LIVE digitizer. It worked, but was slow. The best
I could figure to do was go blit each column of pixels on the left
side of the screen to the corresponding position on the right hand side
of the screen.

Unlike Mr. Hinds, I am not convinced that a better way exists, but would
be very interested if someone finds one.
-- 
+-----------------------------------------------------------+
| James Gary   jgary@ms.uky.edu | Hoping someday to have    |
|    University of Kentucky     | laurels to rest on.       |
+-----------------------------------------------------------+

filbo@gorn.santa-cruz.ca.us (Bela Lubkin) (10/15/89)

In article <1646@nigel.udel.EDU> Alexander Hinds writes:
>What I need to do is take source bitmap, and blit its mirror image
>into the destination bitmap.  Now I know this can be done with low-level
>bliter calls, but I can't seem to figure out quite how to do it.

Is this possible?  My reading of the hardware manual suggests it is not.
What would be the hardware basis for it (what blitter mode did you think
will do it)?  If there's a hardware mode ... there might not be software
support for the mode, but there IS support for programming the blitter
directly without taking over the system...

Bela Lubkin    * *    //  filbo@gorn.santa-cruz.ca.us  CompuServe: 73047,1112
     @       * *     //   ....ucbvax!ucscc!gorn!filbo  ^^^-VERY slow [months]
R Pentomino    *   \X/    Filbo @ Pyrzqxgl +408-476-4633 & XBBS +408-476-4945

rogers@iris.ucdavis.edu (Brewski Rogers) (10/15/89)

In article <1647@nigel.udel.EDU> A_HINDS%HVRFORD.BITNET@cornellc.cit.cornell.edu writes:
>
>again.  What I need to do is take source bitmap, and blit its mirror image
>into the destination bitmap.  Now I know this can be done with low-level
>bliter calls, but I can't seem to figure out quite how to do it.
>        For example, if the area to be blitted is a 10x10 square, I want
>what was (0,0) in the source to become (0,9) in the destination, etc.
>        Any help would be greately appreciated.  I thank you in advance.

What you want do is screw with the modulo's for the blitter rectangles.
Set up the source rectangle pointer to point to the last line of the rectangle,
and set the modulo to some negative value, such that it will get you
to the beginning of line 9 from the end of line 10. Set up the destination
bitmap normally - set the pointer to the beginning of the rectangle,
and use a modulo such that it will get you to the begginning of line 2
from the end of line 1...

Hope this helps...

------------------------------------------------------          Quantum _\/_
2727 Eel                   Bruce (6502 RULES!) Rogers        |\  Duck  ( 0 0)
Davis, Ca 95616            Quantum Duck Software,           |\ \______/ / \\\
916-756-2684               rogers@iris.ucdavis.edu         |\ <  <     |   \/
"It's better to be the real thing than the right thing."     \________/  Quark!

new@udel.edu (Darren New) (10/16/89)

I don't know how fast this would be, but you could use a
recursive algo to set up the blits:
Blit the left half to the right half, blit the right half
to the left half, mirror image each half recursively.
This also works for up/down, "block move" or a slice, and
rotation by i*90 degrees.    -- Darren

kirkb@cod.NOSC.MIL (Kirk Baker) (10/17/89)

[]

	I have written something to do exactly what you guys want.  It takes
a bitmap structure, and 'flips' the bitmap on the Y axis.  I also have one
that flips a bitmap in the X direction.  As for speed:  I have a 704X240 one
bitplane workbench screen up, and I can flip the screen ~15 times a second
in the Y direction- about 20 times a second in the X direction.  
	If anyone wants it, then email me, or if enough people want it
posted, then I will...
	P.S. I also have an extremely fast 2,4, or 8 power zoom that works
on bit bondaries, if anyone is interested.

Kirk
kirkb@cod.nosc.mil.UUCP

mlelstv@immd4.informatik.uni-erlangen.de (Michael van Elst ) (10/20/89)

filbo@gorn.santa-cruz.ca.us (Bela Lubkin) writes:

>In article <1646@nigel.udel.EDU> Alexander Hinds writes:
>>What I need to do is take source bitmap, and blit its mirror image
>>into the destination bitmap.  Now I know this can be done with low-level
>>bliter calls, but I can't seem to figure out quite how to do it.

>Is this possible?  My reading of the hardware manual suggests it is not.

It won't be possible. The blitter can't address one bitmap in ascending
order and the destination bitmap in descending order ! It can't swap
bits in a word either.

The fastest way should be a table of 65536 mirrored words and convert each
bitmap word through this table. If you have to place the mirror at a different
place or it's not a multiple of words wide you have to shift the words to
a new position. This task is easily handled with the BltBitMapRastPort routine.

				Michael van Elst

E-mail: UUCP: ...uunet!unido!fauern!immd4!mlelstv