1. save_image???
------=_NextPart_000_000E_01C0370A.49BB82C0
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
A question that has puzzled me for a while.
1. Is my save_image faster than the one contained
in image.e
with profile_time simply ignores this routine...
In the performance docs created by RDS it states
that this method should be slightly faster
because append() has to allocate and=20
reallocate space as {save} grows in size
function save_image(sequence left, sequence right)
integer x, width, height
sequence save
=20
width =3D right[1] - left[1] + 1
height =3D right[2] - left[2] + 1
save =3D repeat(0, height)
for y =3D 1 to height do
save[y] =3D get_pixel({left[1], left[2], width})
left[2] +=3D 1
end for
return save
end function
Anomily: I have noticed that after
I re-display a fairly large image
multiple times and exit my program
the screen flickers as if garbage collection
is haveing to work over-time so, I set {save}
to a NULL sequence [ save =3D {} ] after re-display.
and, would useing integers instead of sequences be faster?
they also "RDS" say that there is a slight over-head to create
sequences....
Thanx
euman at bellsouth.net
------=_NextPart_000_000E_01C0370A.49BB82C0
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4207.2601" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DSystem size=3D2>A question that has puzzled me for a=20
while.</FONT></DIV>
<DIV><FONT face=3DSystem size=3D2></FONT> </DIV>
<DIV><FONT face=3DSystem size=3D2>1. Is my save_image faster than =
the one=20
contained</FONT></DIV>
<DIV><FONT face=3DSystem size=3D2> in =
image.e</FONT></DIV>
<DIV><FONT face=3DSystem size=3D2></FONT> </DIV>
<DIV><FONT face=3DSystem size=3D2>with profile_time simply ignores this=20
routine...</FONT></DIV>
<DIV><FONT face=3DSystem size=3D2></FONT> </DIV>
<DIV><FONT face=3DSystem size=3D2>In the performance docs created by RDS =
it=20
states</FONT></DIV>
<DIV><FONT face=3DSystem size=3D2>that this method should be slightly=20
faster</FONT></DIV>
<DIV><FONT face=3DSystem>because <FONT color=3D#006699>append()</FONT> =
has to=20
allocate and </FONT></DIV>
<DIV><FONT face=3DSystem>reallocate space as {save} grows in=20
size</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT face=3DSystem=20
>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT face=3DSystem size=3D2>function save_image(sequence left, =
sequence=20
right)<BR> integer x, width, =
height<BR> =20
sequence save<BR> <BR> width =
=3D=20
right[1] - left[1] + 1<BR> height =3D right[2] - =
left[2] +=20
1<BR> save =3D repeat(0, height)<BR> =
for y =3D 1=20
to height do<BR> save[y] =3D=20
get_pixel({left[1], left[2], =
left[2] +=3D 1<BR> end for<BR> =
return=20
save<BR>end function</FONT></DIV>
<DIV><FONT face=3DSystem size=3D2></FONT> </DIV>
<DIV><FONT face=3DSystem=20
V>
<DIV><FONT face=3DSystem size=3D2></FONT> </DIV>
<DIV><FONT face=3DSystem size=3D2>Anomily: I have noticed that=20
after</FONT></DIV>
<DIV><FONT face=3DSystem=20
p; =20
I re-display a fairly large image</FONT></DIV>
<DIV><FONT face=3DSystem=20
p; =20
multiple times and exit my program</FONT></DIV>
<DIV><FONT face=3DArial=20
p; =20
<FONT face=3DSystem>the screen flickers as if garbage=20
collection</FONT></FONT></DIV>
<DIV><FONT face=3DSystem=20
p; =20
is haveing to work over-time so, I set {save}</FONT></DIV>
<DIV><FONT face=3DSystem=20
p; =20
to a NULL sequence [ save =3D {} ] after re-display</FONT><FONT =
face=3DSystem=20
size=3D2>.</FONT></DIV>
<DIV><FONT face=3DSystem size=3D2></FONT> </DIV>
<DIV><FONT face=3DSystem size=3D2>and, would useing integers instead of =
sequences be=20
faster?</FONT></DIV>
<DIV><FONT face=3DSystem size=3D2>they also "RDS" say that there is a =
slight=20
over-head to create</FONT></DIV>
<DIV><FONT face=3DSystem size=3D2>sequences....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DSystem size=3D2></FONT> </DIV>
<DIV><FONT face=3DSystem size=3D2>Thanx</FONT></DIV>
<DIV><FONT face=3DSystem size=3D2><A=20
<DIV><FONT face=3DSystem size=3D2></FONT> </DIV>
<DIV><FONT face=3DSystem size=3D2></FONT> </DIV>
<DIV><FONT face=3DSystem size=3D2><FONT face=3DArial></FONT> </DIV>
------=_NextPart_000_000E_01C0370A.49BB82C0--