本文整理汇总了C++中MyWindow::setOverlayString方法的典型用法代码示例。如果您正苦于以下问题:C++ MyWindow::setOverlayString方法的具体用法?C++ MyWindow::setOverlayString怎么用?C++ MyWindow::setOverlayString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyWindow
的用法示例。
在下文中一共展示了MyWindow::setOverlayString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: liveLoop
//.........这里部分代码省略.........
cout << ", max request count: " << ss.requestCount.getMaxValue();
}
cout << endl;
cout << "Press <<ENTER>> to end the application!!" << endl;
MyWindow* pWindow = createWindow( iWidth, iHeight );
pWindow->show();
pWindow->callback( windowCallback );
manuallyStartAcquisitionIfNeeded( pDev, fi );
// run thread loop
const Request* pRequest = 0;
const unsigned int timeout_ms = 8000; // USB 1.1 on an embedded system needs a large timeout for the first image
int requestNr = -1;
bool boLoopRunning = true;
unsigned int cnt = 0;
while( boLoopRunning )
{
// wait for results from the default capture queue
requestNr = fi.imageRequestWaitFor( timeout_ms );
if( fi.isRequestNrValid( requestNr ) )
{
pRequest = fi.getRequest( requestNr );
if( pRequest->isOK() )
{
++cnt;
// here we can display some statistical information every 20th image
if( cnt % 20 == 0 )
{
ostringstream out;
out << pDev->serial.read() << ": " << statistics.framesPerSecond.name() << ": " << statistics.framesPerSecond.readS();
pWindow->setOverlayString( out.str() );
cout << cnt << ": Info from " << pDev->serial.read()
<< ": " << statistics.framesPerSecond.name() << ": " << statistics.framesPerSecond.readS()
<< ", " << statistics.errorCount.name() << ": " << statistics.errorCount.readS()
<< ", " << statistics.captureTime_s.name() << ": " << statistics.captureTime_s.readS()
<< " Image count: " << cnt
<< " (dimensions: " << pRequest->imageWidth.read() << "x" << pRequest->imageHeight.read() << ", format: " << pRequest->imagePixelFormat.readS();
if( pRequest->imageBayerMosaicParity.read() != bmpUndefined )
{
cout << ", " << pRequest->imageBayerMosaicParity.name() << ": " << pRequest->imageBayerMosaicParity.readS();
}
cout << ")" << endl;
}
// here we can store an image every 100th frame
if( boStoreFrames && ( cnt % 100 == 0 ) )
{
ostringstream oss;
oss << "Image" << cnt << "." << pRequest->imageWidth.read() << "x" << pRequest->imageHeight.read() << "." << pRequest->imagePixelFormat.readS();
if( pRequest->imageBayerMosaicParity.read() != bmpUndefined )
{
oss << "(BayerPattern=" << pRequest->imageBayerMosaicParity.readS() << ")";
}
oss << ".raw";
FILE* fp = fopen( oss.str().c_str(), "wb" );
if( fp )
{
unsigned char* pImageData = ( unsigned char* ) pRequest->imageData.read();
for( int h = 0; h < pRequest->imageHeight.read(); h++ )
{
// write one line
fwrite( pImageData, pRequest->imageWidth.read(), pRequest->imageBytesPerPixel.read(), fp );
// respect image line pitch