Older Newer
Thu, 27 Mar 2003 20:53:18 . . . . (Pete)?


Changes by last author:

Added:
= tget =

== Syntax ==

:int tget(int x, int y, int z)

== Arguments ==

:x

::The x coordinate of the pixel to be retrieved.

:y

::The y coordinate of the pixel to be retrieved.

:z

::The channel number to be retrieved for the pixel: 0->red, 1->green, 2->blue, 3->alpha.

== Return ==

:The integer value of the specified pixel for the specified channel.

== Description ==

:This function retrieves the value of a specified channel 'z' from the pixel at position (x,y) in the first of FilterMeister's tile buffers. The coordinates should usually be within the image, ie 0<=x<=X and 0<=y<=Y, while the channel number z should be in the range 0 to 3 inclusive. Channels 0, 1 and 2 are the red, green and blue channels respectively, while channel 3 is the alpha (transparency) channel and is valid only on a layer.

== Example ==

<code>

// Copy tile buffer 1 to the output buffer

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

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

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

pset(x, y, z, tget(x, y, z));

}

}

}

</code>

== Also see ==

:src, pget, t2get, pset, tset, t2set

== Comments ==

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