MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / findUniqueFileName

Function findUniqueFileName

Samples/NiViewer/Capture.cpp:517–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515}
516
517int findUniqueFileName()
518{
519 xnOSCreateDirectory(CAPTURED_FRAMES_DIR_NAME);
520
521 int num = g_Capture.nCapturedFrameUniqueID;
522
523 XnBool bExist = FALSE;
524 XnStatus nRetVal = XN_STATUS_OK;
525 XnChar csImageFileName[XN_FILE_MAX_PATH];
526 XnChar csDepthFileName[XN_FILE_MAX_PATH];
527 XnChar csIRFileName[XN_FILE_MAX_PATH];
528
529 for (;;)
530 {
531 // check image
532 getImageFileName(num, csImageFileName);
533
534 nRetVal = xnOSDoesFileExist(csImageFileName, &bExist);
535 if (nRetVal != XN_STATUS_OK)
536 break;
537
538 if (!bExist)
539 {
540 // check depth
541 getDepthFileName(num, csDepthFileName);
542
543 nRetVal = xnOSDoesFileExist(csDepthFileName, &bExist);
544 if (nRetVal != XN_STATUS_OK || !bExist)
545 break;
546 }
547
548 if (!bExist)
549 {
550 // check IR
551 getIRFileName(num, csIRFileName);
552
553 nRetVal = xnOSDoesFileExist(csIRFileName, &bExist);
554 if (nRetVal != XN_STATUS_OK || !bExist)
555 break;
556 }
557
558 ++num;
559 }
560
561 return num;
562}
563
564void captureSingleFrame(int)
565{

Callers 1

captureSingleFrameFunction · 0.85

Calls 5

getImageFileNameFunction · 0.85
getDepthFileNameFunction · 0.85
getIRFileNameFunction · 0.85
xnOSCreateDirectoryFunction · 0.50
xnOSDoesFileExistFunction · 0.50

Tested by

no test coverage detected