-
Notifications
You must be signed in to change notification settings - Fork 15
sample_nearest
Chung Leong edited this page Jan 10, 2022
·
3 revisions
sample_nearest - Nearest-neighbor interpolation
float[4] sample_nearest( image4 $image, float $x, float $y )
float[3] sample_nearest( image3 $image, float $x, float $y )
float[2] sample_nearest( image2 $image, float $x, float $y )
float[1] sample_nearest( image1 $image, float $x, float $y )
sample_nearest() samples an image at ( x, y ), returning the nearest pixel if the coordinates are off the grid.
image - The image to sample.
x - The horizontal position. It can be a scalar or an array.
y - The vertical position. It can be a scalar or an array.
Pixel value at ( x, y ). If either x or y is an array, multiple pixels are returned.
1.0 and above.