Package VisionEgg :: Module Gratings :: Class SinGrating2D
[frames | no frames]

Class SinGrating2D

         object --+            
                  |            
ClassWithParameters --+        
                      |        
               Stimulus --+    
                          |    
     LuminanceGratingCommon --+
                              |
                             SinGrating2D


Sine wave grating stimulus

This is a general-purpose, realtime sine-wave luminace grating
generator. To acheive an arbitrary orientation, this class rotates
a textured quad.  To draw a grating with sides that always remain
horizontal and vertical, draw a large grating in a small viewport.
(The viewport will clip anything beyond its edges.)

Parameters
==========
anchor                      -- specifies how position parameter is interpreted (String)
                               Default: center
bit_depth                   -- precision with which grating is calculated and sent to OpenGL (UnsignedInteger)
                               Inherited from LuminanceGratingCommon
                               Default: 8
color1                      -- (AnyOf(Sequence3 of Real or Sequence4 of Real))
                               Default: (1.0, 1.0, 1.0)
color2                      -- optional color with which to perform interpolation with color1 in RGB space (AnyOf(Sequence3 of Real or Sequence4 of Real))
                               Default: (determined at instantiation)
contrast                    -- (Real)
                               Default: 1.0
depth                       -- (Real)
                               Default: (determined at instantiation)
ignore_time                 -- (Boolean)
                               Default: False
mask                        -- optional masking function (Instance of <class 'VisionEgg.Textures.Mask2D'>)
                               Default: (determined at instantiation)
max_alpha                   -- (Real)
                               Default: 1.0
num_samples                 -- (UnsignedInteger)
                               Default: 512
on                          -- draw stimulus? (Boolean)
                               Default: True
orientation                 -- (Real)
                               Default: 0.0
pedestal                    -- (Real)
                               Default: 0.5
phase_at_t0                 -- (Real)
                               Default: 0.0
position                    -- (units: eye coordinates) (Sequence2 of Real)
                               Default: (320.0, 240.0)
recalculate_phase_tolerance -- (Real)
                               Default: (determined at instantiation)
size                        -- (Sequence2 of Real)
                               Default: (640.0, 480.0)
spatial_freq                -- (Real)
                               Default: 0.0078125
t0_time_sec_absolute        -- (Real)
                               Default: (determined at instantiation)
temporal_freq_hz            -- (Real)
                               Default: 5.0

Method Summary
  __init__(self, **kw)
Instantiate and get ready to draw.
  __del__(self)
  draw(self)
Draw the stimulus.
    Inherited from LuminanceGratingCommon
  calculate_bit_depth_dependencies(self)
Calculate a number of parameters dependent on bit depth.
    Inherited from ClassWithParameters
  get_specified_type(self, parameter_name)
  is_constant_parameter(self, parameter_name)
  set(self, **kw)
Set a parameter with type-checked value This is the slow but safe way to set parameters.
  verify_parameters(self)
Perform type check on all parameters...
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name...
  __getattribute__(...)
x.__getattribute__('name') <==> x.name...
  __hash__(x)
x.__hash__() <==> hash(x)...
  __reduce__(...)
helper for pickle...
  __reduce_ex__(...)
helper for pickle...
  __repr__(x)
x.__repr__() <==> repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value...
  __str__(x)
x.__str__() <==> str(x)...
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T...

Class Variable Summary
tuple __slots__ = ('parameters', 'constant_parameters', 'gl_in...
member_descriptor cached_bit_depth = <member 'cached_bit_depth' of 'SinGra...
member_descriptor constant_parameters = <member 'constant_parameters' of '...
member_descriptor format = <member 'format' of 'SinGrating2D' objects>
member_descriptor gl_internal_format = <member 'gl_internal_format' of 'Si...
member_descriptor gl_type = <member 'gl_type' of 'SinGrating2D' objects>
member_descriptor max_int_val = <member 'max_int_val' of 'SinGrating2D' ob...
member_descriptor numeric_type = <member 'numeric_type' of 'SinGrating2D' ...
member_descriptor parameters = <member 'parameters' of 'SinGrating2D' obje...
ParameterDefinition parameters_and_defaults = {'temporal_freq_hz': (5.0, <cl...
    Inherited from ClassWithParameters
ParameterDefinition constant_parameters_and_defaults = {}

Method Details

__init__(self, **kw)
(Constructor)

Instantiate and get ready to draw.

Set parameter values and create anything needed to draw the
stimulus including OpenGL state variables such display lists
and texture objects.
Overrides:
VisionEgg.Core.Stimulus.__init__ (inherited documentation)

draw(self)

Draw the stimulus. (Called by Viewport instance.)

This method is called every frame.  This method actually
performs the OpenGL calls to draw the stimulus.
Overrides:
VisionEgg.Core.Stimulus.draw (inherited documentation)

Class Variable Details

__slots__

Type:
tuple
Value:
('parameters',
 'constant_parameters',
 'gl_internal_format',
 'format',
 'gl_type',
 'numeric_type',
 'max_int_val',
 'cached_bit_depth',
...                                                                    

cached_bit_depth

Type:
member_descriptor
Value:
<member 'cached_bit_depth' of 'SinGrating2D' objects>                  

constant_parameters

Type:
member_descriptor
Value:
<member 'constant_parameters' of 'SinGrating2D' objects>               

format

Type:
member_descriptor
Value:
<member 'format' of 'SinGrating2D' objects>                            

gl_internal_format

Type:
member_descriptor
Value:
<member 'gl_internal_format' of 'SinGrating2D' objects>                

gl_type

Type:
member_descriptor
Value:
<member 'gl_type' of 'SinGrating2D' objects>                           

max_int_val

Type:
member_descriptor
Value:
<member 'max_int_val' of 'SinGrating2D' objects>                       

numeric_type

Type:
member_descriptor
Value:
<member 'numeric_type' of 'SinGrating2D' objects>                      

parameters

Type:
member_descriptor
Value:
<member 'parameters' of 'SinGrating2D' objects>                        

parameters_and_defaults

Type:
ParameterDefinition
Value:
{'temporal_freq_hz': (5.0, <class 'VisionEgg.ParameterTypes.Real'>), '\
orientation': (0.0, <class 'VisionEgg.ParameterTypes.Real'>), 'ignore_\
time': (False, <class 'VisionEgg.ParameterTypes.Boolean'>), 'recalcula\
te_phase_tolerance': (None, <class 'VisionEgg.ParameterTypes.Real'>), \
'max_alpha': (1.0, <class 'VisionEgg.ParameterTypes.Real'>), 'color1':\
 ((1.0, 1.0, 1.0), <VisionEgg.ParameterTypes.AnyOf object at 0x40f214e\
c>), 'color2': (None, <VisionEgg.ParameterTypes.AnyOf object at 0x40f2\
158c>, 'optional color with which to perform interpolation with color1\
...                                                                    

Generated by Epydoc 2.0 on Fri Sep 19 18:29:40 2003 http://epydoc.sf.net