• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PsychCapNumInputArgs函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中PsychCapNumInputArgs函数的典型用法代码示例。如果您正苦于以下问题:C++ PsychCapNumInputArgs函数的具体用法?C++ PsychCapNumInputArgs怎么用?C++ PsychCapNumInputArgs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了PsychCapNumInputArgs函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: FONTSFonts

PsychError FONTSFonts(void) 
{
    PsychGenericScriptType 	*nativeStructArray;
    int				arrayIndex, numFonts;
    PsychFontStructType		**fontPointerList, *fontElement;
    
    //all sub functions should have these two lines
    PsychPushHelp(useString, synopsisString, seeAlsoString);
    if(PsychIsGiveHelp()){PsychGiveHelp();return(PsychError_none);};

    //check for  required and superfluous arguments
    PsychErrorExit(PsychCapNumOutputArgs(1));
    PsychErrorExit(PsychCapNumInputArgs(0));
        
    //build a list of pointers to all the the font records in the font list, then hand the list of pointers to PsychCopyFontRecordsToNativeStructArray()
    //to get a native struct array of font records and return it to the scripting environment.
    arrayIndex=0;
    numFonts=PsychGetFontListLength();
    fontPointerList=(PsychFontStructType**)malloc(numFonts * sizeof(PsychFontStructType*));
    for(fontElement=PsychGetFontListHead();fontElement;fontElement=fontElement->next)
        fontPointerList[arrayIndex++]=fontElement;
    PsychCopyFontRecordsToNativeStructArray(numFonts, fontPointerList, &nativeStructArray);  
    free((void*)fontPointerList);
    PsychAssignOutStructArray(1, FALSE, nativeStructArray);
    
    return(PsychError_none);	
}
开发者ID:BackupTheBerlios,项目名称:osxptb-svn,代码行数:27,代码来源:FONTSFonts.c


示例2: SCREENCloseMovie

PsychError SCREENCloseMovie(void)
{
    int moviehandle = -1;
    
    // All sub functions should have these two lines
    PsychPushHelp(useString, synopsisString, seeAlsoString);
    if(PsychIsGiveHelp()) {PsychGiveHelp(); return(PsychError_none);};
    
    PsychErrorExit(PsychCapNumInputArgs(1));            // Max. 1 input args.
    PsychErrorExit(PsychRequireNumInputArgs(1));        // Min. 1 input args required.
    PsychErrorExit(PsychCapNumOutputArgs(0));           // No output args.
    
    // Get the window record from the window record argument and get info from the window record
    //PsychAllocInWindowRecordArg(kPsychUseDefaultArgPosition, TRUE, &windowRecord);
    
    // Get the movie handle:
    PsychCopyInIntegerArg(1, TRUE, &moviehandle);
    if (moviehandle==-1) {
        PsychErrorExitMsg(PsychError_user, "CloseMovie called without valid handle to a movie object.");
    }
    
    // Try to delete the movie object, releasing all associated ressources:
    PsychDeleteMovie(moviehandle);
    
    return(PsychError_none);
}
开发者ID:AlanFreeman,项目名称:Psychtoolbox-3,代码行数:26,代码来源:SCREENCloseMovie.c


示例3: PSYCHHIDGiveMeReports

PsychError PSYCHHIDGiveMeReports(void)
{
    PsychGenericScriptType *outErr;
    const char *fieldNames[] = {"n", "name", "description"};

    char *name = "", *description = "";
    long error = 0;
    int deviceIndex;
    int reportBytes = 1024;

    PsychPushHelp(useString,synopsisString,seeAlsoString);
    if (PsychIsGiveHelp()) { PsychGiveHelp(); return(PsychError_none); };

    PsychErrorExit(PsychCapNumOutputArgs(2));
    PsychErrorExit(PsychCapNumInputArgs(2));

    PsychCopyInIntegerArg(1,TRUE,&deviceIndex);
    PsychCopyInIntegerArg(2,false,&reportBytes);

    PsychHIDVerifyInit();

    // Returns 1st return argument 'reports':
    error = GiveMeReports(deviceIndex,reportBytes); // PsychHIDReceiveReports.c

    // Return 2nd return argument 'err' struct:
    PsychHIDErrors(NULL, error, &name, &description);
    PsychAllocOutStructArray(2, kPsychArgOptional, -1, 3, fieldNames, &outErr);
    PsychSetStructArrayStringElement("name", 0, name, outErr);
    PsychSetStructArrayStringElement("description", 0, description, outErr);
    PsychSetStructArrayDoubleElement("n", 0, (double) error, outErr);

    return(PsychError_none);
}
开发者ID:Psychtoolbox-3,项目名称:Psychtoolbox-3,代码行数:33,代码来源:PsychHIDGiveMeReports.c


