Older Newer
Wed, 28 May 2003 04:27:33 . . . . alex [fix typo]

Changes by last author:

= egw =

== Syntax ==

:int egw (int bottom, int top, int value)

== Arguments ==


::Bottom edge value


::Top edge value


::Value that will be edge wrapped.

== Return ==

:The edge-wrapped value will be returned.

== Description ==

:This function returns the value untouched if it lies between bottom and top. If it lies outside bottom and top, the value will be edge wrapped to lie between bottom and top. For example, a value of 21 would be returned as 11 if bottom=10 and top=20 or returned as 12 if bottom=10 and top=19.

== Example ==



ctl(0): "Butt",range=(0,255),val=20

ctl(1): "Top",range=(0,255),val=100





for (y=y_start; y<y_end; y++){


for (x=x_start; x<x_end; x++){

for (z=0; z<Z; z++){

pset(x, y, z, src( egw(ctl(0),ctl(1),x) , egw(ctl(0),ctl(1),y) , z) );


return true;