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

    Interface IReadonlyBitSet

    Read-only bitset interface.

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

    interface IReadonlyBitSet {
        clearValue: boolean;
        size: number;
        count(value: boolean): number;
        findFirst(value: boolean): number;
        forEachDifference(
            other: IReadonlyBitSet,
            callback: TDifferenceForeachCallback,
        ): void;
        forEachFilter(value: boolean, callback: TOkForeachCallback): void;
        get(index: number): boolean;
    }

    Implemented by

    Index
    clearValue: boolean

    The value returned by the bitset when it is in a fully cleared state.

    size: number

    Total number of bits in the set.

    • Counts bits matching the requested value.

      Parameters

      • value: boolean

        Bit value to count (true or false).

      Returns number

      Number of matching bits.

    • 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.