docs.unity3d.com
    目次を表示する/隠す

    Class MutableRuntimeReferenceImageLibraryExtensions

    Extension methods for MutableRuntimeReferenceImageLibrary.

    Inheritance
    Object
    MutableRuntimeReferenceImageLibraryExtensions
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.XR.ARFoundation
    Syntax
    public static class MutableRuntimeReferenceImageLibraryExtensions

    Methods

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

    Asynchronously adds texture to library.

    Declaration
    [Obsolete("Use ScheduleAddImageWithValidationJob instead. (2020-10-20)")]
    public static JobHandle ScheduleAddImageJob(this MutableRuntimeReferenceImageLibrary library, Texture2D texture, string name, float? widthInMeters, JobHandle inputDeps = default(JobHandle))
    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. Can be safely discarded.

    Remarks

    This method is deprecated. Use ScheduleAddImageWithValidationJob(MutableRuntimeReferenceImageLibrary, Texture2D, String, Nullable<Single>, JobHandle) instead.

    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 you can 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(MutableRuntimeReferenceImageLibrary, Texture2D, String, Nullable<Single>, JobHandle) JobHandle as the input dependency to the next ScheduleAddImageJob(MutableRuntimeReferenceImageLibrary, Texture2D, String, Nullable<Single>, JobHandle); they can be processed concurrently.

    The bytes of the texture are copied, so you can safely destroy the texture after this method returns.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if library is null.

    ArgumentNullException

    Thrown if texture is null.

    InvalidOperationException

    Thrown if texture is not readable.

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

    Asynchronously adds texture to library.

    Declaration
    public static AddReferenceImageJobState ScheduleAddImageWithValidationJob(this MutableRuntimeReferenceImageLibrary library, Texture2D texture, string name, float? widthInMeters, JobHandle inputDeps = default(JobHandle))
    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
    AddReferenceImageJobState

    Returns an AddReferenceImageJobState that can be used to query the status of the job. The AddReferenceImageJobState can be used to determine whether the image was successfully added. If image validity can be determined, invalid images will be not be added to the reference image library.

    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 AddReferenceImageJobState can be used to query for job completion and whether the addition was successful.

    The bytes of the texture are copied, so the texture may be safely destroyed after this method returns.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if library is null.

    ArgumentNullException

    Thrown if texture is null.

    InvalidOperationException

    Thrown if texture is not readable.

    トップに戻る
    Copyright © 2023 Unity Technologies — 商標と利用規約
    • 法律関連
    • プライバシーポリシー
    • クッキー
    • 私の個人情報を販売または共有しない
    • Your Privacy Choices (Cookie Settings)