Esempio n. 1
0
	def initVisionEgg(self):
		'''
		'''
		
		# set the resolution and make it full screen
		VisionEgg.config.VISIONEGG_SCREEN_W = 1024	
		VisionEgg.config.VISIONEGG_SCREEN_H = 768
		VisionEgg.config.VISIONEGG_FULLSCREEN = 0# TODO 1

		# figure out the screen size and set the background color to grey
		self.screen = Core.get_default_screen()
		self.screen.parameters.bgcolor = BACKGROUND_COLOR 
		self.screen.clear()
		self.screenWidth, self.screenHeight = self.screen.size

		# add handler to shut the experiment down and
		# log all responses to date when escape is pressed
		# THIS MUST BE ADDED TO ALL EXPERIMENTS TO AVOID POSSIBILITY OF FREEZING YOUR PC
		self.addKeyHandler(EscapeKeyHandler(self))

		# if the user wants to use a fixation cross, then add that here
		if self.fixationCross:
			# add the fixation cross viewport
			self.addViewport(name=FIXATION_VIEWPORT)
Esempio n. 2
0
import VisionEgg as ve
ve.start_default_logging(); ve.watch_exceptions()

import VisionEgg.Core as vec
from VisionEgg.FlowControl import Presentation
import VisionEgg.Textures as vet

import Image, ImageDraw # Python Imaging Library (PIL)

import OpenGL.GL as gl # PyOpenGL

import os
import numpy # Numeric

screen = vec.get_default_screen()
texel_scale = 5

# create background texture from image file
bg_filename = os.path.join(ve.config.VISIONEGG_SYSTEM_DIR,"data","panorama.jpg")
bg_texture = vet.Texture(bg_filename)
bg = vet.TextureStimulus(texture = bg_texture,
                         size    = bg_texture.size,
                         shrink_texture_ok=False,
                         mipmaps_enabled=False,
                         )

# create alpha texture from numpy
numpy_size = (50,50,4)
numpy_data = numpy.ones(numpy_size,dtype=numpy.float)*1.0 # white
numpy_data[:,:,3] = numpy.random.uniform(0.0,1.0,size=(numpy_size[:2])) # random alpha
Esempio n. 3
0
import VisionEgg as ve
ve.start_default_logging()
ve.watch_exceptions()

import VisionEgg.Core as vec
from VisionEgg.FlowControl import Presentation
import VisionEgg.Textures as vet

import Image, ImageDraw  # Python Imaging Library (PIL)

import OpenGL.GL as gl  # PyOpenGL

import os
import numpy  # Numeric

screen = vec.get_default_screen()
texel_scale = 5

# create background texture from image file
bg_filename = os.path.join(ve.config.VISIONEGG_SYSTEM_DIR, "data",
                           "panorama.jpg")
bg_texture = vet.Texture(bg_filename)
bg = vet.TextureStimulus(
    texture=bg_texture,
    size=bg_texture.size,
    shrink_texture_ok=False,
    mipmaps_enabled=False,
)

# create alpha texture from numpy
numpy_size = (50, 50, 4)