picogl.gpu.buffers.length

Helpers for resolving vertex counts from GPU buffer objects.

Functions

length_from_array_data(data, *[, components]) → int

Return the number of vertices represented by a NumPy buffer.

_is_mock(obj) → bool

_has_measurable_data(obj) → bool

length_from_vbo(vbo) → int

Return vertex count from a single VBO object.

_implements_data_length(obj) → bool

True when obj defines a real data_length (not a MagicMock stub).

_data_length_from_buffer_like(obj) → int

drawable_data_length(drawable) → int

Return vertex count from a drawable buffer group, VAO/VBG, or VBO.

Module Contents

picogl.gpu.buffers.length.length_from_array_data(data: numpy.typing.ArrayLike | None, *, components: int = 1) → int[source]

Return the number of vertices represented by a NumPy buffer.

picogl.gpu.buffers.length._is_mock(obj: object) → bool[source]
picogl.gpu.buffers.length._has_measurable_data(obj: picogl.protocols.drawable_buffer.VertexBufferDataSource | picogl.protocols.drawable_buffer.BufferContainer | object) → bool[source]
picogl.gpu.buffers.length.length_from_vbo(vbo: picogl.protocols.drawable_buffer.VertexBufferDataSource | None) → int[source]

Return vertex count from a single VBO object.

picogl.gpu.buffers.length._implements_data_length(obj: picogl.protocols.drawable_buffer.DrawableBuffer | object) → bool[source]

True when obj defines a real data_length (not a MagicMock stub).

picogl.gpu.buffers.length._data_length_from_buffer_like(obj: picogl.protocols.drawable_buffer.DrawableBuffer | picogl.protocols.drawable_buffer.VertexBufferDataSource | object) → int[source]
picogl.gpu.buffers.length.drawable_data_length(drawable: picogl.protocols.drawable_buffer.DrawableLengthInput) → int[source]

Return vertex count from a drawable buffer group, VAO/VBG, or VBO.