Older Newer
Sun, 26 Dec 2021 05:11:54 . . . . SyneRyder [Note minimum FM version requirement]


Changes by last author:

Added:
= t4get =

Requires FM 1.0 Beta 8.5 (Nov 2007) or newer

== Syntax ==

:int t4get(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 fourth 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 (when in RGB mode), while channel 3 is the alpha (transparency) channel and is valid only on a layer.

== Example ==

<code>

// Copy tile buffer 4 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, t4get(x, y, z));

}

}

}

</code>

== See Also ==

:src, pget, tget, pset, tset, t4set

== Comments ==

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