Re: Masking

new topic     » goto parent     » topic index » view thread      » older message » newer message

You could use the SSE/3dnow!ext instruction MASKMOVQ, it does the following

MASKMOVQ mm1, mm2
if (mm2[7])  m64[edi]   = mm1[7-0];
if (mm2[15]) m64[edi+1] = mm1[15-8];
if (mm2[23]) m64[edi+2] = mm1[23-16];
if (mm2[31]) m64[edi+3] = mm1[31-24];
if (mm2[39]) m64[edi+4] = mm1[39-32];
if (mm2[47]) m64[edi+5] = mm1[47-40];
if (mm2[55]) m64[edi+6] = mm1[55-48];
if (mm2[63]) m64[edi+7] = mm1[63-56];

That should go SUPER fast
Daniel Kluss
----- Original Message ----- 
From: "Stewart MacKenzie-Leigh" <stewartml89 at msn.com>
To: <EUforum at topica.com>
Sent: Saturday, November 08, 2003 11:30 AM
Subject: Masking


>
>
> Is there a fster way to display a bitmap on the screen without the pixels
> which are the mask color, other than plotting each color individually in a
> loop?
>
> this is the code im using at the moment:
>
> for y = 1 to length(img) do
>     for x = 1 to length(img[y]) do
>         if img[y][x] != MASK_COLOR then
>             pixel(img[y][x], {imgX + x, imgY + y})
>         end if
>     end if
> end for
>
> this is too slow for what i am doing.
>
>
> thanks in advance
>
> StewartML
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu