当前位置: 首页>>代码示例>>C++>>正文


C++ xnOSMemSet函数代码示例

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


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

示例1: TextureMapInit

void TextureMapInit(XnTextureMap* pTex, int nSizeX, int nSizeY, unsigned int nBytesPerPixel, int nCurX, int nCurY)
{
	// check if something changed
	if (pTex->bInitialized && pTex->OrigSize.X == nSizeX && pTex->OrigSize.Y == nSizeY)
	{
		if (pTex->CurSize.X != nCurX || pTex->CurSize.Y != nCurY)
		{
			// clear map
			xnOSMemSet(pTex->pMap, 0, pTex->Size.X * pTex->Size.Y * pTex->nBytesPerPixel);

			// update
			pTex->CurSize.X = nCurX;
			pTex->CurSize.Y = nCurY;
			return;
		}
	}

	// free memory if it was allocated
	if (pTex->pMap != NULL)
	{
		delete[] pTex->pMap;
		pTex->pMap = NULL;
	}

	// update it all
	pTex->OrigSize.X = nSizeX;
	pTex->OrigSize.Y = nSizeY;
	pTex->Size.X = GetPowerOfTwo(nSizeX);
	pTex->Size.Y = GetPowerOfTwo(nSizeY);
	pTex->nBytesPerPixel = nBytesPerPixel;
	pTex->CurSize.X = nCurX;
	pTex->CurSize.Y = nCurY;
	pTex->pMap = new unsigned char[pTex->Size.X * pTex->Size.Y * nBytesPerPixel];
	xnOSMemSet(pTex->pMap, 0, pTex->Size.X * pTex->Size.Y * nBytesPerPixel);
	
	if (!pTex->bInitialized)
	{
		glGenTextures(1, &pTex->nID);
		glBindTexture(GL_TEXTURE_2D, pTex->nID);

		switch (pTex->nBytesPerPixel)
		{
		case 3:
			pTex->nFormat = GL_RGB;
			break;
		case 4:
			pTex->nFormat = GL_RGBA;
			break;
		}

		glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

		pTex->bInitialized = TRUE;
	}
}
开发者ID:1170390,项目名称:OpenNI2,代码行数:57,代码来源:Draw.cpp

示例2: MockGenerator

MockMapGenerator::MockMapGenerator(const XnChar* strName) : 
	MockGenerator(strName),
	m_nSupportedMapOutputModesCount(0),
	m_bSupportedMapOutputModesCountReceived(0),
	m_pSupportedMapOutputModes(NULL)
{
	xnOSMemSet(&m_mapOutputMode, 0, sizeof(m_mapOutputMode));
	xnOSMemSet(&m_cropping, 0, sizeof(m_cropping));
}
开发者ID:3david,项目名称:OpenNI,代码行数:9,代码来源:MockMapGenerator.cpp

示例3: GetProperty

