Psychtoolbox - Filloval

1.2k views Asked by At

I am new to Matlab and Psychtoolbox. I need to change color saturation. When creating a circle Screen('FillOval',window, is there a way of getting a handler to the Oval object and is it rendered as image? Thanks in advance

1

There are 1 answers

0
Kirsten A. On

Unfortunately, (as far as I know) the FillOval function doesn't create a handle like you would be used to with matlab figures / patches. The best way to change the color is simply with the RGB index argument.

If you forget the arguments that belong in Psychtoolbox functions, type the name with a question mark to see the help file. In this case, type this in the command line:

Screen('FillOval?') 

The arguments are:

Screen('FillOval', windowPtr [,color] [,rect] [,perfectUpToMaxDiameter]);

If i wanted to change the saturation, I would just redraw the Oval and change the RGB values I filled into the Fill Oval function. e.g. put in [255,0,0] on the first flip and [255,50,50] on the second.

It kind of sounds like you may want to opt for the "MakeTexture" and "DrawTexture" functions. With this function, you can take any image matrix and transform it into a texture handle with "MakeTexture". With "DrawTexture" you can then draw the image into the psych toolbox window. DrawTexture is nice, because it allows you to easily change the opacity of the texture.

I recommend exploring the help functions to learn more about this option.