Method ConvertAsync
ConvertAsync(int, ConversionParams)
Method to be implemented by the provider to create an asynchronous request to convert a camera image, similar to TryConvert(int, ConversionParams, IntPtr, int) except the conversion should happen on a thread other than the calling (main) thread.
Declaration
public virtual int ConvertAsync(int nativeHandle, XRCpuImage.ConversionParams conversionParams)
Parameters
| Type | Name | Description |
|---|---|---|
| int | nativeHandle | A unique identifier for the camera image to convert. |
| XRCpuImage.ConversionParams | conversionParams | The parameters to use during the conversion. |
Returns
| Type | Description |
|---|---|
| int | A unique identifier for this request. |
Exceptions
| Type | Condition |
|---|---|
| NotSupportedException | Thrown if the implementation does not support camera image. |
ConvertAsync(int, ConversionParams, OnImageRequestCompleteDelegate, IntPtr)
Method to be implemented by the provider. It is similar to ConvertAsync(int, ConversionParams) but takes a delegate to invoke when the request is complete, rather than returning a request id.
Declaration
public virtual void ConvertAsync(int nativeHandle, XRCpuImage.ConversionParams conversionParams, XRCpuImage.Api.OnImageRequestCompleteDelegate callback, IntPtr context)
Parameters
| Type | Name | Description |
|---|---|---|
| int | nativeHandle | A unique identifier for the camera image to convert. |
| XRCpuImage.ConversionParams | conversionParams | The parameters to use during the conversion. |
| XRCpuImage.Api.OnImageRequestCompleteDelegate | callback | A delegate which must be invoked when the request is complete, whether the conversion was successful or not. |
| IntPtr | context | A native pointer which must be passed back unaltered to
|
Remarks
If the first parameter to callback is
Ready, the dataPtr parameter must be valid
for the duration of the invocation. The data can be destroyed immediately upon return. The
context parameter must be passed back to the callback.
Exceptions
| Type | Condition |
|---|---|
| NotSupportedException | Thrown if the implementation does not support camera image. |