XnStatus XnSensorDepthStream::PopulateSensorCalibrationInfo()
{
	XnDouble dPlanePixelSize;
	GetProperty(XN_STREAM_PROPERTY_ZERO_PLANE_PIXEL_SIZE, &dPlanePixelSize);

	XnUInt64 nPlaneDsr;
	GetProperty(XN_STREAM_PROPERTY_ZERO_PLANE_DISTANCE, &nPlaneDsr);

	XnDouble dDCRCDist;
	GetProperty(XN_STREAM_PROPERTY_DCMOS_RCMOS_DISTANCE, &dDCRCDist);

	m_calibrationInfo.magic = ONI_DEPTH_UTILS_CALIBRATION_INFO_MAGIC;
	m_calibrationInfo.version = 1;
	m_calibrationInfo.params1080.zpd = (int)nPlaneDsr;
	m_calibrationInfo.params1080.zpps = dPlanePixelSize;
	m_calibrationInfo.params1080.dcrcdist = dDCRCDist;

	xnOSStrCopy(m_calibrationInfo.deviceName, "PS1080", 80);
	xnOSMemSet(m_calibrationInfo.serial, 0, 80);

	m_calibrationInfo.params1080.rgbRegXRes = RGB_REG_X_RES;
	m_calibrationInfo.params1080.rgbRegYRes = RGB_REG_Y_RES;
	m_calibrationInfo.params1080.cmosVGAOutputXRes = XN_CMOS_VGAOUTPUT_XRES;
	m_calibrationInfo.params1080.sensorWinOffsetX = XN_SENSOR_WIN_OFFET_X;
	m_calibrationInfo.params1080.sensorWinOffsetY = XN_SENSOR_WIN_OFFET_Y;
	m_calibrationInfo.params1080.rgbRegXValScale = RGB_REG_X_VAL_SCALE;
	m_calibrationInfo.params1080.s2dPelConst = S2D_PEL_CONST;
	m_calibrationInfo.params1080.s2dConstOffset = S2D_CONST_OFFSET;

	XnStatus nRetVal = XnHostProtocolAlgorithmParams(m_Helper.GetPrivateData(), XN_HOST_PROTOCOL_ALGORITHM_REGISTRATION, &m_calibrationInfo.params1080.registrationInfo_QQVGA, sizeof(m_calibrationInfo.params1080.registrationInfo_QQVGA), XN_RESOLUTION_QQVGA, 30);
	if (nRetVal != XN_STATUS_OK)
	{
		xnOSMemSet(&m_calibrationInfo.params1080.registrationInfo_QQVGA, 0, sizeof(m_calibrationInfo.params1080.registrationInfo_QQVGA));
	}
	
	nRetVal = XnHostProtocolAlgorithmParams(m_Helper.GetPrivateData(), XN_HOST_PROTOCOL_ALGORITHM_REGISTRATION, &m_calibrationInfo.params1080.registrationInfo_QVGA, sizeof(m_calibrationInfo.params1080.registrationInfo_QVGA), XN_RESOLUTION_QVGA, 30);
	XN_IS_STATUS_OK(nRetVal);
	nRetVal = XnHostProtocolAlgorithmParams(m_Helper.GetPrivateData(), XN_HOST_PROTOCOL_ALGORITHM_REGISTRATION, &m_calibrationInfo.params1080.registrationInfo_VGA, sizeof(m_calibrationInfo.params1080.registrationInfo_VGA), XN_RESOLUTION_VGA, 30);
	XN_IS_STATUS_OK(nRetVal);

	nRetVal = XnHostProtocolAlgorithmParams(m_Helper.GetPrivateData(), XN_HOST_PROTOCOL_ALGORITHM_PADDING, &m_calibrationInfo.params1080.padInfo_QQVGA, sizeof(m_calibrationInfo.params1080.padInfo_QQVGA), XN_RESOLUTION_QQVGA, 30);
	if (nRetVal != XN_STATUS_OK)
	{	
		xnOSMemSet(&m_calibrationInfo.params1080.padInfo_QQVGA, 0, sizeof(m_calibrationInfo.params1080.padInfo_QQVGA));
	}
	
	xnOSMemSet(&m_calibrationInfo.params1080.padInfo_QVGA, 0, sizeof(m_calibrationInfo.params1080.padInfo_QVGA));
	nRetVal = XnHostProtocolAlgorithmParams(m_Helper.GetPrivateData(), XN_HOST_PROTOCOL_ALGORITHM_PADDING, &m_calibrationInfo.params1080.padInfo_QVGA, sizeof(m_calibrationInfo.params1080.padInfo_QVGA), XN_RESOLUTION_QVGA, 30);
	XN_IS_STATUS_OK(nRetVal);
	xnOSMemSet(&m_calibrationInfo.params1080.padInfo_VGA, 0, sizeof(m_calibrationInfo.params1080.padInfo_VGA));
	nRetVal = XnHostProtocolAlgorithmParams(m_Helper.GetPrivateData(), XN_HOST_PROTOCOL_ALGORITHM_PADDING, &m_calibrationInfo.params1080.padInfo_VGA, sizeof(m_calibrationInfo.params1080.padInfo_VGA), XN_RESOLUTION_VGA, 30);
	XN_IS_STATUS_OK(nRetVal);

	return XN_STATUS_OK;
}
开发者ID:jan-vitek,项目名称:OpenNI2,代码行数:55,代码来源:XnSensorDepthStream.cpp

