Sample
Samples a native array as if it was an image. Employs nearest neighbour algorithm.
Declaration
public static T Sample<T>(this NativeArray<T> data, int width, int height, Vector2 uv) where T : struct
Summary
Returns
The nearest value in the array to the normalized coordinates.
Parameters
| Name | Type | Summary |
|---|---|---|
| data | NativeArray<T> | The native array containing the data. |
| width | int | The width of the image. |
| height | int | The height of the image. |
| uv | Vector2 | Normalized image coordinates to sample. |
Overload 1
public static T Sample<T>(this XRCpuImage image, Vector2 uv, Matrix4x4 transform, int plane = 0) where T : struct
Summary
Samples a CPU image. Employs nearest neighbour algorithm.
Returns
The nearest value in the image to the transformed UV coordinates.
Parameters
| Name | Type | Summary |
|---|---|---|
| data | NativeArray<T> | The native array containing the data. |
| width | int | The width of the image. |
| height | int | The height of the image. |
| uv | Vector2 | Normalized image coordinates to sample. |
Overload 2
public static T Sample<T>(this NativeArray<T> data, int width, int height, Vector2 uv, Matrix4x4 transform) where T : struct
Summary
Samples a native array as if it was an image. Employs nearest neighbour algorithm.
Returns
The nearest value in the array to the transformed UV coordinates.
Parameters
| Name | Type | Summary |
|---|---|---|
| data | NativeArray<T> | The native array containing the data. |
| width | int | The width of the image. |
| height | int | The height of the image. |
| uv | Vector2 | Normalized image coordinates to sample. |
Samples a native array as if it was an image. Employs nearest neighbour algorithm.