fsleyes.gl.colourbarcanvas¶
This module provides the ColourBarCanvas.
The ColourBarCanvas uses a ColourBar draw a colour bar
(with labels), and then renders said colour bar as a texture using OpenGL.
See the colourbar and
fsleyes_widgets.utils.colourbarbitmap modules for details on how the
colour bar is created.
-
class
fsleyes.gl.colourbarcanvas.ColourBarCanvas(overlayList, displayCtx)[source]¶ Bases:
__main__.MockClassContains logic to render a colour bar as an OpenGL texture.
-
highDpi= <MagicMock name='mock.Boolean()' id='281473497326640'>¶ Scale colour bar canvas for high-resolution screens.
-
barSize= <MagicMock name='mock.Percentage()' id='281473488836064'>¶ Size of the colour bar along its major axis, as a proportion of the available space.
-
__init__(overlayList, displayCtx)[source]¶ Adds a few listeners to the properties of this object, to update the colour bar when they change.
-
property
colourBar¶ Returns a reference to the
ColourBarobject that actually generates the colour bar bitmap.
-
_initGL()[source]¶ Called automatically by the OpenGL canvas target superclass (see the
WXGLCanvasTargetandOSMesaCanvasTargetfor details).Generates the colour bar texture.
-
destroy()[source]¶ Should be called when this
ColourBarCanvasis no longer needed. Destroys theTexture2DandColourBarinstances used to render the colour bar.
-
_ColourBarCanvas__genColourBarTexture()¶ Retrieves a colour bar bitmap from the
ColourBar, and copies it to aTexture2D.
-
_ColourBarCanvas__highDpiChanged(*a)¶ Called when the
highDpiproperty changes. Calls theGLCanvasTarget.EnableHighDPI()method.
-
__module__= 'fsleyes.gl.colourbarcanvas'¶
-