@stereograph/teiaviewer - v18.5.0-dev
    Preparing search index...

    Class TextureAtlas

    Handle an atlas texture: a texture containing multiple sub-textures. Each sub-texture ID encodes its (row, col) position:

    id = (row << 16) | col row = (id >> 16) & 0xFFFF col = id & 0xFFFF

    This keeps IDs stable even if the atlas size changes.

    Index

    Constructors

    Properties

    dataTexture: DataTexture
    signals: { onGrow: Signal<() => void> } = ...

    Accessors

    • get getAtlasSlotCount(): number

      Returns number

    • get hasFreeSlot(): boolean

      Returns boolean

    • get maxTextures(): number

      Returns number

    Methods

    • Add a texture in the atlas, if the texture is already stored, return the id already used, overwise return the new id

      Parameters

      • imageUrl: string

      Returns Promise<number>

    • Free one instance texture

      Parameters

      • hash: string

      Returns void

    • Free one instance texture using the slotId instead of the hash

      Parameters

      • slotId: number

      Returns void

    • Parameters

      • hash: string

      Returns undefined | number