本文整理汇总了C++中Viewer::display方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewer::display方法的具体用法?C++ Viewer::display怎么用?C++ Viewer::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewer
的用法示例。
在下文中一共展示了Viewer::display方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
Scene scene;
char* filename = "src/resources/scene.json";
scene.parseScene(filename, scene);
int width = 1024;
int height = 768;
Viewer *view = new Viewer(width, height, scene);
view->display();
return 0;
}
示例2: setMaxHeartbeatInterval
void
MainThread::work()
{
setMaxHeartbeatInterval( 1.0 );
// get 1 image
// and check it's description for the particular image configuration
getImage();
//set up the viewer according to the configuration
Viewer viewer = Viewer( imageData_->description->width,
imageData_->description->height,
imageData_->description->format,
context_ );
while ( !isStopping() )
{
try
{
// this blocks until a new image arrives and then
// copies into a member variable
getImage();
// pass the image to the viewer
viewer.display( imageData_ );
//pushing too fast will cause the gui to not respond, sleep to prevent that
// TODO: dodgy hack... needs to be fixed
// The GUI diplay should be independent of incoming data. If the GUI dies,
// then this code should be in the Viewer.
IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(5));
}
catch ( ... )
{
orcaice::catchMainLoopExceptions( health() );
// Re-create the viewer, unless we are stopping
if ( !isStopping() ) {
// TODO: make opencv window handle exception safe so we can create
// another viewer here. At the moment, if an exception is thrown,
// the viewer will not self destruct.
// createViewer();
}
}
} // end of while
}