1. xor pixel

Can someone give me a really fast xor pixel? Thanks Jiri

new topic     » topic index » view message » categorize

2. Re: xor pixel

On Wed, 7 Jan 1998, BABOR, JIRI wrote:

> Can someone give me a really fast xor pixel? Thanks Jiri
>
here's one:     .


Michael

new topic     » goto parent     » topic index » view message » categorize

3. Re: xor pixel

>On Wed, 7 Jan 1998, BABOR, JIRI wrote:
>
>> Can someone give me a really fast xor pixel? Thanks Jiri
>>
>here's one:     .
>
>
>Michael
>

He said a FAST one. That one barely moves.

Here's one that's really fa- it's already gone. That's how fast it is/was.
:)

I can't believe this digression. Must be post-holiday psychosis.

later!

new topic     » goto parent     » topic index » view message » categorize

4. Re: xor pixel

Michael Packard wrote:
>
> On Wed, 7 Jan 1998, BABOR, JIRI wrote:
>
> > Can someone give me a really fast xor pixel? Thanks Jiri
> >
> here's one:     .
>
> Michael
Just one pixel? How about a whole bitmap piece?

include graphics.e
include image.e
sequence sima
--sima stores the save_image
<snip>
--*************Start here ***********************
gr=graphics_mode(257)
--800x600x256 color SVGA
<snip>
--***put an ellipse desgin on screen***
<snip>
--***now I will cut a portion of the screen***
--***and then re-paste with bitwise operations***
sima=save_image({60,70},{140,140})
gx=wait_key()
sima=xor_bits(sima,1)
display_image({150,200},sima)
gx=wait_key()
sima=xor_bits(sima,1)
display_image({200,250},sima)
gx=wait_key()

--
// !NEW! Http://www.geocities.com/SiliconValley/Lab/7577 ///////////
// Michael J. Raley's Modular reality Journal                    //
///////////////////////////////////////////////////////////////////

new topic     » goto parent     » topic index » view message » categorize

5. Re: xor pixel

-------------
>From: BABOR, JIRI <J.Babor at GNS.CRI.NZ>
>To: Multiple recipients of list EUPHORIA <EUPHORIA at MIAMIU.ACS.MUOHIO.EDU>
>Subject: xor pixel
>Date: Tuesday, January 06, 1998 11:59 PM
>
>Can someone give me a really fast xor pixel? Thanks Jiri

Sorry you can't do that.
The colors will be all messed up.
Hmmmm. let me think

--bmp = any dimension of bitmap image
--bkg = portion of background of same shape as bmp
--mask = becomes a bit mask of bmp

mask = (bmp = 0)--0's become 1's and everthing else is 0.
mask = mask * 255--set 1' to 255

mask = and_bits(mask, bkg)--mask = visible part of bkg
mask = or_bits(mask, bmp)--mask = mixed foreground and background.

--This technique only works on (0) other transparency numbers will not
work.
--They would have to be modified.
--I can show you the modifications if needed. :)

--Lucius L. Hilley III

new topic     » goto parent     » topic index » view message » categorize

6. Re: xor pixel

Come on, guys,

