Description

Texture Provider giving a cropped region of the input texture, calculated based on face position. Can be accessed using Texture.control on a FaceCropTexture asset. For more information, see the Crop Textures guide.

Example

//@input Asset.Texture faceCropTexture
//@input Asset.Texture deviceCameraTexture

var cropProvider = script.faceCropTexture.control;
cropProvider.inputTexture = script.deviceCameraTexture;
cropProvider.faceIndex = 0;
cropProvider.textureScale = new vec2(1.25, 1.25);
cropProvider.faceCenterMouthWeight = 0.0;
interface FaceCropTextureProvider {
    faceCenterMouthWeight: number;
    faceIndex: number;
    inputTexture: Texture;
    textureScale: vec2;
    getAspect(): number;
    getHeight(): number;
    getLoadStatus(): LoadStatus;
    getTypeName(): string;
    getWidth(): number;
    isOfType(type): boolean;
    isSame(other): boolean;
}

Hierarchy (view full)

Properties

faceCenterMouthWeight: number

Description

Ratio of the mouth position on the cropped texture. Value ranges from 0 to 1, with 0 having no effect and 1 centering the image on the mouth.

faceIndex: number

Description

Index of the face being tracked.

inputTexture: Texture

Description

Input texture to crop.

textureScale: vec2

Description

Scaling of the cropped texture.

Methods

  • Returns number

    Description

    Returns the texture's aspect ratio, which is calculated as width / height.

  • Parameters

    • type: string

    Returns boolean

    Description

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

  • Parameters

    Returns boolean

    Description

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

Generated using TypeDoc