playcanvas-opti-pixel - v1.2.0
    Preparing search index...

    Class BitSet

    Read-only bitset interface.

    Provides access to bit values, search helpers, and filtered iteration.

    Implements

    Index
    • Clears the bitset to its clean state.

      The resulting value of all bits is controlled by clearValue.

      Returns void

    • Copies bit values from another bitset.

      If source and destination sizes differ, the common range is copied and the remaining destination bits are filled with the destination clear value.

      Parameters

      • source: BitSet

        Source bitset.

      Returns void

    • Counts bits matching the requested value.

      Parameters

      • value: boolean

        Bit value to count (true or false).

      Returns number

      Number of matching bits.

    • Replaces the bit value at the specified index and returns the previous value.

      Parameters

      • index: number

        Bit index.

      • value: boolean

        New bit value.

      Returns boolean

      Previous bit value at the given index.

    • Finds the first bit matching the requested value.

      Parameters

      • value: boolean

        Bit value to search for.

      Returns number

      The first matching index, or -1 if none was found.

    • Iterates over the bits that differ between this set and other.

      Only the range both sets have in common is compared, so a longer set keeps its trailing bits to itself.

      Parameters

      • other: IReadonlyBitSet

        Bitset to compare against.

      • callback: TDifferenceForeachCallback

        Called for every differing index with the bit other holds there.

      Returns void

      Returning false from the callback stops iteration early.

    • Iterates over all bits matching the requested value.

      Parameters

      • value: boolean

        Bit value to filter by.

      • callback: TOkForeachCallback

        Called for every matching bit index.

      Returns void

      Returning false from the callback stops iteration early.

    • Returns the bit value at the specified index.

      Parameters

      • index: number

        Bit index.

      Returns boolean

      Bit value at the given index.

    • Sets the bit value at the specified index.

      Parameters

      • index: number

        Bit index.

      • value: boolean

        New bit value.

      Returns void