示例4: PSYCHHIDKbCheck

PsychError PSYCHHIDKbCheck(void) 
{
    int					deviceIndex;
    int					m, n, p;
    double				*scanList = NULL;
    psych_bool                          isDeviceSpecified;

    PsychPushHelp(useString, synopsisString, seeAlsoString);
    if(PsychIsGiveHelp()){PsychGiveHelp();return(PsychError_none);};

    PsychErrorExit(PsychCapNumOutputArgs(3));
    PsychErrorExit(PsychCapNumInputArgs(2));
	
    // Choose the device index and its record
    isDeviceSpecified=PsychCopyInIntegerArg(1, FALSE, &deviceIndex);
    if (!isDeviceSpecified) {
        // set the keyboard or keypad device to be the first keyboard device or, if no keyboard, the first keypad
        deviceIndex = INT_MAX;
    }

    // Optional 2nd argument 'scanlist' provided?
    if (PsychAllocInDoubleMatArg(2, FALSE, &m, &n, &p, &scanList)) {
        // Yep. Matching size?
        if (p!=1 || m * n != 256) PsychErrorExitMsg(PsychError_user, "Provided 'scanList' parameter is not a vector of 256 doubles, as required!");
    }

    return(PsychHIDOSKbCheck(deviceIndex, scanList));
}
开发者ID:AlanFreeman,项目名称:Psychtoolbox-3,代码行数:28,代码来源:PsychHIDKbCheck.c


示例5: SCREENTexturizeOffscreenWindows

PsychError SCREENTexturizeOffscreenWindows(void) 
{
	PsychWindowRecordType	**windowRecordArray;
	int						i, numWindows; 

    
    //all subfunctions should have these two lines.  
    PsychPushHelp(useString, synopsisString, seeAlsoString);
    if(PsychIsGiveHelp()){PsychGiveHelp();return(PsychError_none);};
	
	//check for superfluous or missing arguments
	PsychErrorExit(PsychCapNumInputArgs(0));   	
    PsychErrorExit(PsychRequireNumInputArgs(0)); 	

   	PsychCreateVolatileWindowRecordPointerList(&numWindows, &windowRecordArray);
	for(i=0;i<numWindows;i++){
			if(PsychIsOffscreenWindow(windowRecordArray[i])){
				PsychUpdateTargetWindowFromTargetDisplay(windowRecordArray[i]);
				PsychAllocateTexture(windowRecordArray[i]);
				PsychBindTexture(windowRecordArray[i]);
				PsychUpdateTexture(windowRecordArray[i]);
			}
	}
	PsychDestroyVolatileWindowRecordPointerList(windowRecordArray);

	
    return(PsychError_none);

}
开发者ID:BackupTheBerlios,项目名称:osxptb-svn,代码行数:29,代码来源:SCREENTexturizeOffscreenWindowsOld.c


示例6: SCREENglLoadIdentity

PsychError SCREENglLoadIdentity(void)  
{
    // If you change useString then also change the corresponding synopsis string in ScreenSynopsis.c
    static char useString[] = "Screen('glLoadIdentity', windowPtr);";
    static char synopsisString[] = "Reset an OpenGL matrix to its default identity setting. "
        "See <http://www.opengl.org/documentation/red_book_1.0/> Chapter 4 for detailed information.";
    static char seeAlsoString[] = "";	
    
    PsychWindowRecordType	*windowRecord;
    
    //all sub functions should have these two lines
    PsychPushHelp(useString, synopsisString,seeAlsoString);
    if(PsychIsGiveHelp()){PsychGiveHelp();return(PsychError_none);};
    
    //check for superfluous arguments
    PsychErrorExit(PsychCapNumInputArgs(1));        // The maximum number of inputs
    PsychErrorExit(PsychRequireNumInputArgs(1)); 	// Number of required inputs.
    PsychErrorExit(PsychCapNumOutputArgs(0));       // The maximum number of outputs
    
    //get the window record from the window record argument and get info from the window record
    PsychAllocInWindowRecordArg(kPsychUseDefaultArgPosition, TRUE, &windowRecord);
    
    // Switch to windows OpenGL context:
    PsychSetGLContext(windowRecord); 
    // Execute it:
    glLoadIdentity();
    
    PsychTestForGLErrors();
    
    //All psychfunctions require this.
    return(PsychError_none);
}
开发者ID:AlanFreeman,项目名称:Psychtoolbox-3,代码行数:32,代码来源:SCREENglMatrixFunctionWrappers.c


