picogl.gpu.buffers.attributes ============================= .. py:module:: picogl.gpu.buffers.attributes .. autoapi-nested-parse:: Attribute and layout specification handling module. This module defines data structures for specifying attributes and layout descriptors in a graphical or geometrical context. These structures are used to describe how data is stored, accessed, and organized for rendering or processing purposes. Classes ------- .. autoapisummary:: picogl.gpu.buffers.attributes.AttributeSpec picogl.gpu.buffers.attributes.LayoutDescriptor picogl.gpu.buffers.attributes.CanonicalVertexAttrs picogl.gpu.buffers.attributes.VBOAttrs Functions --------- .. autoapisummary:: picogl.gpu.buffers.attributes.legacy_attribute_spec Module Contents --------------- .. py:class:: AttributeSpec Attribute specification. .. py:attribute:: name :type: str .. py:attribute:: index :type: int .. py:attribute:: size :type: int .. py:attribute:: type :type: picogl.backend.gl.enums.GLNumeric .. py:attribute:: normalized :type: bool .. py:attribute:: stride :type: int .. py:attribute:: offset :type: int .. py:attribute:: vbo_type :type: picogl.gpu.buffers.vertex.vbo.vbo_class.VBOType .. py:attribute:: role :type: picogl.gpu.buffers.vertex.aliases.VertexBufferRole .. py:function:: legacy_attribute_spec(role: picogl.gpu.buffers.vertex.aliases.VertexBufferRole, index: int, *, size: int = 3, name: str | picogl.gpu.buffers.vertex.aliases.VertexBufferRole | None = None, type: picogl.backend.gl.enums.GLNumeric, normalized: bool = False, stride: int = 0, offset: int = 0) -> AttributeSpec Build an AttributeSpec with aligned legacy role, vbo_type, and name. .. py:class:: LayoutDescriptor Layout descriptor. .. py:attribute:: attributes :type: List[AttributeSpec] .. py:attribute:: _cache :type: dict[picogl.gpu.buffers.vertex.vbo.vbo_class.VBOType, AttributeSpec] | None :value: None .. py:method:: __getitem__(vbo_type: picogl.gpu.buffers.vertex.vbo.vbo_class.VBOType) -> AttributeSpec .. py:method:: get_attr(vbo_type: picogl.gpu.buffers.vertex.vbo.vbo_class.VBOType) -> AttributeSpec .. py:method:: has_attr(vbo_type: picogl.gpu.buffers.vertex.vbo.vbo_class.VBOType) -> bool .. py:method:: as_dict() -> dict[picogl.gpu.buffers.vertex.vbo.vbo_class.VBOType, AttributeSpec] .. py:property:: attr_dict :type: dict[picogl.gpu.buffers.vertex.vbo.vbo_class.VBOType, AttributeSpec] dict .. py:class:: CanonicalVertexAttrs Bases: :py:obj:`picogl.utils.strenum.StrEnum` Canonical Vertex Attrs .. py:attribute:: POSITIONS :value: 'positions' .. py:attribute:: COLORS :value: 'colors' .. py:attribute:: NORMALS :value: 'normals' .. py:attribute:: INDICES :value: 'indices' .. py:class:: VBOAttrs VBO Attrs .. py:attribute:: VBO .. py:attribute:: NBO .. py:attribute:: CBO .. py:attribute:: EBO .. py:attribute:: ALL