[comp.sys.amiga.programmer] help with struct Image

caw@miroc.Chi.IL.US (Christopher A. Wichura) (04/21/91)

I'm working on a project in which I have a struct Image of depth one.  I've
got a need to render it in normal video and reverse video.  Is there an
easy way to draw an XOR of the image without 1) modifying the original
image, 2) boating a second, XORed, copy of the image around in my code or
3) having to allocate a temporary buffer into which to XOR it?

I'm thinking I could just DrawImage() it and then use one of the graphics
library blitter functions to do the XOR for me.  However, I'm no blitter
champ.  Hell, I've hardly done anything with graphics.library before so
this is new ground for me here.

Thanks,
-=> CAW

Christopher A. Wichura                Multitasking.  Just DO it.
caw@miroc.chi.il.us  (my amiga)                          ...the Amiga way...
u12401@uicvm.uic.edu (school account)

ken@cbmvax.commodore.com (Ken Farinsky - CATS) (04/22/91)

In article <caw.9297@miroc.Chi.IL.US> caw@miroc.Chi.IL.US (Christopher A. Wichura) writes:
>I'm working on a project in which I have a struct Image of depth one.  I've
>got a need to render it in normal video and reverse video.  Is there an
>easy way to draw an XOR of the image without 1) modifying the original
>image, 2) boating a second, XORed, copy of the image around in my code or
>3) having to allocate a temporary buffer into which to XOR it?
>
>I'm thinking I could just DrawImage() it and then use one of the graphics
>library blitter functions to do the XOR for me.  However, I'm no blitter
>champ.  Hell, I've hardly done anything with graphics.library before so
>this is new ground for me here.
>
>Christopher A. Wichura                Multitasking.  Just DO it.
>caw@miroc.chi.il.us  (my amiga)                          ...the Amiga way...
>u12401@uicvm.uic.edu (school account)

Intuition Images do not have the features that you want.  You should be
able to do the XOR by directly accessing the blitter, or perhaps, by
using bobs (there is a lot of overhead in the GELs system).  Look
at the graphics library functions BltBitMap() and BltBitMapRastPort().
Note that once you DrawImage(), the bits that the image replaced are gone.
-- 
--
Ken Farinsky - CATS - (215) 431-9421 - Commodore Business Machines
uucp: ken@cbmvax.commodore.com   or  ...{uunet,rutgers}!cbmvax!ken
bix:  kfarinsky

colin_fox@ice.outbound.wimsey.bc.ca (Colin Fox) (04/23/91)

>I'm working on a project in which I have a struct Image of depth one.  I've
>got a need to render it in normal video and reverse video.  Is there an
>easy way to draw an XOR of the image without 1) modifying the original
>image, 2) boating a second, XORed, copy of the image around in my code or
>3) having to allocate a temporary buffer into which to XOR it?

The easiest thing would be to set RP_COMPLEMENT in your RPort flags, (via
SetDrMd()), and then RectFill() over your image. That will reverse it.

+-------------------------------------+----------------------------------+
| Colin_Fox@ice.outbound.wimsey.bc.ca | "...heavy!"                      |
+-------------------------------------+ "There's that word again! Is     |
| Informal home of SIGGRAPH Vancouver,|  there a problem with gravity in |
| and proud of it!                    |  the future?" -- Doc             |
+-------------------------------------+----------------------------------+