示例4: xnOSMemSet

void SceneDrawer::DrawLabels(XnUserID nUserId)
{
#ifndef USE_GLES
    char strUserLabel[MAX_USER_LABEL_LEN] = "";
    char strOutputLabel[MAX_ID_LABEL_LEN] = "";
    XnFloat color[3];

    XnPoint3D com;
    xnOSMemSet(strOutputLabel, 0, sizeof(strOutputLabel));
    XnStatus res=m_pUserTrackerObj->GetUserColor(nUserId,color);
    XnFloat userExitPose=m_pUserTrackerObj->GetExitPoseState(nUserId)*100.0f;
    if(res!=XN_STATUS_OK)
        return; // bad user!
    xnOSMemSet(strUserLabel, 0, sizeof(strUserLabel));
    res=m_pUserTrackerObj->GetUserStringPos(nUserId,com,strUserLabel,MAX_USER_LABEL_LEN-1);
    if(res!=XN_STATUS_OK)
        return; // bad user!

    if (!g_bPrintState)
    {
        if(userExitPose>0)
        {
            sprintf(strOutputLabel, "%d - Exit wait %3.0f%% done.", nUserId,userExitPose);
        }
        else
        {
            sprintf(strOutputLabel, "%d", nUserId);
        }

    }
    else
    {
        if(userExitPose>0)
        {
            sprintf(strOutputLabel, "%d - %s - Exit wait %3.0f%% done.", nUserId,strUserLabel,userExitPose);
        }
        else
        {
            sprintf(strOutputLabel, "%d - %s", nUserId,strUserLabel);
        }

    }

    glColor4f(1-color[0], 1-color[1], 1-color[2], 1);

    glRasterPos2i(com.X, com.Y);
    int len = (int)strlen(strOutputLabel);

    for(int c=0; c<len; c++)
    {
        glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18,strOutputLabel[c]);
    }
#endif
}
开发者ID:voxels,项目名称:NiUserSelectionGLSL2,代码行数:54,代码来源:SceneDrawer.cpp

示例5: GetCPUName