I asked for a fast xor pixel routine, fast as in machine code or very
clever, and all I get is a tasteless joke from Michael :.-( , even
worse from Chris, an ellipse from mjronline, and Lucius tells me I
can't do it because it would mess up his colors...

Presently I am using the following high level routine, but it's not
obviously terribly fast:

procedure xorpixel(object c, sequence xy)
-- pixel(s) xor-ed with background, same syntax as pixel()
   if sequence(c) then pixel(xor_bits(get_pixel(xy&length(c)),c),xy)
   else pixel(xor_bits(get_pixel(xy),c),xy) end if
end procedure

If anyone can do the same *significantly* faster, please let me know.
Thanks Jiri

new topic     » goto parent     » topic index » view message » categorize

7. Re: xor pixel

BABOR, JIRI wrote:
>
> Come on, guys,
>
> I asked for a fast xor pixel routine, fast as in machine code or very
> clever, and all I get is a tasteless joke from Michael :.-( , even
> worse from Chris, an ellipse from mjronline, and Lucius tells me I
> can't do it because it would mess up his colors...

Machine code.  okay.  which graphics mode did you have in mind?


                   _____         _____         _____
    ________      /\    \       /\    \       /\    \
   /   \    \    /  \____\     /  \____\     /  \____\
  /  _  \____\  /   / ___/_   /   /____/    /   / ___/_
 /  / \  |____|/   / /\____\ /    \    \   /   / /\____\
 \  \_/ /    / \   \/ / ___/_\     \    \  \   \/ / ___/_
  \    /____/   \    / /\    \\/\   \    \  \    / /\    \
   \   \    \    \   \/  \____\  \   \    \  \   \/  \____\
    \   \    \    \      /    /   \   \____\  \      /    /
     \   \____\    \    /    /     \  /    /   \    /    /
      \  /    /     \  /    /       \/____/     \  /    /
       \/____/       \/____/eberleip at ucs.orst.edu\/____/

new topic     » goto parent     » topic index » view message » categorize

8. Re: xor pixel

Peter Eberlein wrote:

>Machine code.  okay.  which graphics mode did you have in mind?

I use mode 18 most often, then 257 and 259, in order of priorities.
Mode 19 would also be nice, but I can do, what I want to do in this
mode, fast enough with peeks and pokes.

And while you are at it, a vertical xor line would not be too much of
a detour - a very useful element for construction of temporary boxes.

Thanks, Pete, and good luck. Jiri

new topic     » goto parent     » topic index » view message » categorize

9. Re: xor pixel

>Come on, guys,
>
>I asked for a fast xor pixel routine, fast as in machine code or very
>clever, and all I get is a tasteless joke from Michael :.-( , even

I wouldn't call his joke "tasteless." I thought it was kinda funny.

>worse from Chris, an ellipse from mjronline, and Lucius tells me I
>can't do it because it would mess up his colors...

Hey! It was all in good fun. :)

>procedure xorpixel(object c, sequence xy)
>-- pixel(s) xor-ed with background, same syntax as pixel()
>   if sequence(c) then pixel(xor_bits(get_pixel(xy&length(c)),c),xy)
>   else pixel(xor_bits(get_pixel(xy),c),xy) end if
>end procedure

Can somebody explain to me what an "xorpixel" would do? What would it be
used for? etc.

Thanks!
ck

new topic     » goto parent     » topic index » view message » categorize

10. Re: xor pixel

Christopher K. Lester wrote:

>I wouldn't call his joke "tasteless." I thought it was kinda funny.

So did I.

>Hey! It was all in good fun. :)

And I enjoyed it.

>Can somebody explain to me what an "xorpixel" would do? What would
>it be used for? etc.

As I have just explained to Mark Honnor, privately, but I'll use the
same words, xor-ed images have a very interesting property: when an
image is projected second time over exactly the same area, the first
impression completely disappears, and what is left is the original
background. This property is widely used in temporary structures, like
blinking) cursors, outline boxes, etc.   Have fun too! Jiri

new topic     » goto parent     » topic index » view message » categorize

11. Re: xor pixel

BABOR, JIRI wrote:
>
> I use mode 18 most often...

---------CODE BEGINS---------
-- xorpixel.e
-- fast xorpixel procedure for 640-pixel-wide 16-color graphics modes
-- Pete Eberlein <xseal at harborside.com>
-- 7 Jan 1998

include machine.e

constant xorpixel_proc = allocate(68)
constant
    x_addr = xorpixel_proc + 22,
    y_addr = xorpixel_proc + 7,
    color_addr = xorpixel_proc + 53

global procedure xorpixel(sequence pos, object o)
    if atom(o) then
        poke4(x_addr, pos[1])
        poke4(y_addr, pos[2])
        poke(color_addr, o)
        call(xorpixel_proc)
    else
        poke4(y_addr, pos[2])
        for i = 1 to length(o) do
            poke4(x_addr, pos[1])
            poke(color_addr, o[i])
            call(xorpixel_proc)
            pos[1] = pos[1] + 1
        end for
    end if
