Skip to content
Chung Leong edited this page Jan 10, 2022 · 4 revisions

sample_bilinear - Nearest-neighbor interpolation

float[4] sample_bilinear( image4 $image, float $x, float $y )

float[3] sample_bilinear( image3 $image, float $x, float $y )

float[2] sample_bilinear( image2 $image, float $x, float $y )

float[1] sample_bilinear( image1 $image, float $x, float $y )

sample_bilinear() samples an image at ( x, y ), performing bilinear interpolation for coordinates that are off the grid.

Parameters:

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.

Return Value:

Pixel value at ( x, y ). If the coordinate is outside the image area, then a transparent black pixel ([0, 0, 0, 0]) is returned. If either x or y is an array, multiple pixels are returned.

Version

1.0 and above.

Clone this wiki locally