1. Palette Cycling

I'm trying to write a proc for cycling the palette ie:- color255 becomes
color254, 254 becomes 253, 253-252 etc right down to color 1 which will become
the original color that 255 was, leaving color0 black. The following is getting
there but it's way to slow. Each set of 255 takes over 3secs. I'd like the whole
palette changed about 10 times per sec.
Has anyone got any ideas about how to speed it up?

*****************************************************

procedure cycle()
sequence paltemp, newpalc
paltemp = {0,0,0}
while 1 do
 if get_key() != -1 then
  exit
 end if
 for c = 255 to 1 by -1 do
  newpalc = palette(c, paltemp)
  paltemp = newpalc
 end for
end while
end procedure

*****************************************************

new topic     » topic index » view message » categorize

2. Re: Palette Cycling

EU>I'm trying to write a proc for cycling the palette ie:- color255 becomes col
EU>Has anyone got any ideas about how to speed it up?

EU>*****************************************************

EU>procedure cycle()
EU>sequence paltemp, newpalc
EU>paltemp = {0,0,0}
EU>while 1 do
EU> if get_key() != -1 then
EU>  exit
EU> end if
EU> for c = 255 to 1 by -1 do
EU>  newpalc = palette(c, paltemp)
EU>  paltemp = newpalc
EU> end for
EU>end while
EU>end procedure

EU>*****************************************************

procedure cycle()
        sequence s
        s = get_all_palette()
        s = append(s,s[2])
        s = prepend(s[3..length(s)],s[1])
        all_palette(s)
end procedure

Jeffrey Fielding
JJProg at cyberbury.net
http://members.tripod.com/~JJProg/

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

3. Re: Palette Cycling

Hi!

-----Original Message-----
From: Andrew Sharp <asharp at CHILLI.NET.AU>
To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU>
Date: Friday, January 01, 1999 6:52 PM
Subject: Palette Cycling


>I'm trying to write a proc for cycling the palette ie:- color255 becomes
color254, 254 becomes 253, 253-252 etc right down to color 1 which will
become the original color that 255 was, leaving color0 black. The following
is getting there but it's way to slow. Each set of 255 takes over 3secs. I'd
like the whole palette changed about 10 times per sec.
>Has anyone got any ideas about how to speed it up?


You might try some of the ideas found in this package I wrote some time ago.
There are quite a few examples of palette shifting. The fastest by far is to
use a "double" palette.

http://members.aol.com/EnjoyCruz/palette.zip

hope this helps,

Greg Harris

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

4. Re: Palette Cycling

On Fri, 1 Jan 1999 18:35:17 -0500, Andrew Sharp <asharp at CHILLI.NET.AU> wrote:

        <SNIP>
>
>procedure cycle()
>sequence paltemp, newpalc
>paltemp = {0,0,0}
>while 1 do
> if get_key() != -1 then
>  exit
> end if
> for c = 255 to 1 by -1 do
>  newpalc = palette(c, paltemp)
>  paltemp = newpalc
> end for
>end while
>end procedure
>

How about this.
procedure cycle()
  sequence paltemp, newpalc

  paltemp = {0,0,0}
  while get_key() = -1 do
    newpalc = get_all_palette()
    paltemp = newpalc[2..256] & newpalc[1] & newpalc[256]to 256
    all_pallet(paltemp)
  end while

end procedure

________________________

Lucius L. Hilley III    lhilley at cdc.net
http://www.cdc.net/~lhilley
http://www.dragonvet.com
_________________________
<IMG SRC="http://www.cdc.net/~ceace/images/lu4.jpg">

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

5. Re: Palette Cycling

OOPS!! I made a typo in the other.

On Fri, 1 Jan 1999 18:35:17 -0500, Andrew Sharp <asharp at CHILLI.NET.AU> wrote:

        <SNIP>
>
>procedure cycle()
>sequence paltemp, newpalc
>paltemp = {0,0,0}
>while 1 do
> if get_key() != -1 then
>  exit
> end if
> for c = 255 to 1 by -1 do
>  newpalc = palette(c, paltemp)
>  paltemp = newpalc
> end for
>end while
>end procedure
>

How about this.

procedure cycle()
  sequence paltemp, newpalc

  while get_key() = -1 do
    newpalc = get_all_palette()
    paltemp = newpalc[2..256] & newpalc[1]
    all_pallet(paltemp)
  end while
end procedure

________________________

Lucius L. Hilley III    lhilley at cdc.net
http://www.cdc.net/~lhilley
http://www.dragonvet.com
_________________________
<IMG SRC="http://www.cdc.net/~ceace/images/lu4.jpg">
_________________________

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

Search



Quick Links

User menu

Not signed in.

Misc Menu