end procedure

poke(xorpixel_proc, {
    #60,                    --pusha
    #BE,#00,#00,#0A,#00,    --mov esi, #A0000
    #B8,#00,#00,#00,#00,    --mov eax, y_pos (7)
    #C1,#E0,#04,            --shl eax, 4
    #01,#C6,                --add esi, eax
    #C1,#E0,#02,            --shl eax, 2
    #01,#C6,                --add esi, eax
    #B8,#00,#00,#00,#00,    --mov eax, x_pos (22)
    #88,#C1,                --mov cl, al
    #80,#E1,#07,            --and cl, 7
    #C1,#E8,#03,            --shr eax, 3
    #01,#C6,                --add esi, eax
    #8A,#06,                --mov al, [esi]
    #BA,#CE,#03,#00,#00,    --mov edx, #3CE
    #B8,#03,#18,#00,#00,    --mov eax, #1803
    #66,#EF,                --out dx, ax
    #B0,#01,                --mov al, 1
    #B4,#00,                --mov ah, color (53)
    #F6,#D4,                --not ah
    #66,#EF,                --out dx, ax
    #31,#C0,                --xor eax, eax
    #B0,#80,                --mov al, #80
    #D3,#E8,                --shr eax, cl
    #88,#06,                --mov [esi], al
    #61,                    --popa
    #C3})                   --ret
---------CODE ENDS---------

I hope this works for you.  Please don't ask me to do anything more
though, even this little proc reminded me how much I hate programming
16-color graphics modes.

Off topic, I just finished reading up on the listserv Euphoria archives
from before I joined the list.  I was especially amused by some of the
flame wars, especially the one ending with the Reaper's Euphoria soap
opera dialog.  It's also funny how some of the same things come up over
and over again.  The win95 screen saver problem came up almost a year ago,
and a xor_mem procedure was suggested long ago as well (probably for the
same purpose as this routine for Jiri).  Euphoria has really come a long
way.

Later,
--
                   _____         _____        _____
    ________      /\    \       /\    \      /\    \
   /   \    \    /  \____\     /  \____\    /  \____\
  /  _  \____\  /   / ___/_   /   /____/   /   / ___/_
 /  / \  |___| /   / /\____\ /    \    \  /   / /\____\
 \  \_/ /    / \   \/ / ___/_\     \    \ \   \/ / ___/_
  \    /____/   \    / /\    \\/\   \    \ \    / /\    \
   \   \    \    \   \/  \____\  \   \    \ \   \/  \____\
    \   \    \    \      /    /   \   \____\ \      /    /
     \   \____\    \    /    /     \  /    /  \    /    /
      \  /    /     \  /    /       \/____/    \  /    /
       \/____/       \/____/xseal at harborside.com\/____/

new topic     » goto parent     » topic index » view message » categorize

12. Re: xor pixel

Thanks Pete. I hope it was not too painful, I mean either or both, creation
of the procedure as well as the euphorian history. Jiri

new topic     » goto parent     » topic index » view message » categorize

13. Re: xor pixel

On Thu, 8 Jan 1998 10:04:37 +1200 "BABOR, JIRI" <J.Babor at GNS.CRI.NZ>
writes:

>Come on, guys,
>
>I asked for a fast xor pixel routine, fast as in machine code or very
>clever, and all I get is a tasteless joke from Michael :.-( , even
>worse from Chris, an ellipse from mjronline, and Lucius tells me I
>can't do it because it would mess up his colors...
>
>Presently I am using the following high level routine, but it's not
>obviously terribly fast:
>
>procedure xorpixel(object c, sequence xy)
>-- pixel(s) xor-ed with background, same syntax as pixel()
>   if sequence(c) then pixel(xor_bits(get_pixel(xy&length(c)),c),xy)
>   else pixel(xor_bits(get_pixel(xy),c),xy) end if
>end procedure
>
>If anyone can do the same *significantly* faster, please let me know.
>Thanks Jiri
>

        How about deleting Windows? Or maybe if the two files were small
enough you could put them into the vidcards memry???

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu