Esempio n. 1
0
	def noise_patch(self, x, y, env=u"gaussian", size=96, stdev=12,
		col1=u"white", col2=u"black", bgmode=u"avg"):

		surface = canvas._noise_patch(env, size, stdev, col1, col2, bgmode)
		stim = stimuli._visual.Visual(position=self.to_xy((x,y)))
		stim._surface = surface
		self.add_stim(stim)
Esempio n. 2
0
    def prepare(self):

        self._stim = Visual(position=self.to_xy(self.x, self.y))
        self._stim.set_surface(
            canvas._noise_patch(self.env, self.size, self.stdev, self.col1,
                                self.col2, self.bgmode))
        self._stim.preload()
Esempio n. 3
0
    def noise_patch(self,
                    x,
                    y,
                    env=u"gaussian",
                    size=96,
                    stdev=12,
                    col1=u"white",
                    col2=u"black",
                    bgmode=u"avg"):

        surface = canvas._noise_patch(env, size, stdev, col1, col2, bgmode)
        x, y = self.to_xy(x, y)
        self.surface.blit(surface, (x - 0.5 * size, y - 0.5 * size))
Esempio n. 4
0
def noise_file(*arglist, **kwdict):
    """
	desc:
		Creates a temporary file containing a noise patch.

	argument-list:
		arglist:	See canvas.noise_path() for a description of arguments.

	keyword-dict:
		kwdict:		See canvas.noise_path() for a description of keywords.

	returns:
		A path to the image file.
	"""

    from openexp._canvas import canvas as _canvas
    surface = _canvas._noise_patch(*arglist, **kwdict)
    fd, fname = tempfile.mkstemp(suffix=u'.png')
    pygame.image.save(surface, fname)
    temp_files.append(fname)
    os.close(fd)
    return fname
Esempio n. 5
0
def noise_file(*arglist, **kwdict):
    """
	desc:
		Creates a temporary file containing a noise patch.

	argument-list:
		arglist:	See canvas.noise_path() for a description of arguments.

	keyword-dict:
		kwdict:		See canvas.noise_path() for a description of keywords.

	returns:
		A path to the image file.
	"""

    global temp_files
    from openexp._canvas import canvas
    surface = canvas._noise_patch(*arglist, **kwdict)
    tmp = tempfile.mkstemp(suffix='.png')[1]
    pygame.image.save(surface, tmp)
    temp_files.append(tmp)
    return tmp
Esempio n. 6
0
def noise_file(*arglist, **kwdict):

	"""
	desc:
		Creates a temporary file containing a noise patch.

	argument-list:
		arglist:	See canvas.noise_path() for a description of arguments.

	keyword-dict:
		kwdict:		See canvas.noise_path() for a description of keywords.

	returns:
		A path to the image file.
	"""

	global temp_files
	from openexp._canvas import canvas
	surface = canvas._noise_patch(*arglist, **kwdict)
	tmp = tempfile.mkstemp(suffix='.png')[1]
	pygame.image.save(surface, tmp)
	temp_files.append(tmp)
	return tmp
Esempio n. 7
0
def noise_file(*arglist, **kwdict):

    """
	desc:
		Creates a temporary file containing a noise patch.

	argument-list:
		arglist:	See canvas.noise_path() for a description of arguments.

	keyword-dict:
		kwdict:		See canvas.noise_path() for a description of keywords.

	returns:
		A path to the image file.
	"""

    from openexp._canvas import canvas as _canvas

    surface = _canvas._noise_patch(*arglist, **kwdict)
    fd, fname = tempfile.mkstemp(suffix=u".png")
    pygame.image.save(surface, fname)
    temp_files.append(fname)
    os.close(fd)
    return fname
Esempio n. 8
0
    def noise_patch(self, x, y, env=u"gaussian", size=96, stdev=12, col1=u"white", col2=u"black", bgmode=u"avg"):

        surface = canvas._noise_patch(env, size, stdev, col1, col2, bgmode)
        x, y = self.to_xy(x, y)
        self.surface.blit(surface, (x - 0.5 * size, y - 0.5 * size))
Esempio n. 9
0
    def prepare(self):

        surface = canvas._noise_patch(self.env, self.size, self.stdev,
                                      self.col1, self.col2, self.bgmode)
        x, y = self.to_xy(self.x, self.y)
        self.surface.blit(surface, (x - 0.5 * self.size, y - 0.5 * self.size))