| Home | Trees | Index | Help |
|
|---|
| Package VisionEgg :: Module Core :: Class Viewport |
|
object --+
|
ClassWithParameters --+
|
Viewport
Connects stimuli to a screen.
A viewport defines a (possibly clipped region) of the screen on
which stimuli are drawn.
A screen may have multiple viewports. The viewports may be
overlapping.
A viewport may have multiple stimuli.
A single stimulus may be drawn simultaneously by several
viewports, although this is typically useful only for 3D stimuli
to represent different views of the same object.
The coordinates of the stimulus are converted to screen
coordinates via several steps, the most important of which is the
projection, which is defined by an instance of the Projection
class.
By default, a viewport has a projection which maps eye coordinates
to viewport coordinates in 1:1 manner. In other words, eye
coordinates specify pixel location in the viewport.
For cases where pixel units are not natural to describe
coordinates of a stimulus, the application should specify the a
projection other than the default. This is usually the case for
3D stimuli.
For details of the projection and clipping process, see the
section 'Coordinate Transformations' in the book/online document
'The OpenGL Graphics System: A Specification'
Parameters
==========
anchor -- How position parameter is interpreted (String)
Default: lowerleft
depth_range -- depth range (in object units) for rendering (Sequence2 of Real)
Default: (0, 1)
position -- Position (in pixel units) within the screen (Sequence2 of Real)
Default: (0, 0)
projection -- projection for coordinate transforms (Instance of <class 'VisionEgg.Core.Projection'>)
Default: (determined at instantiation)
screen -- The screen in which this viewport is drawn (Instance of <class 'VisionEgg.Core.Screen'>)
Default: (determined at instantiation)
size -- Size (in pixel units) (Sequence2 of Real)
Default: (determined at instantiation)
stimuli -- sequence of stimuli to draw in screen (Sequence of Instance of <class 'VisionEgg.Core.Stimulus'>)
Default: (determined at instantiation)
| Method Summary | |
|---|---|
Create a new instance. | |
Transform clip coordinates to window coordinates... | |
Set the viewport and draw stimuli. | |
Transform eye coordinates to window coordinates... | |
make_current(self)
| |
Create instance of Projection mapping eye coordinates 1:1 with pixel coordinates. | |
Transform normalized device coordinates to window coordinates... | |
| Inherited from ClassWithParameters | |
| |
| |
Set a parameter with type-checked value This is the slow but safe way to set parameters. | |
Perform type check on all parameters... | |
| Inherited from object | |
x.__delattr__('name') <==> del x.name... | |
x.__getattribute__('name') <==> x.name... | |
x.__hash__() <==> hash(x)... | |
helper for pickle... | |
helper for pickle... | |
x.__repr__() <==> repr(x)... | |
x.__setattr__('name', value) <==> x.name = value... | |
x.__str__() <==> str(x)... | |
| Inherited from type | |
T.__new__(S, ...) -> a new object with type S, a subtype of T... | |
| Class Variable Summary | |
|---|---|
tuple |
__slots__ = ('parameters', 'constant_parameters', '_is_d...
|
member_descriptor |
constant_parameters = <member 'constant_parameters' of '...
|
member_descriptor |
parameters = <member 'parameters' of 'Viewport' objects>
|
ParameterDefinition |
parameters_and_defaults = {'projection': (None, <VisionE...
|
| Inherited from ClassWithParameters | |
ParameterDefinition |
constant_parameters_and_defaults = {}
|
| Method Details |
|---|
__init__(self,
**kw)
|
clip_2_window(self, eye_coords_vertex)Transform clip coordinates to window coordinates |
draw(self)Set the viewport and draw stimuli. |
eye_2_window(self, eye_coords_vertex)Transform eye coordinates to window coordinates |
make_new_pixel_coord_projection(self)Create instance of Projection mapping eye coordinates 1:1 with pixel coordinates. |
norm_device_2_window(self, norm_device_vertex)Transform normalized device coordinates to window coordinates |
| Class Variable Details |
|---|
__slots__
|
constant_parameters
|
parameters
|
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.0 on Fri Sep 19 18:29:39 2003 | http://epydoc.sf.net |