Ejemplo n.º 1
0
 def test_flip(self):
     good = TextStim(self.win, text='a', pos=(.5,.5))
     b = BufferImageStim(self.win, stim=[good])
     b.setFlipHoriz(True)
     assert b.flipHoriz == True
     b.setFlipVert(True)
     assert b.flipVert == True
Ejemplo n.º 2
0
 def test_init(self):
     for win in [self.win, self.winpix]:
         b = BufferImageStim(win, autoLog=False)
         good = TextStim(win, text='a', autoLog=False)
         badWin = TextStim(self.winpix, text='a', autoLog=False)
         stim = [good, badWin]
         rect = [-.5, .5, .5, -.5]
         for interp in [True, False]:
             b = BufferImageStim(win,
                                 stim=stim,
                                 interpolate=interp,
                                 autoLog=False)
             b.draw()
             b = BufferImageStim(win,
                                 stim=stim,
                                 interpolate=interp,
                                 rect=rect,
                                 autoLog=False)
             b.draw()
Ejemplo n.º 3
0
 def test_flip(self):
     good = TextStim(self.win, text='a', pos=(.5, .5), autoLog=False)
     b = BufferImageStim(self.win, stim=[good], autoLog=False)
     b.setFlipHoriz(True)
     assert b.flipHoriz == True
     b.setFlipVert(True)
     assert b.flipVert == True
Ejemplo n.º 4
0
 def test_init(self):
     for win in [self.win, self.winpygame]:
         b = BufferImageStim(win)
         good = TextStim(win, text='a')
         badWin = TextStim(self.winpix, text='a')
         stim = [good, badWin]
         rect = [-.5,.5,.5,-.5]
         for interp in [True, False]:
             b = BufferImageStim(win, stim=stim, interpolate=interp)
             b.draw()
             b = BufferImageStim(win, stim=stim, interpolate=interp, rect=rect)
             b.draw()
Ejemplo n.º 5
0
    def test_glversion(self):
        v = pyglet.gl.gl_info.get_version
        pyglet.gl.gl_info.get_version = lambda: '0.0'
        b = BufferImageStim(self.win, sqPower2=False, autoLog=False)

        pyglet.gl.gl_info.get_version = v
Ejemplo n.º 6
0
 def test_nonSqrPow2(self):
     b = BufferImageStim(self.win, sqPower2=True, autoLog=False)
     assert b.size[0] == b.size[1]
     assert b.size[
         0] == self.win.size[0] / 128. / 2 == self.win.size[1] / 128. / 4