示例7: SCREENFinalizeMovie

PsychError SCREENFinalizeMovie(void)
{
    static char useString[] = "Screen('FinalizeMovie', moviePtr);";
    static char synopsisString[] = "Finish creating a new movie file with handle 'moviePtr' and store it to filesystem.\n";
    static char seeAlsoString[] = "CreateMovie AddFrameToMovie CloseMovie PlayMovie GetMovieImage GetMovieTimeIndex SetMovieTimeIndex";

    int moviehandle = -1;

    // All sub functions should have these two lines
    PsychPushHelp(useString, synopsisString, seeAlsoString);
    if(PsychIsGiveHelp()) {PsychGiveHelp(); return(PsychError_none);};

    PsychErrorExit(PsychCapNumInputArgs(1));            // Max. 3 input args.
    PsychErrorExit(PsychRequireNumInputArgs(1));        // Min. 2 input args required.
    PsychErrorExit(PsychCapNumOutputArgs(0));           // Max. 1 output args.

    // Get the moviehandle:
    PsychCopyInIntegerArg(1, kPsychArgRequired, &moviehandle);

    // Finalize the movie:
    if (!PsychFinalizeNewMovieFile(moviehandle)) {
        PsychErrorExitMsg(PsychError_user, "FinalizeMovie failed for reason mentioned above.");
    }

    return(PsychError_none);
}
开发者ID:Psychtoolbox-3,项目名称:Psychtoolbox-3,代码行数:26,代码来源:SCREENOpenMovie.c


示例8: GESTALTGestalt

PsychError GESTALTGestalt(void) 
{
	char					*selectorCString;
	OSType					selectorConstant;
	CFStringRef				selectorCFString;
	OSErr					callError;
	long					responseLong, i;
	PsychNativeBooleanType	*responseArray;
	psych_bool					returnResponse;

    PsychErrorExit(PsychCapNumOutputArgs(1));
    PsychErrorExit(PsychCapNumInputArgs(1));
	
    PsychAllocInCharArg(1, kPsychArgRequired, &selectorCString);
	if( strlen(selectorCString) != 4)
		PsychErrorExitMsg(PsychError_user, "The selector code must be a four-character string");
	selectorCFString=CFStringCreateWithCString (NULL, selectorCString, kCFStringEncodingUTF8);
	selectorConstant= UTGetOSTypeFromString(selectorCFString); 
	callError= Gestalt(selectorConstant, &responseLong);
	CFRelease(selectorCFString);
	if(callError)
		PsychCopyOutDoubleArg(1, kPsychArgOptional, (double)callError);
	else{
		returnResponse=PsychAllocOutBooleanMatArg(1, kPsychArgOptional, 1, 32, 1, &responseArray);
		if(returnResponse){
			for(i=0;i<32;i++){
				if(1<<i & responseLong) 
					responseArray[31-i]=TRUE;
				else
					responseArray[31-i]=FALSE;
			}
		}
	}
    return(PsychError_none);	
}
开发者ID:BackupTheBerlios,项目名称:osxptb-svn,代码行数:35,代码来源:Gestalt.c


示例9: SCREENPixelSize

