Method ScheduleAddImageJob
ScheduleAddImageJob(NativeSlice<byte>, Vector2Int, TextureFormat, XRReferenceImage, JobHandle)
Asynchronously adds an image to this library.
Declaration
[Obsolete("Use ScheduleAddImageWithValidationJob instead. (2020-10-20)")]
public JobHandle ScheduleAddImageJob(NativeSlice<byte> imageBytes, Vector2Int sizeInPixels, TextureFormat format, XRReferenceImage referenceImage, JobHandle inputDeps = default)
Parameters
Type | Name | Description |
---|---|---|
NativeSlice<byte> | imageBytes | The raw image bytes in |
Vector2Int | sizeInPixels | The width and height of the image, in pixels. |
TextureFormat | format | The format of |
XRReferenceImage | referenceImage | The XRReferenceImage data associated with the image to add to the library.
This includes information like physical dimensions, associated |
JobHandle | inputDeps | (Optional) input dependencies for the add image job. |
Returns
Type | Description |
---|---|
JobHandle | A JobHandle which can be used to chain together multiple tasks or to query for completion. Can be safely discarded. |
Remarks
Image addition can take some time (several frames) due to extra processing that must occur to insert the image into the library. This is done using the [Unity Job System](xref:JobSystem). The returned [JobHandle](xref:Unity.Jobs.JobHandle) can be used to chain together multiple tasks or to query for completion, but can be safely discarded if you do not need it.
This job, like all Unity jobs, can have dependencies (using the inputDeps
). This can be useful,
for example, if imageBytes
is the output of another job. If you are adding multiple
images to the library, it is not necessary to pass a previous ScheduleAddImageJob
JobHandle as the input
dependency to the next ScheduleAddImageJob
; they can be processed concurrently.
The imageBytes
must be valid until this job completes. The caller is responsible for managing its memory.
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if |
ArgumentException | Thrown if |
ArgumentNullException | Thrown if |
ArgumentOutOfRangeException | Thrown if |
InvalidOperationException | Thrown if the |
ArgumentOutOfRangeException | Thrown if |