diff --git a/doc/fsl.fsleyes.gl.gl14.rst b/doc/fsl.fsleyes.gl.gl14.rst index ea95a125dfc0278569ff8793738a8f81abdbc75b..6b520ea67dabbf2374485864a9797e24ae6289f0 100644 --- a/doc/fsl.fsleyes.gl.gl14.rst +++ b/doc/fsl.fsleyes.gl.gl14.rst @@ -1,20 +1,6 @@ fsl.fsleyes.gl.gl14 package =========================== -Submodules ----------- - -.. toctree:: - - fsl.fsleyes.gl.gl14.gllabel_funcs - fsl.fsleyes.gl.gl14.gllinevector_funcs - fsl.fsleyes.gl.gl14.glmodel_funcs - fsl.fsleyes.gl.gl14.glrgbvector_funcs - fsl.fsleyes.gl.gl14.glvolume_funcs - -Module contents ---------------- - .. automodule:: fsl.fsleyes.gl.gl14 :members: :undoc-members: diff --git a/doc/fsl.fsleyes.gl.gl21.rst b/doc/fsl.fsleyes.gl.gl21.rst index a2e56fa3a12fad42cd46631fbe2c7746dda7afa5..54a4f66e7bb709091049f6721ed2b7017f2064f9 100644 --- a/doc/fsl.fsleyes.gl.gl21.rst +++ b/doc/fsl.fsleyes.gl.gl21.rst @@ -1,20 +1,6 @@ fsl.fsleyes.gl.gl21 package =========================== -Submodules ----------- - -.. toctree:: - - fsl.fsleyes.gl.gl21.gllabel_funcs - fsl.fsleyes.gl.gl21.gllinevector_funcs - fsl.fsleyes.gl.gl21.glmodel_funcs - fsl.fsleyes.gl.gl21.glrgbvector_funcs - fsl.fsleyes.gl.gl21.glvolume_funcs - -Module contents ---------------- - .. automodule:: fsl.fsleyes.gl.gl21 :members: :undoc-members: diff --git a/doc/fsl.fsleyes.gl.textures.rst b/doc/fsl.fsleyes.gl.textures.rst index b519ad0cdfe5626e5af0952227f445e69b6f2297..ec4eeb91478437d822f0d87863b74e56159cddf2 100644 --- a/doc/fsl.fsleyes.gl.textures.rst +++ b/doc/fsl.fsleyes.gl.textures.rst @@ -1,22 +1,6 @@ fsl.fsleyes.gl.textures package =============================== -Submodules ----------- - -.. toctree:: - - fsl.fsleyes.gl.textures.colourmaptexture - fsl.fsleyes.gl.textures.imagetexture - fsl.fsleyes.gl.textures.lookuptabletexture - fsl.fsleyes.gl.textures.rendertexture - fsl.fsleyes.gl.textures.rendertexturestack - fsl.fsleyes.gl.textures.selectiontexture - fsl.fsleyes.gl.textures.texture - -Module contents ---------------- - .. automodule:: fsl.fsleyes.gl.textures :members: :undoc-members: diff --git a/fsl/fsleyes/gl/gl14/__init__.py b/fsl/fsleyes/gl/gl14/__init__.py index 2c0843a8bb6d8812a09c5e55dbb1081c5b31e506..a0dde223d6b0b952c5db54d8a717b36ef51b2050 100644 --- a/fsl/fsleyes/gl/gl14/__init__.py +++ b/fsl/fsleyes/gl/gl14/__init__.py @@ -1,9 +1,21 @@ #!/usr/bin/env python # -# __init__.py - +# __init__.py - Functions for OpenGL 1.4 rendering. # # Author: Paul McCarthy <pauldmccarthy@gmail.com> # +"""This package contains modules for rendering various :class:`.GLObject` +types in an OpenGL 1.4 compatible manner. The following modules currently +exist: + +.. autosummary:: + + ~fsl.fsleyes.gl.gl14.glvolume_funcs + ~fsl.fsleyes.gl.gl14.glrgbvector_funcs + ~fsl.fsleyes.gl.gl14.gllinevector_funcs + ~fsl.fsleyes.gl.gl14.glmodel_funcs + ~fsl.fsleyes.gl.gl14.gllabel_funcs +""" import glvolume_funcs import glrgbvector_funcs diff --git a/fsl/fsleyes/gl/gl14/glvolume_funcs.py b/fsl/fsleyes/gl/gl14/glvolume_funcs.py index 4546faaab674409e895b412190cd47068d7f73ab..c6b789dcb087e9651bc348c21b2b3504b1a948b3 100644 --- a/fsl/fsleyes/gl/gl14/glvolume_funcs.py +++ b/fsl/fsleyes/gl/gl14/glvolume_funcs.py @@ -25,7 +25,7 @@ log = logging.getLogger(__name__) def init(self): - """Calls :func:`compleShaders` and :func:`updateShaderState`.""" + """Calls :func:`compileShaders` and :func:`updateShaderState`.""" self.vertexProgram = None self.fragmentProgram = None diff --git a/fsl/fsleyes/gl/gl21/__init__.py b/fsl/fsleyes/gl/gl21/__init__.py index 2c0843a8bb6d8812a09c5e55dbb1081c5b31e506..f5873e38593c571d15cbcc7f92cc8ae678074f1b 100644 --- a/fsl/fsleyes/gl/gl21/__init__.py +++ b/fsl/fsleyes/gl/gl21/__init__.py @@ -1,9 +1,21 @@ #!/usr/bin/env python # -# __init__.py - +# __init__.py - Functions for OpenGL 2.1 rendering. # # Author: Paul McCarthy <pauldmccarthy@gmail.com> # +"""This package contains modules for rendering various :class:`.GLObject` +types in an OpenGL 2.1 compatible manner. The following modules currently +exist: + +.. autosummary:: + + ~fsl.fsleyes.gl.gl21.glvolume_funcs + ~fsl.fsleyes.gl.gl21.glrgbvector_funcs + ~fsl.fsleyes.gl.gl21.gllinevector_funcs + ~fsl.fsleyes.gl.gl21.glmodel_funcs + ~fsl.fsleyes.gl.gl21.gllabel_funcs +""" import glvolume_funcs import glrgbvector_funcs diff --git a/fsl/fsleyes/gl/gl21/glvolume_funcs.py b/fsl/fsleyes/gl/gl21/glvolume_funcs.py index cb59ceee93cd122962e38ad65985215329438a54..bc9c35bbf0ecd7f9fa7c0aa1d10bbbed8e4363f2 100644 --- a/fsl/fsleyes/gl/gl21/glvolume_funcs.py +++ b/fsl/fsleyes/gl/gl21/glvolume_funcs.py @@ -24,7 +24,7 @@ log = logging.getLogger(__name__) def init(self): - """Calls :func:`compleShaders` and :func:`updateShaderState`, + """Calls :func:`compileShaders` and :func:`updateShaderState`, and creates a GL buffer which will be used to store vertex data. """ diff --git a/fsl/fsleyes/gl/textures/__init__.py b/fsl/fsleyes/gl/textures/__init__.py index 36bba39b054aafa4ddeaa5c35c518562a63ff021..91e241111a7740154bbdef9dedb70ee2b4c291ef 100644 --- a/fsl/fsleyes/gl/textures/__init__.py +++ b/fsl/fsleyes/gl/textures/__init__.py @@ -18,15 +18,15 @@ The following texture types are defined in this package: .. autosummary:: :nosignatures: - Texture - Texture2D - ImageTexture - ColourMapTexture - LookupTableTexture - SelectionTexture - RenderTexture - GLObjectRenderTexture - RenderTextureStack + ~fsl.fsleyes.gl.textures.texture.Texture + ~fsl.fsleyes.gl.textures.texture.Texture2D + ~fsl.fsleyes.gl.textures.imagetexture.ImageTexture + ~fsl.fsleyes.gl.textures.colourmaptexture.ColourMapTexture + ~fsl.fsleyes.gl.textures.lookuptabletexture.LookupTableTexture + ~fsl.fsleyes.gl.textures.selectiontexture.SelectionTexture + ~fsl.fsleyes.gl.textures.rendertexture.RenderTexture + ~fsl.fsleyes.gl.textures.rendertexture.GLObjectRenderTexture + ~fsl.fsleyes.gl.textures.rendertexturestack.RenderTextureStack """ diff --git a/fsl/fsleyes/gl/textures/imagetexture.py b/fsl/fsleyes/gl/textures/imagetexture.py index 0a38f439ece6ffef89caa44ae9cf44a2d0b19614..20036e3cec87a95196bedeffc429832ed3504051 100644 --- a/fsl/fsleyes/gl/textures/imagetexture.py +++ b/fsl/fsleyes/gl/textures/imagetexture.py @@ -29,7 +29,7 @@ class ImageTexture(texture.Texture): manage a 3D texture which represents a :class:`.Image` instance. Once created, the :class:`.Image` instance is available as an attribute - of an :class:`ImageTexture` object, called `image``. Additionally, a + of an ``ImageTexture`` object, called ``image``. Additionally, a number of other attributes are added by the :meth:`__determineTextureType` method - see its documentation for more details. @@ -54,8 +54,8 @@ class ImageTexture(texture.Texture): normalise=False, prefilter=None, interp=gl.GL_NEAREST): - """Create an :class:`ImageTexture`. A listener is added to the - :attr:`.Image.data` property, so that the texture data can be + """Create an ``ImageTexture``. A listener is added to the + :attr:`.Image.data` property, so that the texture data can be refreshed whenever the image data changes - see the :meth:`__imageDataChanged` method. @@ -73,6 +73,7 @@ class ImageTexture(texture.Texture): :arg prefilter: An optional function which may perform any pre-processing on the data before it is copied to the GPU - see the :meth:`__prepareTextureData` method. + """ texture.Texture.__init__(self, name, 3) @@ -313,13 +314,13 @@ class ImageTexture(texture.Texture): .. note:: OpenGL does different things to 3D texture data depending on - its type: unsigned integer types are normalised from ``[0, - INT_MAX]`` to ``[0, 1]``. + its type: unsigned integer types are normalised from + ``[0, INT_MAX]`` to ``[0, 1]``. Floating point texture data types are, by default, *clamped* (not normalised), to the range ``[0, 1]``! This could be overcome by using a more recent versions of OpenGL, or by - using the ``ARB.texture_rg.GL_R32``F data format. Here, we + using the ``ARB.texture_rg.GL_R32F`` data format. Here, we simply cast floating point data to an unsigned integer type, normalise it to the appropriate range, and calculate a transformation matrix to transform back to the data range. diff --git a/fsl/fsleyes/gl/textures/texture.py b/fsl/fsleyes/gl/textures/texture.py index 86edd2400662087fc776e36d36ccc50be0a71489..4ba6e0a9f07de22ba80d81a7480815fa58f7cb4d 100644 --- a/fsl/fsleyes/gl/textures/texture.py +++ b/fsl/fsleyes/gl/textures/texture.py @@ -4,8 +4,8 @@ # # Author: Paul McCarthy <pauldmccarthy@gmail.com> # -"""This module provides the :class:`Texture` and :class:`Texture2D classes, -which are the base classes for all other texture types. +"""This module provides the :class:`Texture` and :class:`Texture2D` +classes, which are the base classes for all other texture types. """ import logging @@ -44,10 +44,10 @@ class Texture(object): tex.bindTexture() # Use nearest neighbour interpolation - gl.glTexParameteri(gl.GL_TEXTURE_2D + gl.glTexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER, gl.GL_NEAREST) - gl.glTexParameteri(gl.GL_TEXTURE_2D + gl.glTexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MAG_FILTER, gl.GL_NEAREST) @@ -163,7 +163,7 @@ class Texture(object): class Texture2D(Texture): - """The ``Texture2D` class represents a two-dimensional RGBA texture. A + """The ``Texture2D`` class represents a two-dimensional RGBA texture. A ``Texture2D`` instance can be used in one of two ways: - Setting the texture data via the :meth:`setData` method, and then @@ -175,7 +175,7 @@ class Texture2D(Texture): """ def __init__(self, name, interp=gl.GL_NEAREST): - """Create a ``Texture2D` instance. + """Create a ``Texture2D`` instance. :arg name: Unique name for this ``Texture2D``.