PsychError SCREENPixelSize(void) 
{
    int 			screenNumber;
    double 			depth;
    PsychWindowRecordType	*windowRecord; 
    
    //all sub functions should have these two lines
    PsychPushHelp(useString, synopsisString, seeAlsoString);
    if(PsychIsGiveHelp()){PsychGiveHelp();return(PsychError_none);};

    //check to see if the user supplied superfluous arguments
    PsychErrorExit(PsychCapNumOutputArgs(1));
    PsychErrorExit(PsychCapNumInputArgs(1));
    
    //get specified screen number.
    if(PsychIsScreenNumberArg(1)){    
        PsychCopyInScreenNumberArg(1, TRUE, &screenNumber);
        depth=(double)PsychGetScreenDepthValue(screenNumber);
    }else if(PsychIsWindowIndexArg(1)){
        PsychAllocInWindowRecordArg(1,TRUE,&windowRecord);
        depth=(double)windowRecord->depth;
    }else
        PsychErrorExit(PsychError_invalidNumdex);
        
    //Allocate a return matrix and load it with the depth values.  
    PsychCopyOutDoubleArg(1, FALSE, depth);
    
    return(PsychError_none);	
}
开发者ID:BackupTheBerlios,项目名称:osxptb-svn,代码行数:29,代码来源:SCREENPixelSize.c


示例10: EyelinkGetTrackerVersion

PsychError EyelinkGetTrackerVersion(void)
{
	int iVersion=0;
	char strVersion[40]="unknown tracker type";
	
	//all sub functions should have these two lines
	PsychPushHelp(useString, synopsisString, seeAlsoString);
	if(PsychIsGiveHelp()){PsychGiveHelp();return(PsychError_none);};
	
	//check to see if the user supplied superfluous arguments
	PsychErrorExit(PsychCapNumInputArgs(0));
	PsychErrorExit(PsychRequireNumInputArgs(0));
	PsychErrorExit(PsychCapNumOutputArgs(2));
	
//	// Verify eyelink is up and running
//	EyelinkSystemIsConnected();
//	EyelinkSystemIsInitialized();
	
	iVersion = eyelink_get_tracker_version(strVersion);
	
	//   mexPrintf("Tracker Version: '%s'\n", strVersion );
	PsychCopyOutDoubleArg(1, TRUE, iVersion);
	PsychCopyOutCharArg(2, FALSE, strVersion);
	
	return(PsychError_none);	
}
开发者ID:AlanFreeman,项目名称:Psychtoolbox-3,代码行数:26,代码来源:EyelinkGetTrackerVersion.c


示例11: SCREENSetMouseHelper

PsychError SCREENSetMouseHelper(void)
{
    int	screenNumber;
    int xPos, yPos;
    int deviceIdx = -1;
    int detachFromMouse = 0;

    //all subfunctions should have these two lines.
    PsychPushHelp(useString, synopsisString, seeAlsoString);
    if(PsychIsGiveHelp()){PsychGiveHelp();return(PsychError_none);};

    PsychErrorExit(PsychCapNumInputArgs(5));   //The maximum number of inputs
    PsychErrorExit(PsychCapNumOutputArgs(0));  //The maximum number of outputs

    PsychCopyInScreenNumberArg(1, TRUE, &screenNumber);
    PsychCopyInIntegerArg(2,TRUE, &xPos);
    PsychCopyInIntegerArg(3,TRUE, &yPos);
    PsychCopyInIntegerArg(4,FALSE, &deviceIdx);
    PsychCopyInIntegerArg(5,FALSE, &detachFromMouse);

    // Position the cursor. On OSX this will also automatically attach it
    // to mouse movement:
    PsychPositionCursor(screenNumber, xPos, yPos, deviceIdx);

    #if PSYCH_SYSTEM == PSYCH_OSX
        if (detachFromMouse) CGAssociateMouseAndMouseCursorPosition(false);
    #endif

    return(PsychError_none);
}
开发者ID:ChiNasa511,项目名称:Psychtoolbox-3,代码行数:30,代码来源:SCREENSetMouseHelper.c


示例12: PSYCHHIDKbTriggerWait

PsychError PSYCHHIDKbTriggerWait(void) 
{
    int	deviceIndex;
    int numScankeys;
    int* scanKeys;
    
    PsychPushHelp(useString, synopsisString, seeAlsoString);
    if(PsychIsGiveHelp()){PsychGiveHelp();return(PsychError_none);};

    PsychErrorExit(PsychCapNumOutputArgs(1));
    PsychErrorExit(PsychCapNumInputArgs(2));  	//Specify trigger key code and the deviceNumber of the keyboard or keypad to scan.  

	// Identify the mandatory trigger array:
    if (!PsychAllocInIntegerListArg(1, TRUE, &numScankeys, &scanKeys)){
        PsychErrorExitMsg(PsychError_user, "Keycode is required.");
    }
	
    // Get optional deviceIndex:
    if (!PsychCopyInIntegerArg(2, FALSE, &deviceIndex)) deviceIndex = -1;

    // Execute:
    PsychHIDOSKbTriggerWait(deviceIndex, numScankeys, scanKeys);

    return(PsychError_none);
}
开发者ID:Epixoft,项目名称:Psychtoolbox-3,代码行数:25,代码来源:PsychHIDKbTriggerWait.c


