本文整理汇总了C++中UserInterface::setDisplayMode方法的典型用法代码示例。如果您正苦于以下问题:C++ UserInterface::setDisplayMode方法的具体用法?C++ UserInterface::setDisplayMode怎么用?C++ UserInterface::setDisplayMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserInterface
的用法示例。
在下文中一共展示了UserInterface::setDisplayMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[]) {
application_settings config;
sprintf(config.file,"none");
const char *app_name = "reacTIVision";
const char *version_no = "1.6";
bool headless = false;
std::cout << app_name << " " << version_no << " (" << __DATE__ << ")" << std::endl << std::endl;
if (argc>1) {
if (strcmp( argv[1], "-h" ) == 0 ) {
printUsage(app_name);
return 0;
} else if( strcmp( argv[1], "-c" ) == 0 ) {
if (argc==3) sprintf(config.file,"%s",argv[2]);
else {
printUsage(app_name);
return 0;
}
} else if( strcmp( argv[1], "-n" ) == 0 ) {
headless = true;
} else if( strcmp( argv[1], "-l" ) == 0 ) {
CameraTool::listDevices();
return 0;
} else if ( (std::string(argv[1]).find("-NSDocumentRevisionsDebugMode")==0 ) || (std::string(argv[1]).find("-psn_")==0) ){
// ignore mac specific arguments
} else {
printUsage(app_name);
}
}
#ifndef WIN32
signal(SIGINT,terminate);
signal(SIGHUP,terminate);
signal(SIGQUIT,terminate);
signal(SIGTERM,terminate);
#endif
readSettings(&config);
config.headless = headless;
engine = new VisionEngine(app_name,&config);
if (!headless) {
UserInterface *uiface = new SDLinterface(app_name,config.fullscreen);
switch (config.display_mode) {
case 0: uiface->setDisplayMode(NO_DISPLAY); break;
case 1: uiface->setDisplayMode(SOURCE_DISPLAY); break;
case 2: uiface->setDisplayMode(DEST_DISPLAY); break;
}
engine->setInterface(uiface);
}
TuioServer *server = NULL;
FrameProcessor *fiducialfinder = NULL;
FrameProcessor *thresholder = NULL;
FrameProcessor *calibrator = NULL;
for (int i=0;i<config.tuio_count;i++) {
OscSender *sender = NULL;
try { switch (config.tuio_type[i]) {
case TUIO_UDP: sender = new UdpSender(config.tuio_host[i].c_str(),config.tuio_port[i]); break;
case TUIO_TCP_CLIENT: sender = new TcpSender(config.tuio_host[i].c_str(),config.tuio_port[i]); break;
case TUIO_TCP_HOST: sender = new TcpSender(config.tuio_port[i]); break;
case TUIO_WEB: sender = new WebSockSender(config.tuio_port[i]); break;
case TUIO_FLASH: sender = new FlashSender(); break;
default: continue;
} } catch (std::exception e) {}
if (sender) {
if(i==0) server = new TuioServer(sender);
else server->addOscSender(sender);
pv_sleep(1);
}
}
server->setSourceName("rtv");
server->setInversion(config.invert_x, config.invert_y, config.invert_a);
thresholder = new FrameThresholder(config.gradient_gate, config.tile_size, config.thread_count);
if (config.background) thresholder->toggleFlag(KEY_SPACE,false);
engine->addFrameProcessor(thresholder);
fiducialfinder = new FidtrackFinder(server, &config);
engine->addFrameProcessor(fiducialfinder);
calibrator = new CalibrationEngine(config.grid_config);
engine->addFrameProcessor(calibrator);
engine->start();
engine->removeFrameProcessor(calibrator);
delete calibrator;
config.finger_size = ((FidtrackFinder*)fiducialfinder)->getFingerSize();
config.finger_sensitivity = ((FidtrackFinder*)fiducialfinder)->getFingerSensitivity();
config.max_blob_size = ((FidtrackFinder*)fiducialfinder)->getBlobSize();
config.object_blobs = ((FidtrackFinder*)fiducialfinder)->getFiducialBlob();
//.........这里部分代码省略.........