Aperture¶

class psychopy.visual.Aperture(win, size=1, pos=(0, 0), ori=0, nVert=120, shape='circle', inverted=False, units=None, name=None, autoLog=None)[source]

Restrict a stimulus visibility area to a basic shape or list of vertices.

When enabled, any drawing commands will only operate on pixels within the Aperture. Once disabled, subsequent draw operations affect the whole screen as usual.

If shape is ‘square’ or ‘triangle’ then that is what will be used If shape is ‘circle’ or None then a polygon with nVerts will be used

(120 for a rough circle)

If shape is a list or numpy array (Nx2) then it will be used directly

as the vertices to a ShapeStim

If shape is a filename then it will be used to load and image as a

ImageStim. Note that transparent parts in the image (e.g. in a PNG file) will not be included in the mask shape. The color of the image will be ignored.

See demos/stimuli/aperture.py for example usage

Author

2011, Yuri Spitsyn 2011, Jon Peirce added units options,

Jeremy Gray added shape & orientation

2014, Jeremy Gray added .contains() option 2015, Thomas Emmerling added ImageStim option

mro() → list

return a type’s method resolution order