Controls the face image picker texture resource. Can be accessed through Texture.control on a Face Image Picker texture. For more information, see the Face Image Picker Texture guide.

// @input Asset.Texture faceImagePickerTexture

// Show the face image picker UI
script.faceImagePickerTexture.control.showImagePicker();

// Set a callback for when the user picks a different image from the image picker
script.faceImagePickerTexture.control.setImageChangedCallback(function(){
print("face image picker image changed");
});
interface FaceImagePickerTextureProvider {
    autoShowImagePicker: boolean;
    autoShowMediaPicker: boolean;
    cropFace: boolean;
    cropToFace: boolean;
    faceControl: FaceTextureProvider;
    faceImageControl: FaceTextureProvider;
    imageControl: TextureProvider;
    isContentReady: boolean;
    isFaceImagePickingEnabled: boolean;
    isImagePickingEnabled: boolean;
    isVideoPickingEnabled: boolean;
    videoControl: VideoTextureProvider;
    getAspect(): number;
    getHeight(): number;
    getLoadStatus(): LoadStatus;
    getTypeName(): string;
    getWidth(): number;
    hideImagePicker(): void;
    hideMediaPicker(): void;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
    setFaceMeshReadyCallback(callback: (() => void)): void;
    setFilePickedCallback(callback: (() => void)): void;
    setImageChangedCallback(callback: (() => void)): void;
    showImagePicker(): void;
    showMediaPicker(): void;
}

Hierarchy (view full)

Properties

autoShowImagePicker: boolean

If enabled, the image picker UI will be shown automatically when the Lens starts.

autoShowMediaPicker: boolean

If set to true, MediaPickerTextureProvider will request media picker UI automatically during loading.

cropFace: boolean

If set to true, MediaPickerTextureProvider will provide a proper texture transform for image with face(s), that will "zoom" UVs to the first found face on the image.

cropToFace: boolean

If enabled, the selected image will be cropped to only show the face region.

faceControl: FaceTextureProvider

The FaceTextureProvider used to provide the face texture.

faceImageControl: FaceTextureProvider

Returns underlying TextureProvider for the last selected media file. If the last media file was not image with at least one face, null is returned.

imageControl: TextureProvider

Returns underlying TextureProvider for the last selected media file. If the last media file was not image, null is returned.

isContentReady: boolean

Returns true if an image is selected, or a video file has been loaded and is ready for decoding, false otherwise.

isFaceImagePickingEnabled: boolean

MediaPickerTextureProvider will allow users to select only images with detected faces through media picker UI. See also "cropFace" option.

isImagePickingEnabled: boolean

MediaPickerTextureProvider will allow users to select all images files through media picker UI.

isVideoPickingEnabled: boolean

MediaPickerTextureProvider will allow users to select video files through media picker UI.

videoControl: VideoTextureProvider

Returns underlying VideoTextureProvider for the last selected media file. If the last media file was not video, null is returned.

Methods

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean

  • Sets a callback to fire when a file is picked through media picking UI.

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Binds a callback function for when the user selects or changes an image from the picker.

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void