int pset(int x, int y, int z, int v)
Returns the value of v, properly clamped to the range [0, 255] or [0, 0x8000], if the current pixel depth is 8 or 16 bits, respectively.
This function sets the value of one channel for a pixel in the output buffer to the properly clamped value of v. The pixel is at coordinates (x,y), and the channel to be set is given by 'z' (0 = red, 1 = green, 2 = blue, and 3 = alpha for the RGBA case).
If the coordinates (x,y) are outside the current image (i.e., x < 0 or x >= (X)? or y < 0 or y >= (Y)?), or if z < 0 or z >= Z, then the output buffer is not changed.
%ffp ForEveryTile: { for (y=y_start; y<y_end; ++y) { for (x=x_start; x<x_end; ++x) { for (z=0; z<Z; ++z) { // set all pixels white! pset(x, y, z, 255); } } } return true; }
Everyone can add his or her comments about his or her experiences with this function here. Tips for using it are welcome, too.