示例13: EyelinkCurrentMode

PsychError EyelinkCurrentMode(void)
{
	int		iMode	= 0;
	
	// Add help strings
	PsychPushHelp(useString, synopsisString, seeAlsoString);
	
	// Output help if asked
	if(PsychIsGiveHelp()) {
		PsychGiveHelp();
		return(PsychError_none);
	}
	
	// Check arguments
	PsychErrorExit(PsychCapNumInputArgs(0));
	PsychErrorExit(PsychRequireNumInputArgs(0));
	PsychErrorExit(PsychCapNumOutputArgs(1));    

	// Verify eyelink is up and running
	EyelinkSystemIsConnected();
	EyelinkSystemIsInitialized();
	
	iMode = eyelink_current_mode();
	
	// Assign output arg
	PsychCopyOutDoubleArg(1, TRUE, iMode);
	
	return(PsychError_none);
}
开发者ID:AlanFreeman,项目名称:Psychtoolbox-3,代码行数:29,代码来源:EyelinkCurrentMode.c


示例14: IOPORTVerbosity

PsychError IOPORTVerbosity(void)
{
 	static char useString[] = "oldlevel = IOPort('Verbosity' [,level]);";
	static char synopsisString[] = 
		"Set level of verbosity for error/warning/status messages. 'level' optional, new level "
		"of verbosity. 'oldlevel' is the old level of verbosity. The following levels are "
		"supported: 0 = Shut up. 1 = Print errors, 2 = Print also warnings, 3 = Print also some info, "
		"4 = Print more useful info (default), >5 = Be very verbose (mostly for debugging the driver itself). ";		
	static char seeAlsoString[] = "";	 
	
	int level= -1;

	// Setup online help: 
	PsychPushHelp(useString, synopsisString, seeAlsoString);
	if(PsychIsGiveHelp()) {PsychGiveHelp(); return(PsychError_none); };
	
	PsychErrorExit(PsychCapNumInputArgs(1));     // The maximum number of inputs
	PsychErrorExit(PsychRequireNumInputArgs(0)); // The required number of inputs	
	PsychErrorExit(PsychCapNumOutputArgs(1));	 // The maximum number of outputs

	PsychCopyInIntegerArg(1, kPsychArgOptional, &level);
	if (level < -1) PsychErrorExitMsg(PsychError_user, "Invalid level of verbosity provided. Valid are levels of zero and greater.");
	
	// Return current/old level:
	PsychCopyOutDoubleArg(1, kPsychArgOptional, (double) verbosity);

	// Set new level, if one was provided:
	if (level > -1) verbosity = level;

	return(PsychError_none);
}
开发者ID:BackupTheBerlios,项目名称:osxptb-svn,代码行数:31,代码来源:IOPort.c


示例15: IOPORTClose

// Close given port.
PsychError IOPORTClose(void)
{
 	static char useString[] = "IOPort('Close', handle);";
	static char synopsisString[] = 
		"Close a I/O port device 'handle'. This works for all device types.\n";
	static char seeAlsoString[] = "'CloseAll'";	 
  	
	int handle;
	
	// Setup online help: 
	PsychPushHelp(useString, synopsisString, seeAlsoString);
	if(PsychIsGiveHelp()) {PsychGiveHelp(); return(PsychError_none); };
	
	PsychErrorExit(PsychCapNumInputArgs(1));     // The maximum number of inputs
	PsychErrorExit(PsychRequireNumInputArgs(1)); // The required number of inputs	
	PsychErrorExit(PsychCapNumOutputArgs(0));	 // The maximum number of outputs

	// Get handle:
	PsychCopyInIntegerArg(1, kPsychArgRequired, &handle);

	// Close associated port:
	PsychCloseIOPort(handle);
	
    return(PsychError_none);	
}
开发者ID:BackupTheBerlios,项目名称:osxptb-svn,代码行数:26,代码来源:IOPort.c


示例16: IOPORTConfigureSerialPort

