Foundry Virtual Tabletop - API Documentation - Version 14
    Preparing search index...

    Class TextureExtractor

    A class or interface that provide support for WebGL async read pixel/texture data extraction.

    Index

    Constructors

    • Parameters

      • renderer: Renderer

        The renderer

      • Optionalconfig: {
            callerName?: string;
            controlHash?: boolean;
            debug?: boolean;
            format?: FORMATS;
        } = {}

        Worker initialization options

        • OptionalcallerName?: string

          The caller name

        • OptionalcontrolHash?: boolean

          Should use control hash?

        • Optionaldebug?: boolean

          Enable debug log?

        • Optionalformat?: FORMATS

          The texture format

      Returns TextureExtractor

    Properties

    debug: boolean = false

    Debug flag.

    COMPRESSION_MODES: { BASE64: number; NONE: number } = ...

    List of compression that could be applied with extraction

    Accessors

    • get format(): FORMATS

      The texture format on which the Texture Extractor must work.

      Returns FORMATS

    • get renderer(): Renderer

      The WebGL2 renderer.

      Returns Renderer

    • get type(): TYPES

      The texture type on which the Texture Extractor must work.

      Returns TYPES

    Methods

    • Called by the renderer contextChange runner.

      Returns void

    • Destroy this TextureExtractor.

      Returns void

    • Extract a rectangular block of pixels from the texture (without un-pre-multiplying).

      Parameters

      Returns Promise<
          {
              height: number;
              out?: ArrayBuffer;
              pixels: Uint8ClampedArray
              | undefined;
              width: number;
          },
      >

      The pixels or undefined if there's no change compared to the last time pixels were extracted and the control hash option is enabled. If an output buffer was passed, the (new) output buffer is included in the result, which may be different from the output buffer that was passed because it was detached.

    • Parameters

      Returns Promise<string | undefined>

      The base64 string or undefined if there's no change compared to the last time base64 was extracted and the control hash option is enabled.

    • Free all the bound objects.

      Returns void