pget

Syntax

int pget(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 (eg for RGBA: 0=red, 1=green, 2=blue, 3=alpha)

Return

The integer value of the specified pixel for the specified channel, in the output buffer.

Description

This function retrieves the value of a specified channel 'z' from the image pixel at position (x,y) in the output buffer; in effect, it serves a similar purpose to the src() function, but retrieves from the output buffer rather than the source image. The coordinates should usually be within the image, i.e. 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 for RGB image modes, while channel 3 is the alpha (transparency) channel of an RGBA image and is valid only on a Photoshop layer with transparency/opacity. Note that use of the pget() function in the ForEveryTile handler forces FilterMeister to handle the image as a single (and possibly large) tile.

Comments

How is pget different from src? src gets the pixel from the original image while pget gets the pixel from the output buffer. At the start of the filter the output buffer is the same as the original image, which is why they seem identical. pget is useful for times when you modify the output, but still need data from the original image.

Example

// Shift the whole image one pixel left

%ffp

R,G,B: pget(x+1, y, z)

A: a

See Also

src, pset, tget, tset, t2get, t2set