// Open a serial port on a serial port device:
PsychError IOPORTConfigureSerialPort(void)
{
 	static char useString[] = "IOPort('ConfigureSerialPort', handle, configString);";
	static char synopsisString[] = 
		"(Re-)Configure a serial port device, specified by 'handle'.\n"
		"The string 'configString' is a string with pairs of paramName=paramValue "
		"tokens, separated by a delimiter, e.g., a space. It allows to specify specific "
		"values 'paramValue' to specific serial port parameters 'paramName'. Not all "
		"parameters are supported by all operating systems, and all settings have reasonable "
		"defaults. Settings unknown to a specific operating system are ignored.\n\n"
		"See the help of 'OpenSerialPort' for possible settings.";
		
	static char seeAlsoString[] = "'OpenSerialPort'";
	char* configString = NULL;
	PsychSerialDeviceRecord* device = NULL;
	int handle;
	
	// Setup online help: 
	PsychPushHelp(useString, synopsisString, seeAlsoString);
	if(PsychIsGiveHelp()) {PsychGiveHelp(); return(PsychError_none); };
	
	PsychErrorExit(PsychCapNumInputArgs(2));     // The maximum number of inputs
	PsychErrorExit(PsychRequireNumInputArgs(2)); // The required number of inputs	
	PsychErrorExit(PsychCapNumOutputArgs(0));	 // The maximum number of outputs

	// Get required portSpec:
	PsychCopyInIntegerArg(1, kPsychArgRequired, &handle);
	
	// Get the configString:
	PsychAllocInCharArg(2, kPsychArgRequired, &configString);
	
	// Return return value of configuration call:
	return(PsychIOOSConfigureSerialPort(PsychGetPortIORecord(handle)->device, configString));
}
开发者ID:BackupTheBerlios,项目名称:osxptb-svn,代码行数:35,代码来源:IOPort.c


示例17: SCREENFrameArc

PsychError SCREENFrameArc(void)
{
    // If you change useString then also change the corresponding synopsis string in ScreenSynopsis.c
    static char useString[] = "Screen('FrameArc',windowPtr,[color],[rect],startAngle,arcAngle, [penWidth], [penHeight], [penMode])";
    //                                          1         2       3      4          5           6           7           8
    static char synopsisString[] = 
        "Draw an arc inscribed within the rect. 'color' is the clut index (scalar "
        "or [r g b] triplet) that you want to poke into each pixel; default produces "
        "black with the standard CLUT for this window's pixelSize. Default 'rect' is "
        "entire window. Angles are measured clockwise from vertical. 'penWidth' and "
        "'penHeight' are the width and height of the pen to use. On OS-X, penWidth must "
        "equal penHeight and the 'penMode' argument is currently ignored.";
    static char seeAlsoString[] = "DrawArc FillArc";	
    
    //all sub functions should have these two lines
    PsychPushHelp(useString, synopsisString,seeAlsoString);
    if(PsychIsGiveHelp()){PsychGiveHelp();return(PsychError_none);};
    
    //check for superfluous arguments
    PsychErrorExit(PsychCapNumInputArgs(8));        //The maximum number of inputs
    PsychErrorExit(PsychRequireNumInputArgs(3));    //The minimum number of inputs
    PsychErrorExit(PsychCapNumOutputArgs(0));       //The maximum number of outputs
    
    // Render arc of type 2 - Just the outline with penWidth.
    PsychRenderArc(2);
    
    return(PsychError_none);
}
开发者ID:BackupTheBerlios,项目名称:osxptb-svn,代码行数:28,代码来源:SCREENFillArc.c


示例18: SCREENFillArc

PsychError SCREENFillArc(void)  
{	
        // If you change useString then also change the corresponding synopsis string in ScreenSynopsis.c
        static char useString[] = "Screen('FillArc',windowPtr,[color],[rect],startAngle,arcAngle)";
        //                                          1         2       3      4          5
        static char synopsisString[] = 
            "Draw a filled arc inscribed within the rect. 'color' is the clut index (scalar "
            "or [r g b a] triplet) that you want to poke into each pixel; default produces "
            "black with the standard CLUT for this window's pixelSize. Default 'rect' is "
            "entire window. Angles are measured clockwise from vertical.";
        static char seeAlsoString[] = "DrawArc FrameArc";	

	//all sub functions should have these two lines
	PsychPushHelp(useString, synopsisString,seeAlsoString);
	if(PsychIsGiveHelp()){PsychGiveHelp();return(PsychError_none);};
	
	//check for superfluous arguments
	PsychErrorExit(PsychCapNumInputArgs(5));        //The maximum number of inputs
        PsychErrorExit(PsychRequireNumInputArgs(3));    //The minimum number of inputs
	PsychErrorExit(PsychCapNumOutputArgs(0));       //The maximum number of outputs

        // Render arc of type 3 - Filled arc.
        PsychRenderArc(3);

        return(PsychError_none);
}
开发者ID:BackupTheBerlios,项目名称:osxptb-svn,代码行数:26,代码来源:SCREENFillArc.c


