picogl.backend.gl.api.texture.image =================================== .. py:module:: picogl.backend.gl.api.texture.image Attributes ---------- .. autoapisummary:: picogl.backend.gl.api.texture.image.ConstantType picogl.backend.gl.api.texture.image.CompressedTexData Classes ------- .. autoapisummary:: picogl.backend.gl.api.texture.image.TexImageParams picogl.backend.gl.api.texture.image.TexImage3DParams picogl.backend.gl.api.texture.image.CompressedTexImageParams Functions --------- .. autoapisummary:: picogl.backend.gl.api.texture.image._as_compressed_payload picogl.backend.gl.api.texture.image.gl_teximage2d_from_params picogl.backend.gl.api.texture.image.gl_teximage3d_from_params picogl.backend.gl.api.texture.image.gl_compressed_tex_image_from_params picogl.backend.gl.api.texture.image.gl_compressed_tex_image picogl.backend.gl.api.texture.image.gl_teximage2d picogl.backend.gl.api.texture.image.gl_teximage3d Module Contents --------------- .. py:data:: ConstantType .. py:data:: CompressedTexData .. py:class:: TexImageParams Parameters for glTexImage operations. .. py:attribute:: level :type: int .. py:attribute:: internalformat :type: ConstantType .. py:attribute:: width :type: int .. py:attribute:: height :type: int .. py:attribute:: border :type: int .. py:attribute:: format :type: ConstantType .. py:attribute:: num_type :type: int .. py:attribute:: data :type: Union[bytes, numpy.ndarray, None] :value: None .. py:class:: TexImage3DParams Bases: :py:obj:`TexImageParams` Parameters for glTexImage3D operations. .. py:attribute:: depth :type: int :value: 0 .. py:class:: CompressedTexImageParams Parameters for glCompressedTexImage2D operations. .. py:attribute:: level :type: int .. py:attribute:: gl_format :type: ConstantType .. py:attribute:: width :type: int .. py:attribute:: height :type: int .. py:attribute:: size :type: int .. py:attribute:: byte_array :type: CompressedTexData .. py:function:: _as_compressed_payload(data: CompressedTexData) -> bytes | numpy.ndarray Normalize compressed texel bytes for PyOpenGL's data converter. .. py:function:: gl_teximage2d_from_params(params: TexImageParams, target: int = GLTexture.TEXTURE_2D) -> None Issue ``glTexImage2D``. .. py:function:: gl_teximage3d_from_params(params: TexImage3DParams, target: int = GLTexture.TEXTURE_2D) -> None Issue ``glTexImage3D``. .. py:function:: gl_compressed_tex_image_from_params(params: CompressedTexImageParams) -> None Issue ``glCompressedTexImage2D`` for a 2D texture. .. py:function:: gl_compressed_tex_image(byte_array: CompressedTexData, gl_format: OpenGL.constant.FloatConstant | OpenGL.constant.IntConstant | OpenGL.constant.LongConstant | OpenGL.constant.StringConstant | OpenGL.constant.Constant, height: int, level: int, size: int, width: int) -> None Issue ``glCompressedTexImage2D`` for a 2D texture. PyOpenGL's wrapped ``glCompressedTexImage2D`` omits ``imageSize`` and derives it from ``data``. Passing an explicit size as the 7th argument makes PyOpenGL treat that int as the data pointer and raises ``NumberHandler`` / ``arrayByteCount``. .. py:function:: gl_teximage2d(target: int, level: int, internalformat: OpenGL.constant.FloatConstant | OpenGL.constant.IntConstant | OpenGL.constant.LongConstant | OpenGL.constant.StringConstant | OpenGL.constant.Constant, width: int, height: int, border: int, format: OpenGL.constant.FloatConstant | OpenGL.constant.IntConstant | OpenGL.constant.LongConstant | OpenGL.constant.StringConstant | OpenGL.constant.Constant, num_type: int = GLNumeric.UNSIGNED_BYTE, data: bytes | numpy.ndarray | None = None) -> None Issue ``glTexImage2D``. .. py:function:: gl_teximage3d(target: int, level: int, internalformat: OpenGL.constant.FloatConstant | OpenGL.constant.IntConstant | OpenGL.constant.LongConstant | OpenGL.constant.StringConstant | OpenGL.constant.Constant, width: int, height: int, depth: int, border: int, format: OpenGL.constant.FloatConstant | OpenGL.constant.IntConstant | OpenGL.constant.LongConstant | OpenGL.constant.StringConstant | OpenGL.constant.Constant, num_type: int, data: bytes | numpy.ndarray | None = None) -> None Issue ``glTexImage3D``.