t2get
Syntax
- int t2get(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 second 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
// Copy tile buffer 2 to tile buffer 1
for (y=y_start; y<Y; ++y) {
for (x=x_start; x<X; ++x) {
for (z=0; z<Z; ++z) {
tset(x, y, z, t2get(x, y, z));
}
}
}
Also see
- src, pget, tget, pset, tset, t2set
Comments
- Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.