~ubuntu-branches/ubuntu/trusty/psychtoolbox-3/trusty-proposed

« back to all changes in this revision

Viewing changes to Psychtoolbox/PsychGLImageProcessing/private/manual_calibrate.m

  • Committer: Package Import Robot
  • Author(s): Yaroslav Halchenko
  • Date: 2013-11-19 23:34:50 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20131119233450-f7nf92vb8qavjmk8
Tags: 3.0.11.20131017.dfsg1-3
Upload to unsable since fresh glew has arrived to sid!

Show diffs side-by-side

added added

removed removed

Lines of Context:
192
192
        % top-left
193
193
        dots(:,1) = centeredDots(:,1) + xmid*ones(nDots,1);
194
194
        dots(:,2) = centeredDots(:,2) + ymid*ones(nDots,1);
195
 
 
196
 
        % Fill to black
197
 
        Screen('FillRect', scal.windowPtr, colorBlack);
198
 
 
199
 
        % Reference texture assigned to draw as backdrop?
200
 
        if isfield(scal, 'refTex')
201
 
            % Seems so. Double-check and draw it, if ok:
202
 
            if scal.refTex
203
 
                Screen('DrawTexture', scal.windowPtr, scal.refTex, [], Screen('Rect', scal.refTex));
204
 
            end
205
 
        end
206
195
        
207
 
        % Update dot diameters
208
 
        % Set all dots to default diameter
209
 
        dotDiamArray = [];
210
 
        dotDiamArray = zeros(size(dots,1), 1) + dotDiam;
211
 
        xGlobalCalibDots = size(scal.XCALIBDOTS, 1);
212
 
        xCurrDots = size(dots, 1);
213
 
        if xGlobalCalibDots ~= dots
214
 
            % Adjusting fitting dots, a center dot may not be selected.
215
 
            %  Draw a crosshair at the center instead.
216
 
            %bvlDrawCrosshair(windowPtr, x, y [,size] [,color])
217
 
            bvlDrawCrosshair(scal.windowPtr, xmax, ymax, selectedDotDiam * 2, dotColor);
218
 
        else
219
 
            % Make the center dot larger so user can line up with screen
220
 
            % center.
221
 
            indexCenterDot = round(length(dots(:,1)) / 2);
222
 
            dotDiamArray(indexCenterDot) = selectedDotDiam;
223
 
        end
224
 
 
225
 
 
226
 
        % Draw dots
227
 
        Screen('DrawDots', scal.windowPtr, transpose(dots), dotDiamArray, dotColor, [0 0], dotStyle);
228
 
       % HideCursor; 
229
 
 
230
 
        % Show help text if requested:
231
 
        if fShowHelptext
232
 
            helptxt = ['GLOBAL MODE:\nFinish calibration by pressing ESCape key\nToggle help text by pressing SPACE key\nChange selected global parameters via Cursor arrow keys\n' ...
233
 
                'Select global parameter change mode via right mouse button\nChange parameter step size via middle mouse button\n' ...
234
 
                'Switch to local adjustment mode via left mouse button.\n'];            
235
 
            DrawFormattedText(scal.windowPtr, helptxt, 30, 30, [255 255 0]);
236
 
        end
237
 
       
 
196
        % Loop across stereo buffers
 
197
        for view = 0:sign(scal.stereoMode)
 
198
            Screen('SelectStereoDrawbuffer', scal.windowPtr, view);
 
199
            
 
200
            % Fill to black
 
201
            Screen('FillRect', scal.windowPtr, colorBlack);
 
202
            
 
203
            % Reference texture assigned to draw as backdrop?
 
204
            if isfield(scal, 'refTex')
 
205
                % Seems so. Double-check and draw it, if ok:
 
206
                if scal.refTex
 
207
                    Screen('DrawTexture', scal.windowPtr, scal.refTex, [], Screen('Rect', scal.refTex));
 
208
                end
 
209
            end
 
210
            
 
211
            % Update dot diameters
 
212
            % Set all dots to default diameter
 
213
            dotDiamArray = [];
 
214
            dotDiamArray = zeros(size(dots,1), 1) + dotDiam;
 
215
            xGlobalCalibDots = size(scal.XCALIBDOTS, 1);
 
216
            xCurrDots = size(dots, 1);
 
217
            if xGlobalCalibDots ~= dots
 
218
                % Adjusting fitting dots, a center dot may not be selected.
 
219
                %  Draw a crosshair at the center instead.
 
220
                %bvlDrawCrosshair(windowPtr, x, y [,size] [,color])
 
221
                bvlDrawCrosshair(scal.windowPtr, xmax, ymax, selectedDotDiam * 2, dotColor);
 
222
            else
 
223
                % Make the center dot larger so user can line up with screen
 
224
                % center.
 
225
                indexCenterDot = round(length(dots(:,1)) / 2);
 
226
                dotDiamArray(indexCenterDot) = selectedDotDiam;
 
227
            end
 
228
            
 
229
            
 
230
            % Draw dots
 
231
            Screen('DrawDots', scal.windowPtr, transpose(dots), dotDiamArray, dotColor, [0 0], dotStyle);
 
232
            % HideCursor;
 
233
            
 
234
            % Show help text if requested:
 
235
            if fShowHelptext
 
236
                helptxt = ['GLOBAL MODE:\nFinish calibration by pressing ESCape key\nToggle help text by pressing SPACE key\nChange selected global parameters via Cursor arrow keys\n' ...
 
237
                    'Select global parameter change mode via right mouse button\nChange parameter step size via middle mouse button\n' ...
 
238
                    'Switch to local adjustment mode via left mouse button.\n'];
 
239
                DrawFormattedText(scal.windowPtr, helptxt, 30, 30, [255 255 0]);
 
240
            end
 
241
        end
238
242
 
239
243
        % Check for input
240
244
        if bMiddleMouseDown || bRightMouseDown