API

Variable CopyToolsConst

CopyTools: {
    GenerateBase64StringFromPixelData: (
        pixels: ArrayBufferView,
        size: ISize,
        invertY?: boolean,
    ) => Nullable<string>;
    GenerateBase64StringFromTexture: (
        texture: BaseTexture,
        faceIndex?: number,
        level?: number,
    ) => Nullable<string>;
    GenerateBase64StringFromTextureAsync: (
        texture: BaseTexture,
        faceIndex?: number,
        level?: number,
    ) => Promise<Nullable<string>>;
} = ...

Class used to host copy specific utilities (Back-compat)

Type Declaration

  • GenerateBase64StringFromPixelData: (pixels: ArrayBufferView, size: ISize, invertY?: boolean) => Nullable<string>

    Transform some pixel data to a base64 string

    defines the pixel data to transform to base64

    defines the width and height of the (texture) data

    true if the data must be inverted for the Y coordinate during the conversion

    The base64 encoded string or null

  • GenerateBase64StringFromTexture: (texture: BaseTexture, faceIndex?: number, level?: number) => Nullable<string>

    Reads the pixels stored in the webgl texture and returns them as a base64 string

    defines the texture to read pixels from

    defines the face of the texture to read (in case of cube texture)

    defines the LOD level of the texture to read (in case of Mip Maps)

    The base64 encoded string or null

  • GenerateBase64StringFromTextureAsync: (
        texture: BaseTexture,
        faceIndex?: number,
        level?: number,
    ) => Promise<Nullable<string>>

    Reads the pixels stored in the webgl texture and returns them as a base64 string

    defines the texture to read pixels from

    defines the face of the texture to read (in case of cube texture)

    defines the LOD level of the texture to read (in case of Mip Maps)

    The base64 encoded string or null wrapped in a promise