VPNLirvine / trEYEcopa

Code for eyetracking the TriCOPA videos
2 stars 1 forks source link

Mirror video on-the-fly? #18

Open brandonhackney opened 7 months ago

brandonhackney commented 7 months ago

We want mirrored (i.e. horizontally-flipped) versions of each stimulus. We currently do this by having a mirrored and non-mirrored copy of each video, so we use twice as much space.

Is it possible to mirror the videos on-the-fly in Matlab? Using Psychtoolbox or even built-in functions? If so, does it appreciably impact performance?

brandonhackney commented 7 months ago

If you can dynamically resize a video by sending Screen('DrawTexture') a 4-element 'rectangle' vector, you can probably mirror the video by flipping the order of those elements.

e.g. if it's normally [0 0 1920 1080], try doing [1920 0 0 1080]

brandonhackney commented 7 months ago

Yes exactly as above - PTB rectangles are [leftX topY rightX bottomY], ie starting from top left corner and defining bottom right corner. If you reorder the coordinates to start from the top RIGHT and end at the bottom LEFT, you have mirrored the image horizontally. Now just need to ensure it doesn't implicitly reject such a vector.