![]() flipVert : # We need to make the flip # Numpy and pyglet disagree about ori so udlr self. Note that this is relative to the original image, not relative to the current state. If set to True then the image will be flipped vertically (top-to-bottom). _needStrUpdate = True def setFlipHoriz ( self, newVal = True, log = None ): """Usually you can use 'stim.attribute = value' syntax instead, but use this method if you need to suppress the log message.""" setAttribute ( self, 'flipHoriz', newVal, log ) def flipVert ( self, value ): """True/False. size )) # check position with size, warn if stimuli not fully drawn if (( self. size ): msg = ( "Image size ( %s, %s ) was larger than window size " "( %s, %s ). image = image # call attributeSetter # check image size against window size print ( self. Use shaders if available by default, this is a # good thing self. units = units # call attributeSetter # call attributeSetter. _dict_ = win super ( SimpleImageStim, self ). """ def _init_ ( self, win, image = "", units = "", pos = ( 0.0, 0.0 ), flipHoriz = False, flipVert = False, name = None, autoLog = None ): """ """ # all doc is in the attributeSetter # what local vars are defined (these are the init params) for use by # _repr_ self. The slight advantage, however is that the stimulus will always be in its original aspect ratio, with no interplotation or other transformation, and it is slightly faster to load into PsychoPy. Drawing will also tend to be marginally slower, because the image isn't preloaded to the graphics card. Unlike the ImageStim, this type of stimulus cannot be rescaled, rotated or masked (although flipping horizontally or vertically is possible). class SimpleImageStim ( MinimalStim, WindowMixin ): """A simple stimulus for loading images from a file and presenting at exactly the resolution and color in the file (subject to gamma correction if set). import globalVars try : from PIL import Image except ImportError : from. gl import psychopy # so we can get the _path_ from psychopy import core, logging # tools must only be imported *after* event or MovieStim breaks on win32 # (JWP has no idea why!) from import val2array from import convertToPix from import setAttribute, attributeSetter from import pathToString from import MinimalStim, WindowMixin from. # Shaders will work but require OpenGL2.0 drivers AND PyOpenGå…ƒ.0+ import pyglet from. import os # Ensure setting pyglet.options to False is done prior to any # other calls to pyglet or pyglet submodules, otherwise it may not get picked # up by the pyglet GL engine and have no effect. # Distributed under the terms of the GNU General Public License (GPL). ![]() """ # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2022 Open Science Tools Ltd. #!/usr/bin/env python # -*- coding: utf-8 -*- """A simple stimulus for loading images from a file and presenting at exactly the resolution and color in the file (subject to gamma correction if set).
0 Comments
Leave a Reply. |