Class MutableRuntimeReferenceImageLibraryExtensions | AR Foundation | 3.0.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class MutableRuntimeReferenceImageLibraryExtensions

    Extension methods for UnityEngine.XR.ARSubsystems.MutableRuntimeReferenceImageLibrary.

    Inheritance
    Object
    MutableRuntimeReferenceImageLibraryExtensions
    Namespace: UnityEngine.XR.ARFoundation
    Syntax
    public static class MutableRuntimeReferenceImageLibraryExtensions

    Methods

    ScheduleAddImageJob(MutableRuntimeReferenceImageLibrary, Texture2D, String, Nullable<Single>, JobHandle)

    Asynchronously adds texture to library.

    Declaration
    public static JobHandle ScheduleAddImageJob(this MutableRuntimeReferenceImageLibrary library, Texture2D texture, string name, float? widthInMeters, JobHandle inputDeps = null)
    Parameters
    Type Name Description
    MutableRuntimeReferenceImageLibrary library

    The MutableRuntimeReferenceImageLibrary being extended.

    Texture2D texture

    The Texture2D to use as image target.

    String name

    The name of the image.

    Nullable<Single> widthInMeters

    The physical width of the image, in meters.

    JobHandle inputDeps

    Input job dependencies (optional).

    Returns
    Type Description
    JobHandle

    A JobHandle which can be used to chain together multiple tasks or to query for completion. May 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. The returned JobHandle can be used to chain together multiple tasks or to query for completion, but may be safely discarded if you do not need it.

    This job, like all Unity jobs, can have dependencies (using the inputDeps). 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 bytes of the texture are copied, so the texture may be safely destroyed after this method returns.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if is null.

    ArgumentNullException

    Thrown if texture is null.

    InvalidOperationException

    Thrown if texture is not readable.

    In This Article
    • Methods
      • ScheduleAddImageJob(MutableRuntimeReferenceImageLibrary, Texture2D, String, Nullable<Single>, JobHandle)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023