| Home | Trees | Index | Help |
|
|---|
| Package VisionEgg :: Module Core :: Class Screen |
|
object --+
|
ClassWithParameters --+
|
Screen
An OpenGL window, possibly displayed across multiple displays.
A Screen instance is an OpenGL window for the Vision Egg to draw
in. For an instance of Screen to do anything useful, it must
contain one or more instances of the Viewport class and one or
more instances of the Stimulus class.
Currently, only one OpenGL window is supported by the library with
which the Vision Egg initializes graphics (pygame/SDL). However,
this need not limit display to a single physical display device.
Many video drivers, for example, allow applications to treat two
separate monitors as one large array of contiguous pixels. By
sizing a window such that it occupies both monitors and creating
separate viewports for the portion of the window on each monitor,
a multiple screen effect can be created.
Public variables
================
size -- Tuple of 2 integers specifying width and height
red_bits -- Integer (or None if not supported) specifying framebuffer depth
green_bits -- Integer (or None if not supported) specifying framebuffer depth
blue_bits -- Integer (or None if not supported) specifying framebuffer depth
alpha_bits -- Integer (or None if not supported) specifying framebuffer depth
Parameters
==========
bgcolor -- background color (AnyOf(Sequence3 of Real or Sequence4 of Real))
Default: (0.5, 0.5, 0.5, 0.0)
Constant Parameters
===================
frameless -- remove standard window frame? (Boolean)
Default: 0
fullscreen -- use full screen? (Boolean)
Default: 0
hide_mouse -- hide the mouse cursor? (Boolean)
Default: 1
maxpriority -- raise priority? (platform dependent) (Boolean)
Default: 0
preferred_bpp -- preferred bits per pixel (bit depth) (UnsignedInteger)
Default: 32
size -- size (units: pixels) (Sequence2 of Real)
Default: (640, 480)
sync_swap -- synchronize buffer swaps to vertical sync? (Boolean)
Default: 1
| Method Summary | |
|---|---|
Create self.parameters and set values. | |
__del__(self)
| |
Called by Presentation instance. | |
Close the screen. | |
Alternative constructor using configuration variables. (Static method) | |
get pixel values from framebuffer to Numeric array... | |
get pixel values from framebuffer to PIL image... | |
get_size(self)
| |
Called by Viewport instance. | |
Measure the refresh rate. | |
Put pixel values to screen. | |
query_refresh_rate(self)
| |
Set the gamma_ramp, if supported. | |
set_size(self,
value)
| |
| 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... | |
| Property Summary | |
|---|---|
size | |
| Class Variable Summary | |
|---|---|
member_descriptor |
__cursor_visible_func__ = <member '__cursor_visible_func...
|
member_descriptor |
__pygame_quit__ = <member '__pygame_quit__' of 'Screen' ...
|
tuple |
__slots__ = ('parameters', 'constant_parameters', 'red_b...
|
member_descriptor |
alpha_bits = <member 'alpha_bits' of 'Screen' objects>
|
member_descriptor |
blue_bits = <member 'blue_bits' of 'Screen' objects>
|
member_descriptor |
constant_parameters = <member 'constant_parameters' of '...
|
ParameterDefinition |
constant_parameters_and_defaults = {'fullscreen': (0, <c...
|
member_descriptor |
green_bits = <member 'green_bits' of 'Screen' objects>
|
member_descriptor |
parameters = <member 'parameters' of 'Screen' objects>
|
ParameterDefinition |
parameters_and_defaults = {'bgcolor': ((0.5, 0.5, 0.5, 0...
|
member_descriptor |
red_bits = <member 'red_bits' of 'Screen' objects>
|
| Instance Method Details |
|---|
__init__(self,
**kw)
|
clear(self)Called by Presentation instance. Clear the screen. |
close(self)Close the screen. You can call this to close the screen. Not necessary during normal operation because it gets automatically deleted. |
get_framebuffer_as_array(self, buffer='back', format=6407, position=(0, 0), anchor='lowerleft', size=None)get pixel values from framebuffer to Numeric array |
get_framebuffer_as_image(self, buffer='back', format=6407, position=(0, 0), anchor='lowerleft', size=None)get pixel values from framebuffer to PIL image |
make_current(self)Called by Viewport instance. Makes screen active for drawing. Can not be implemented until multiple screens are possible. |
measure_refresh_rate(self, average_over_seconds=0.10000000000000001)Measure the refresh rate. Assumes swap buffers synced. |
put_pixels(self, pixels=None, position=(0, 0), anchor='lowerleft', scale_x=1.0, scale_y=1.0, texture_min_filter=9728, texture_mag_filter=9728, internal_format=6407)Put pixel values to screen. Pixel values become texture data using the VisionEgg.Textures module. Any source of texture data accepted by that module is accepted here. This function could be sped up by allocating a fixed OpenGL texture object. |
set_gamma_ramp(self, *args, **kw)Set the gamma_ramp, if supported. Call pygame.display.set_gamma_ramp, if available. Returns True on success, False otherwise. |
| Static Method Details |
|---|
create_default()Alternative constructor using configuration variables. Most of the time you can create and instance of Screen using this method. If your script needs explicit control of the Screen parameters, initialize with the normal constructor. Uses VisionEgg.config.VISIONEGG_GUI_INIT to determine how the default screen parameters should are determined. If this value is 0, the values from VisionEgg.cfg are used. If this value is 1, a GUI panel is opened and allows manual settings of the screen parameters. |
| Property Details |
|---|
size |
| Class Variable Details |
|---|
__cursor_visible_func__
|
__pygame_quit__
|
__slots__
|
alpha_bits
|
blue_bits
|
constant_parameters
|
green_bits
|
parameters
|
parameters_and_defaults
|
red_bits
|
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.0 on Fri Sep 19 18:29:39 2003 | http://epydoc.sf.net |