Aperture ===================================== .. code-block:: python class psychopy.visual.Aperture(win, size=1, pos=(0, 0), ori=0, nVert=120, shape='circle', inverted=False, units=None, name=None, autoLog=None) 視覚刺激の可視範囲をいくつかの形状や頂点リストで定義した図形の形状に制限する。 Apertureオブジェクトを有効にすると、全ての刺激の描画範囲はApertureで作られた「窓」の中に制限される。無効にすると、通常通り描画される。 shapeが'square'または'triangle'の場合は、それぞれの形の窓が作られる。'circle'またはNoneの場合はnVertsで指定された個数のポリゴンで窓が作られる。円にするにはnVertsは120程度が推奨である。 .. 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) shapeが頂点の座標を並べたシーケンスかNx2のNumPy arrayオブジェクトの場合は、ShapeStimのverticesのようにそれらの値を使って窓を作成する。 shapeが画像ファイル名の場合は、ImageStimと同様の方法でファイルから画像を読み込み、画像のアルファチャネルから窓を作成する。アルファチャネル以外の色成分は無視される。 Coderのデモのaperture.pyを参照のこと。 .. 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