psetr

Syntax

void psetr(int d, int m, int z, int v)

Arguments

d
An integer direction from the origin in the output buffer.
m
An integer magnitude from the origin in the output buffer.
z
An integer channel number in the range 0 to 3.
v
An integer value to be set for channel 'z', in the range 0 to 255.

Description

This function sets the value of one channel for a pixel in the output buffer, using polar coordinates (rather than cartesian) to address the pixel; the polar coordinates are relative to the image center. The channel to be set is given by 'z' (0 = red, 1 = green, 2 = blue, and 3 = alpha). NOTE: There is no guarantee that this function is able to completely populate the plane - some pixels in the output buffer may be unreachable because of rounding errors.

Example

%ffp

ForEveryTile: {

  int d, m;

  for (d=0; d<1024; ++d) {
    for (m=0; m<256; m+=3) {
      for (z=0; z<Z; ++z) {
        psetr(d, m, z, 256);
      }
    }
  }

  return true;
}

See Also

tsetr, t2setr, pgetr

Comments

Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.