MediaPipeTasksCommon Framework Reference

FloatRingBuffer

final class FloatRingBuffer

Circular floating-point sample buffer retaining the most recent length elements in order.

  • Creates a FloatRingBuffer of length elements initialized to zero.

    Declaration

    Swift

    init(length: Int)
  • A copy of all ring buffer elements ordered from oldest to newest.

    Declaration

    Swift

    final var floatBuffer: FloatBuffer { get }
  • The capacity of the ring buffer.

    Declaration

    Swift

    final var length: Int { get }
  • Resets all elements in the ring buffer to 0.0 and rewinds the write cursor.

    Declaration

    Swift

    final func clear()
  • Returns length chronologically ordered elements starting at offset from the oldest element.

    Declaration

    Swift

    final func floatBuffer(offset: Int, length: Int) throws -> FloatBuffer
  • Appends length elements from floatBuffer starting at offset into the circular buffer.

    If length exceeds the ring buffer capacity, only the most recent self.length elements are retained.

    Declaration

    Swift

    final func load(floatBuffer: FloatBuffer, offset: Int, length: Int) throws