picogl.core.viewport ==================== .. py:module:: picogl.core.viewport .. autoapi-nested-parse:: Represents a rectangular viewport with position and dimensions. The class provides positional information, size, aspect ratio, and a method to retrieve the viewport as a numerical array. Classes ------- .. autoapisummary:: picogl.core.viewport.Viewport picogl.core.viewport.GLViewport Module Contents --------------- .. py:class:: Viewport Represents a rectangular viewport with position and dimensions. .. py:attribute:: x :type: int .. py:attribute:: y :type: int .. py:attribute:: width :type: int .. py:attribute:: height :type: int .. py:property:: size :type: tuple[int, int] .. py:property:: aspect_ratio :type: float .. py:method:: as_array() -> numpy.ndarray .. py:method:: as_tuple() -> tuple[int, int, int, int] .. py:method:: unproject(x: float, y: float, depth: float, inv_mvp: pyglm.glm.mat4) -> numpy.ndarray | None unproject .. py:method:: flip_y(y: float) -> float .. py:method:: world(inv_mvp: pyglm.glm.mat4, ndc: numpy.ndarray) -> numpy.ndarray :staticmethod: .. py:method:: ndc(depth: float, x: float, y: float) -> numpy.ndarray[Any, numpy.dtype[Any]] | numpy.ndarray[Any, numpy.dtype[numpy.generic]] .. py:method:: _unproject_for_depth(x: float, y: float, inv_mvp, depth: float) -> numpy.ndarray | None .. py:method:: near(x: float, y: float, inv_mvp: pyglm.glm.mat4) -> numpy.ndarray | None .. py:method:: far(x: float, y: float, inv_mvp: pyglm.glm.mat4) -> numpy.ndarray | None .. py:property:: center :type: tuple[float, float] .. py:method:: contains(x: float, y: float) -> bool .. py:property:: rect :type: tuple[int, int, int, int] .. py:class:: GLViewport(*args, **kwargs) Bases: :py:obj:`Viewport` Represents a rectangular viewport with position and dimensions. .. py:method:: apply() .. py:method:: update(x: int, y: int, w: int, h: int)