static void GetCPUName(XnChar* csName)
{
	int CPUInfo[4] = {-1};
    xnOSMemSet(csName, 0, XN_MAX_OS_NAME_LENGTH);

	// calling cpuid with 0x80000000 retrives the number of extended properties
	__cpuid(CPUInfo, 0x80000000);
	unsigned int nExIds = CPUInfo[0];

	if (nExIds >= 0x80000002)
	{
		__cpuid(CPUInfo, 0x80000002);
		xnOSMemCopy(csName, CPUInfo, sizeof(CPUInfo));	
	}

	if (nExIds >= 0x80000003)
	{
		__cpuid(CPUInfo, 0x80000003);
		xnOSMemCopy(csName + 16, CPUInfo, sizeof(CPUInfo));	
	}

	if (nExIds >= 0x80000004)
	{
		__cpuid(CPUInfo, 0x80000004);
		xnOSMemCopy(csName + 32, CPUInfo, sizeof(CPUInfo));	
	}

	if (nExIds > 0x80000002)
		return;

	// else, we need to build the name ourselves
	xnOSMemSet(CPUInfo, 0xFF, sizeof(CPUInfo));

	__cpuid(CPUInfo, 0);
	int nIds = CPUInfo[0];

    *((int*)csName) = CPUInfo[1];
    *((int*)(csName+4)) = CPUInfo[3];
    *((int*)(csName+8)) = CPUInfo[2];

	if (nIds >= 1)
	{
		__cpuid(CPUInfo, 1);
        int nSteppingID = CPUInfo[0] & 0xf;
        int nModel = (CPUInfo[0] >> 4) & 0xf;
        int nFamily = (CPUInfo[0] >> 8) & 0xf;
        //int nProcessorType = (CPUInfo[0] >> 12) & 0x3;
        //int nExtendedmodel = (CPUInfo[0] >> 16) & 0xf;
        //int nExtendedfamily = (CPUInfo[0] >> 20) & 0xff;
        //int nBrandIndex = CPUInfo[1] & 0xff;

		sprintf(csName+strlen(csName), " Model: %d Family: %d Stepping: %d", nModel, nFamily, nSteppingID);
	}
开发者ID:Clebeson,项目名称:OpenNI,代码行数:53,代码来源:XnOSWin32.cpp

示例6: Mainloop

	void Mainloop()
	{
		int frameId = 1;
		int xdir = 1;
		int ydir = 1;
		struct {int x, y;} center = {0,0};
		while (m_running)
		{
//			printf("Tick");
			OniFrame* pFrame = getServices().acquireFrame();

			if (pFrame == NULL) {printf("Didn't get frame...\n"); continue;}

			// Fill frame
			xnOSMemSet(pFrame->data, 0, pFrame->dataSize);

			OniDepthPixel* pDepth = (OniDepthPixel*)pFrame->data;

			for (int y1 = XN_MAX(center.y-10, 0); y1 < XN_MIN(center.y+10, OZ_RESOLUTION_Y); ++y1)
				for (int x1 = XN_MAX(center.x-10, 0); x1 < XN_MIN(center.x+10, OZ_RESOLUTION_X); ++x1)
					if ((x1-center.x)*(x1-center.x)+(y1-center.y)*(y1-center.y) < 70)
						pDepth[singleRes(x1, y1)] = OniDepthPixel(1000+(x1-y1)*3);

//			pDepth[singleRes(center.x, center.y)] = 1000;

			center.x += xdir;
			center.y += ydir;

			if (center.x < abs(xdir) || center.x > OZ_RESOLUTION_X-1-abs(xdir)) xdir*=-1;
			if (center.y < abs(ydir) || center.y > OZ_RESOLUTION_Y-1-abs(ydir)) ydir*=-1;

			for (int i = 0; i < OZ_RESOLUTION_X; ++i) pDepth[i] = 2000;
			pDepth[0] = 2000;

			// Fill metadata
			pFrame->frameIndex = frameId;

			pFrame->videoMode.pixelFormat = ONI_PIXEL_FORMAT_DEPTH_1_MM;
			pFrame->videoMode.resolutionX = OZ_RESOLUTION_X;
			pFrame->videoMode.resolutionY = OZ_RESOLUTION_Y;
			pFrame->videoMode.fps = 30;

			pFrame->width = OZ_RESOLUTION_X;
			pFrame->height = OZ_RESOLUTION_Y;

			pFrame->cropOriginX = pFrame->cropOriginY = 0;
			pFrame->croppingEnabled = FALSE;

			pFrame->sensorType = ONI_SENSOR_DEPTH;
			pFrame->stride = OZ_RESOLUTION_X*sizeof(OniDepthPixel);
			pFrame->timestamp = frameId*33000;

			raiseNewFrame(pFrame);
			getServices().releaseFrame(pFrame);

			frameId++;

			xnOSSleep(33);
		}
	}
开发者ID:1170390,项目名称:OpenNI2,代码行数:60,代码来源:DummyDevice.cpp

示例7: RecordAngle

// record 8 joint angles and one head-neck orientation
void RecordAngle(XnUserID player, FILE *fp)
{
	XnBool current;
	float angleHeadNeckTorse, 
		  angleHeadNeckLeftShoulder, 
		  angleHeadNeckRightShoulder, 
		  angleNeckHipLeftKnee, 
		  angleNeckHipRightKnee,
		  angleNeckLeftShoulderLeftArm,
		  angleNeckRightShoulderRightArm;

	angleHeadNeckTorse = CalculateJointAngle(player, XN_SKEL_HEAD, XN_SKEL_NECK, XN_SKEL_TORSO);
	angleHeadNeckLeftShoulder = CalculateJointAngle(player, XN_SKEL_HEAD, XN_SKEL_NECK, XN_SKEL_LEFT_SHOULDER);
	angleHeadNeckRightShoulder = CalculateJointAngle(player, XN_SKEL_HEAD, XN_SKEL_NECK, XN_SKEL_RIGHT_SHOULDER);
	angleNeckHipLeftKnee = CalculateJointAngle(player, XN_SKEL_NECK, XN_SKEL_LEFT_HIP, XN_SKEL_LEFT_KNEE);
	angleNeckHipRightKnee = CalculateJointAngle(player, XN_SKEL_NECK, XN_SKEL_RIGHT_HIP, XN_SKEL_RIGHT_KNEE);
	angleNeckLeftShoulderLeftArm = CalculateJointAngle(player, XN_SKEL_NECK, XN_SKEL_LEFT_SHOULDER, XN_SKEL_LEFT_ELBOW);
	angleNeckRightShoulderRightArm = CalculateJointAngle(player, XN_SKEL_NECK, XN_SKEL_RIGHT_SHOULDER, XN_SKEL_RIGHT_ELBOW);


	float angleHeadNeck = CalculateHeadNeckAngle(player);

	char output[100] = "";
	xnOSMemSet(output, 0, sizeof(output));
	sprintf(output, "%.2f	%.2f	%.2f	%.2f	%.2f	%.2f	%.2f	%.2f\n", 
		angleHeadNeckTorse, angleHeadNeckLeftShoulder, 
		angleHeadNeckRightShoulder, angleNeckHipLeftKnee, 
		angleNeckHipRightKnee, angleNeckLeftShoulderLeftArm, 
		angleNeckRightShoulderRightArm, angleHeadNeck);

	fprintf(fp, output);
}
开发者ID:scottmeng,项目名称:VOBE_user_state_detection,代码行数:33,代码来源:PostureChecker.cpp

示例8: XnStreamDataUpdateSize

XN_DDK_API XnStatus XnStreamDataUpdateSize(XnStreamData* pStreamOutput, XnUInt32 nAllocSize)
{
	XN_VALIDATE_INPUT_PTR(pStreamOutput);

	// allocate new memory
	void* pNew = xnOSMallocAligned(nAllocSize, XN_DEFAULT_MEM_ALIGN);
	if (pNew == NULL)
		return (XN_STATUS_ALLOC_FAILED);

	// zero it
	xnOSMemSet(pNew, 0, nAllocSize);

	// free the buffer if it is allocated
	XN_ALIGNED_FREE_AND_NULL(pStreamOutput->pData);

	// and now set new buffer
	pStreamOutput->pData = pNew;

	// and size
	pStreamOutput->pInternal->nAllocSize = nAllocSize;

	pStreamOutput->pInternal->bAllocated = TRUE;

	return XN_STATUS_OK;
}
开发者ID:0pascal0,项目名称:SensorKinect,代码行数:25,代码来源:XnStreamData.cpp

示例9: xnOSDeleteDirectoryTree

XN_C_API XnStatus XN_C_DECL xnOSDeleteDirectoryTree(const XnChar* strDirName)
{
	XnStatus nRetVal = XN_STATUS_OK;
	
	XN_VALIDATE_INPUT_PTR(strDirName);

	// file name must be double-null terminated
	XnChar strDirNameDoubleNull[MAX_PATH+1];
	xnOSMemSet(strDirNameDoubleNull, 0, sizeof(strDirNameDoubleNull));
	nRetVal = xnOSStrCopy(strDirNameDoubleNull, strDirName, MAX_PATH);
	XN_IS_STATUS_OK(nRetVal);

	SHFILEOPSTRUCT shOp;
	shOp.hwnd = NULL;
	shOp.wFunc = FO_DELETE;
	shOp.pFrom = strDirNameDoubleNull;
	shOp.pTo = NULL;
	shOp.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT;
	shOp.fAnyOperationsAborted = 0;
	shOp.hNameMappings = NULL;
	shOp.lpszProgressTitle = NULL;

	int ret = SHFileOperation(&shOp);
	if (ret != 0)
	{
		return XN_STATUS_OS_FAILED_TO_DELETE_DIR;
	}

	return (XN_STATUS_OK);
}
开发者ID:jspricke,项目名称:debian-openni,代码行数:30,代码来源:Win32Files.cpp

示例10: xnUSBInitOvlp

//---------------------------------------------------------------------------
// Helper Functions
//---------------------------------------------------------------------------
XnStatus xnUSBInitOvlp(XN_USB_EP_HANDLE pEPHandle)
{
	XnStatus nRetVal = XN_STATUS_OK;

	if (pEPHandle->hEPHandleOvlp != NULL)
	{
		CloseHandle(pEPHandle->hEPHandleOvlp);
	}

	if (pEPHandle->ovlpIO.hEvent != NULL)
	{
		xnOSCloseEvent(&pEPHandle->ovlpIO.hEvent);
	}

	// Open the overlapped pipe handle
	pEPHandle->hEPHandleOvlp = CreateFile(pEPHandle->cpPipeName, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL);
	if (pEPHandle->hEPHandleOvlp == INVALID_HANDLE_VALUE)
	{
		return (XN_STATUS_ERROR);
	}

	// Init the overlapped variables
	xnOSMemSet(&pEPHandle->ovlpIO, 0, sizeof(OVERLAPPED));
	nRetVal = xnOSCreateEvent(&pEPHandle->ovlpIO.hEvent, FALSE);
	if (nRetVal != XN_STATUS_OK)
	{
		return (XN_STATUS_ERROR);
	}

	return (XN_STATUS_OK);
}
开发者ID:jspricke,项目名称:debian-openni,代码行数:34,代码来源:XnUSBWin32.cpp

示例11: XN_NEW

OniStatus PlayerDriver::tryDevice(const char* strUri)
{
	static XnPlayerInputStreamInterface inputInterface = 
	{
		FileOpen,
		FileRead,
		NULL,
		NULL,
		FileClose,
		NULL,
		NULL,
	};

	// Store the file path.
	m_filePath = strUri;

	XnStatus rc = PlayerNode::ValidateStream(this, &inputInterface);
	if (rc == XN_STATUS_OK)
	{
		OniDeviceInfo* pInfo = XN_NEW(OniDeviceInfo);
		xnOSMemSet(pInfo, 0, sizeof(*pInfo));
		xnOSStrCopy(pInfo->uri,    strUri,               ONI_MAX_STR);
		xnOSStrCopy(pInfo->vendor, kVendorString.Data(), ONI_MAX_STR);
		xnOSStrCopy(pInfo->name,   kDeviceName.Data(),   ONI_MAX_STR);
		deviceConnected(pInfo);
		return ONI_STATUS_OK;
	}

	return DriverBase::tryDevice(strUri);
}
开发者ID:Arkapravo,项目名称:OpenNI2,代码行数:30,代码来源:PlayerDriver.cpp

示例12: initWave

    // WAVEの初期化
    void initWave()
    {
        // WAVEデータの設定
        WAVEFORMATEX wf;
        wf.wFormatTag = 0x0001; // PCM
        wf.nChannels = waveMode.nChannels;
        wf.nSamplesPerSec = waveMode.nSampleRate;
        wf.wBitsPerSample = waveMode.nBitsPerSample;
        wf.nBlockAlign = wf.wBitsPerSample * wf.nChannels / 8;
        wf.nAvgBytesPerSec = wf.nBlockAlign * wf.nSamplesPerSec;
        MMRESULT mmRes = waveOutOpen(&hWaveOut, WAVE_MAPPER, &wf, NULL, NULL, CALLBACK_NULL);
        if (mmRes != MMSYSERR_NOERROR)
        {
            throw std::runtime_error( "Warning: Failed opening wave out device. Audio will not be played!\n" );
        }

        // 音声データ用のバッファの作成と初期化
        AudioBuffers.resize( NUMBER_OF_AUDIO_BUFFERS );
        xnOSMemSet(&AudioBuffers[0], 0, sizeof(WAVEHDR)*AudioBuffers.size());

        const XnUInt32 nMaxBufferSize = 2 * 1024 * 1024;
        for (int i = 0; i < NUMBER_OF_AUDIO_BUFFERS; ++i)
        {
            AudioBuffers[i].lpData = new XnChar[nMaxBufferSize];
            AudioBuffers[i].dwUser = i;
            AudioBuffers[i].dwFlags = WHDR_DONE; // mark this buffer as empty (already played)
        }
    }
开发者ID:DaikiMaekawa,项目名称:openni_sandbox,代码行数:29,代码来源:main.cpp

示例13: XnDeviceBase

//---------------------------------------------------------------------------
// Code
//---------------------------------------------------------------------------
XnSensor::XnSensor() :
	XnDeviceBase(XN_DEVICE_NAME, TRUE),
	m_ErrorState(XN_MODULE_PROPERTY_ERROR_STATE, XN_STATUS_OK),
	m_ResetSensorOnStartup(XN_MODULE_PROPERTY_RESET_SENSOR_ON_STARTUP, TRUE),
	m_Interface(XN_MODULE_PROPERTY_USB_INTERFACE, XN_SENSOR_USB_INTERFACE_DEFAULT),
	m_NumberOfBuffers(XN_MODULE_PROPERTY_NUMBER_OF_BUFFERS, 6),
	m_ReadFromEP1(XN_MODULE_PROPERTY_READ_ENDPOINT_1, TRUE),
	m_ReadFromEP2(XN_MODULE_PROPERTY_READ_ENDPOINT_2, TRUE),
	m_ReadFromEP3(XN_MODULE_PROPERTY_READ_ENDPOINT_3, TRUE),
	m_ReadData("ReadData", FALSE),
	m_FrameSync(XN_MODULE_PROPERTY_FRAME_SYNC, FALSE),
	m_FirmwareParam(XN_MODULE_PROPERTY_FIRMWARE_PARAM, NULL),
	m_CmosBlankingUnits(XN_MODULE_PROPERTY_CMOS_BLANKING_UNITS, NULL),
	m_CmosBlankingTime(XN_MODULE_PROPERTY_CMOS_BLANKING_TIME, NULL),
	m_Reset(XN_MODULE_PROPERTY_RESET),
	m_FirmwareMode(XN_MODULE_PROPERTY_FIRMWARE_MODE),
	m_Version(XN_MODULE_PROPERTY_VERSION, &m_DevicePrivateData.Version, sizeof(m_DevicePrivateData.Version), NULL),
	m_FixedParam(XN_MODULE_PROPERTY_FIXED_PARAMS, NULL),
	m_CloseStreamsOnShutdown(XN_MODULE_PROPERTY_CLOSE_STREAMS_ON_SHUTDOWN, XN_SENSOR_DEFAULT_CLOSE_STREAMS_ON_SHUTDOWN),
	m_ID(XN_MODULE_PROPERTY_ID),
	m_pThis(this),
	m_InstancePointer(XN_SENSOR_PROPERTY_INSTANCE_POINTER, &m_pThis, sizeof(m_pThis), NULL),
	m_USBPath(XN_MODULE_PROPERTY_USB_PATH),
	m_DeviceName(XN_MODULE_PROPERTY_PHYSICAL_DEVICE_NAME),
	m_VendorSpecificData(XN_MODULE_PROPERTY_VENDOR_SPECIFIC_DATA),
	m_Firmware(&m_DevicePrivateData),
	m_FixedParams(&m_Firmware, &m_DevicePrivateData),
	m_SensorIO(&m_DevicePrivateData.SensorHandle),
	m_FPS(),
	m_CmosInfo(&m_Firmware, &m_DevicePrivateData),
	m_Objects(&m_Firmware, &m_DevicePrivateData, &m_FixedParams, &m_FPS, &m_CmosInfo),
	m_FrameSyncDump(XN_DUMP_CLOSED),
	m_bInitialized(FALSE)
{
	// reset all data
	xnOSMemSet(&m_DevicePrivateData, 0, sizeof(XnDevicePrivateData));
	m_strGlobalConfigFile[0] = '\0';

	m_ResetSensorOnStartup.UpdateSetCallbackToDefault();
	m_Interface.UpdateSetCallback(SetInterfaceCallback, this);
	m_NumberOfBuffers.UpdateSetCallback(SetNumberOfBuffersCallback, this);
	m_ReadFromEP1.UpdateSetCallback(SetReadEndpoint1Callback, this);
	m_ReadFromEP2.UpdateSetCallback(SetReadEndpoint2Callback, this);
	m_ReadFromEP3.UpdateSetCallback(SetReadEndpoint3Callback, this);
	m_ReadData.UpdateSetCallback(SetReadDataCallback, this);
	m_FrameSync.UpdateSetCallbackToDefault();
	m_FirmwareParam.UpdateSetCallback(SetFirmwareParamCallback, this);
	m_FirmwareParam.UpdateGetCallback(GetFirmwareParamCallback, this);
	m_CmosBlankingUnits.UpdateSetCallback(SetCmosBlankingUnitsCallback, this);
	m_CmosBlankingUnits.UpdateGetCallback(GetCmosBlankingUnitsCallback, this);
	m_CmosBlankingTime.UpdateSetCallback(SetCmosBlankingTimeCallback, this);
	m_CmosBlankingTime.UpdateGetCallback(GetCmosBlankingTimeCallback, this);
	m_Reset.UpdateSetCallback(ResetCallback, this);
	m_FirmwareMode.UpdateSetCallback(SetFirmwareModeCallback, this);
	m_FirmwareMode.UpdateGetCallback(GetFirmwareModeCallback, this);
	m_FixedParam.UpdateGetCallback(GetFixedParamsCallback, this);
	m_CloseStreamsOnShutdown.UpdateSetCallbackToDefault();

}
开发者ID:AlpinistPanda,项目名称:SensorKinect,代码行数:62,代码来源:XnSensor.cpp

示例14: m_hPlayer

PlayerImpl::PlayerImpl() : 
	m_hPlayer(NULL), 
	m_pInFile(NULL),
	m_bHasTimeReference(FALSE),
	m_dPlaybackSpeed(1.0)
{
	xnOSMemSet(m_strSource, 0, sizeof(m_strSource));
}
开发者ID:jgollub,项目名称:MetaImagerProj,代码行数:8,代码来源:XnPlayerImpl.cpp

示例15: xnOSMemSet

SyncSocketConnection::SyncSocketConnection()
{
	m_hSocket = NULL;
	xnOSMemSet(m_strIP, 0, sizeof(m_strIP));
	m_nPort = 0;
	m_nMaxPacketSize = 0;
	m_bInitialized = FALSE;
}
开发者ID:1170390,项目名称:OpenNI2,代码行数:8,代码来源:XnSyncSocketConnection.cpp


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