예제 #1
0
파일: dialog.cpp 프로젝트: 019949/kinect
	//--
	void
	Dialog::eventFrameColor()
	{
		const NUI_IMAGE_FRAME* image_frame = NULL;

		HRESULT hr = ::NuiImageStreamGetNextFrame(m_color_stream_handle, 0, &image_frame);
		
		if(FAILED(hr))
		{
			return;	
		}

		NuiImageBuffer* texture = image_frame->pFrameTexture;
		KINECT_LOCKED_RECT locked_rect;
		texture->LockRect(0, &locked_rect, NULL, 0);

		if(locked_rect.Pitch != 0)
    	{
    		m_display->drawColor((const unsigned char*) locked_rect.pBits);
    	}

    	texture->UnlockRect(0);

		::NuiImageStreamReleaseFrame(m_color_stream_handle, image_frame);
	}
예제 #2
0
파일: dialog.cpp 프로젝트: 019949/kinect
	//--
	void
	Dialog::eventFrameDepth()
	{
		const NUI_IMAGE_FRAME* image_frame = NULL;

		HRESULT hr = ::NuiImageStreamGetNextFrame(m_depth_stream_handle, 0, &image_frame);
		
		if(FAILED(hr))
		{
			return;	
		}

		NuiImageBuffer* texture = image_frame->pFrameTexture;
		KINECT_LOCKED_RECT locked_rect;
		texture->LockRect(0, &locked_rect, NULL, 0);

		if(locked_rect.Pitch != 0)
    	{
    		// [rad] Do nothing.
    	}

    	texture->UnlockRect(0);

		::NuiImageStreamReleaseFrame(m_depth_stream_handle, image_frame);
	}