# Sample Source: https://www.nianticspatial.com/docs/api/unity/NianticSpatial.NSDK.AR.Utilities.ImageSamplingUtils.Sample/ Sample Samples a native array as if it was an image. Employs nearest neighbour algorithm. --- ## Declaration public static T Sample(this NativeArray data, int width, int height, Vector2 uv) 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 normalized coordinates. ### Parameters | Name | Type | Summary | | --- | --- | --- | | data | NativeArray | 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(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 | 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(this NativeArray 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 | 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. | ---