Eyeon:Script/Reference/Applications/Fuse/Classes/Image/SamplePixelD
From VFXPedia
Contents |
Summary
This function will sample an arbitrary position from the co-ordinates specified by the first two arguments, and fill the Pixel object p with values from the sampled pixels. The X and Y arguments are floating-point pixel co-ordinates, with 0,0 being the bottom-left corner and <width-1>,<height-1> being the top-right corner. Unlike GetPixel, if the co-ordinates do not align exactly with a pixel then bilinear filtering will be performed with neighbouring pixels.
If the co-ordinates provided are outside the actual bounds of the image, the return value will be the pixel at the edge of the image. For example, if sampling a pixel at co-ordinates (-30.0, 50.0) the actual pixel sampled would be (0.0, 50.0).
See SamplePixelW and SamplePixelB for functions that treat out of bound sampling in different ways.
Usage
Image:SamplePixelD(number x, number y, Pixel p)
- x (number, required)
- The x co-ordinate of the pixel to be sampled, where 0 is the left edge and <width-1> is the right edge.
- y (number, required)
- The y co-ordinate of the pixel to be sampled, where 0 is the bottom edge and <height-1> is the top edge.
- p (pixel, required)
- A Pixel object that will be filled with the results.
Example