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

Class SinGrating2D

source code

         object --+            
                  |            
ClassWithParameters --+        
                      |        
          Core.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 runtime)
contrast                    -- (Real)
                               Default: 1.0
depth                       -- (Real)
                               Default: (determined at runtime)
ignore_time                 -- (Boolean)
                               Default: False
mask                        -- optional masking function (Instance of <class 'VisionEgg.Textures.Mask2D'>)
                               Default: (determined at runtime)
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 runtime)
size                        -- defines coordinate size of grating (in eye coordinates) (Sequence2 of Real)
                               Default: (640.0, 480.0)
spatial_freq                -- frequency defined relative to coordinates defined in size parameter (units: cycles/eye_coord_unit) (Real)
                               Default: 0.0078125
t0_time_sec_absolute        -- (Real)
                               Default: (determined at runtime)
temporal_freq_hz            -- (Real)
                               Default: 5.0



Instance Methods
 
__init__(self, **kw)
Instantiate and get ready to draw.
source code
 
__del__(self) source code
 
draw(self)
Draw the stimulus.
source code

Inherited from LuminanceGratingCommon: calculate_bit_depth_dependencies

Inherited from ClassWithParameters: __getstate__, __setstate__, get_specified_type, is_constant_parameter, set, verify_parameters

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables
  parameters_and_defaults = VisionEgg.ParameterDefinition({'on':...

Inherited from ClassWithParameters: __safe_for_unpickling__, constant_parameters_and_defaults

Properties

Inherited from object: __class__

Method Details

__init__(self, **kw)
(Constructor)

source code 
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: Core.Stimulus.__init__
(inherited documentation)

draw(self)

source code 
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: Core.Stimulus.draw
(inherited documentation)

Class Variable Details

parameters_and_defaults

Value:
VisionEgg.ParameterDefinition({'on':(True, ve_types.Boolean, "draw sti\
mulus?"), 'mask':(None, ve_types.Instance(VisionEgg.Textures.Mask2D), \
"optional masking function"), 'contrast':(1.0, ve_types.Real), 'pedest\
al':(0.5, ve_types.Real), 'position':((320.0, 240.0), ve_types.Sequenc\
e2(ve_types.Real), "(units: eye coordinates)"), 'anchor':('center', ve\
_types.String, "specifies how position parameter is interpreted"), 'de\
pth':(None, ve_types.Real), 'size':((640.0, 480.0), ve_types.Sequence2\
(ve_types.Real), "defines coordinate size of grating (in eye coordinat\
...