Method ConvertAsync
ConvertAsync(ConversionParams)
Convert the XRCpuImage
to one of the supported formats using the specified
conversionParams
. The conversion is performed asynchronously. Use the returned
XRCpuImage.AsyncConversion to check for the status of the conversion, and retrieve the data
when complete.
Declaration
public XRCpuImage.AsyncConversion ConvertAsync(XRCpuImage.ConversionParams conversionParams)
Parameters
Type | Name | Description |
---|---|---|
XRCpuImage.ConversionParams | conversionParams | The parameters to use for the conversion. |
Returns
Type | Description |
---|---|
XRCpuImage.AsyncConversion | A XRCpuImage.AsyncConversion which can be used to check the status of the conversion operation and get the resulting data. |
Remarks
It is safe to Dispose
the XRCpuImage
before the asynchronous operation has completed.
See Also
ConvertAsync(ConversionParams, Action<AsyncConversionStatus, ConversionParams, NativeArray<byte>>)
Convert the XRCpuImage
to one of the supported formats using the specified
conversionParams
. The conversion is performed asynchronously, and
onComplete
is invoked when the conversion is complete, whether successful or not.
The NativeArray
provided in the onComplete
delegate is only valid during
the invocation and is disposed immediately upon return.
Declaration
public void ConvertAsync(XRCpuImage.ConversionParams conversionParams, Action<XRCpuImage.AsyncConversionStatus, XRCpuImage.ConversionParams, NativeArray<byte>> onComplete)
Parameters
Type | Name | Description |
---|---|---|
XRCpuImage.ConversionParams | conversionParams | The parameters to use for the conversion. |
Action<XRCpuImage.AsyncConversionStatus, XRCpuImage.ConversionParams, NativeArray<byte>> | onComplete | A delegate to invoke when the conversion operation completes. The delegate is always invoked, regardless of whether the conversion succeeded. |