int gray(int r, int g, int b, int rweight, int gweight, int bweight)
The new grayscale pixel value.
Applies a simple grayscale effect to a given RGB pixel value, according to the weightings provided.
ctl[0]: "Red Weight", Range=(1,500), Val=250 ctl[1]: "Green Weight", Range=(1,500), Val=250 ctl[2]: "Blue Weight", Range=(1,500), Val=250 ForEveryTile: { int r, g, b; for (y = y_start; y < y_end; y++) { for (x = x_start; x < x_end; x++) { r = src(x,y,0); g = src(x,y,1); b = src(x,y,2); for (z=0; z < 3; z++) { pset(x,y,z, gray(r, g, b, ctl(0), ctl(1), ctl(2))); } } } return true; }