Method ScheduleAddImageWithValidationJob
ScheduleAddImageWithValidationJob(NativeSlice<byte>, Vector2Int, TextureFormat, XRReferenceImage, JobHandle)
Asynchronously adds an image to this library.
Declaration
public AddReferenceImageJobState ScheduleAddImageWithValidationJob(NativeSlice<byte> imageBytes, Vector2Int sizeInPixels, TextureFormat format, XRReferenceImage referenceImage, JobHandle inputDeps = default)
Parameters
Type | Name | Description |
---|---|---|
Native |
imageBytes | The raw image bytes in |
Vector2Int | sizeInPixels | The width and height of the image, in pixels. |
Texture |
format | The format of |
XRReference |
referenceImage | The XRReference |
Job |
inputDeps | (Optional) Input dependencies for the add image job. |
Returns
Type | Description |
---|---|
Add |
Returns an Add |
Remarks
Image addition can take some time (for example, several frames) due to the processing that must occur to insert
the image into the library. This is done using the Unity Job System. The returned
Add
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 ScheduleJobHandle
as the input dependency to the next
Schedule
The imageBytes
must be valid until this job completes. The caller is responsible for
managing its memory. You can use the resulting JobHandle
to schedule a job that deallocates the
imageBytes
.
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if |
Argument |
|
Argument |
Thrown if |
Argument |
Thrown if |
Invalid |
Thrown if the |
Argument |
Thrown if |