示例19: SCREENStopVideoCapture

PsychError SCREENStopVideoCapture(void) 
{
    int capturehandle = -1;
    int dropped;
    
    // All sub functions should have these two lines
    PsychPushHelp(useString, synopsisString, seeAlsoString);
    if(PsychIsGiveHelp()) {PsychGiveHelp(); return(PsychError_none);};
    PsychErrorExit(PsychCapNumInputArgs(1));            // Max. 1 input args.
    PsychErrorExit(PsychRequireNumInputArgs(1));        // Min. 1 input args required.
    PsychErrorExit(PsychCapNumOutputArgs(1));           // One output arg.
    
    // Get the handle:
    PsychCopyInIntegerArg(1, TRUE, &capturehandle);
    if (capturehandle==-1) {
        PsychErrorExitMsg(PsychError_user, "StopVideoCapture called without valid handle to a capture object.");
    }
    
    // Try to stop capture:
    dropped = PsychVideoCaptureRate(capturehandle, 0, 0, NULL);

    PsychCopyOutDoubleArg(1, FALSE, dropped);
    
    // Ready!    
    return(PsychError_none);
}
开发者ID:BackupTheBerlios,项目名称:osxptb-svn,代码行数:26,代码来源:SCREENStopVideoCapture.c


示例20: SCREENGetOpenGLDrawMode

PsychError SCREENGetOpenGLDrawMode(void)
{
    static char useString[] = "[targetwindow, IsOpenGLRendering] = Screen('GetOpenGLDrawMode');";
    static char synopsisString[] = "Return information about current OpenGL rendering state.\n"
        "'targetwindow' is the window handle of the window that is currently enabled for "
		"drawing. That is, the last window a Screen drawing command was drawing to, or "
		"the window which is the current target for OpenGL rendering commands.\n"
		"'IsOpenGLRendering' if equal to zero, then normal 2D Screen drawing is active. "
		"If greater than zero, then Matlab OpenGL drawing is active, ie. a Screen('BeginOpenGL'); "
		"command was executed and OpenGL code can draw into 'targetwindow'. ";
		
    static char seeAlsoString[] = "BeginOpenGL EndOpenGL SetOpenGLTexture GetOpenGLTexture moglcore";	

	PsychWindowRecordType	*windowRecord;
    
	//all sub functions should have these two lines
    PsychPushHelp(useString, synopsisString,seeAlsoString);
    if(PsychIsGiveHelp()){PsychGiveHelp();return(PsychError_none);};
    
    //check for superfluous arguments
    PsychErrorExit(PsychCapNumInputArgs(0));        // The maximum number of inputs
    PsychErrorExit(PsychRequireNumInputArgs(0));    // Number of required inputs.
    PsychErrorExit(PsychCapNumOutputArgs(2));       // The maximum number of outputs

	windowRecord = PsychGetDrawingTarget();

	// Return window handle of currently active drawing target window:
	PsychCopyOutDoubleArg(1, FALSE, (double) ((windowRecord) ? windowRecord->windowIndex : 0));
	
	// Return draw mode: OpenGL userspace rendering or Screen() internal rendering?
	PsychCopyOutDoubleArg(2, FALSE, (double) PsychIsUserspaceRendering());

	// Ready:
    return(PsychError_none);
}
开发者ID:AlanFreeman,项目名称:Psychtoolbox-3,代码行数:35,代码来源:SCREENglMatrixFunctionWrappers.c



注:本文中的PsychCapNumInputArgs函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PsychCopyInIntegerArg函数代码示例发布时间:2022-05-30
下一篇:
C++ PsychAllocInWindowRecordArg函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap