本文整理汇总了C++中Frame::GetHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ Frame::GetHeight方法的具体用法?C++ Frame::GetHeight怎么用?C++ Frame::GetHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Frame
的用法示例。
在下文中一共展示了Frame::GetHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: query
void AVC_FormatManager::query()
{
// Find available formats and video standards.
int port = -1;
AVC_DeviceDescriptor* dd = dynamic_cast<AVC_DeviceDescriptor*>(mDeviceDescriptor);
std::auto_ptr<iec61883Reader> reader;
std::auto_ptr<iec61883Connection> connection;
int node = discoverAVC(&port, &dd->getGUID());
if(node == -1)
return;
if ( port != -1 ) {
// capture a single frame and retrieve it's properties
iec61883Connection::CheckConsistency( port, node );
connection = std::auto_ptr<iec61883Connection>(new iec61883Connection(port, node));
int channel = connection->GetChannel();
reader = std::auto_ptr<iec61883Reader>(new iec61883Reader( port, channel));
reader->StartThread();
// Wait for the reader to indicate that something has happened
if(!reader->WaitForAction(5)) {
std::cerr<<"AVC_FormatManager: Timed out retrieving format.\n";
} else {
// Get the next frame
Frame* frame = reader->GetFrame();
if(!frame) {
std::cout<<"AVC_FormatManager: Error retrieving format parameters.\n";
}
// get format-properties
mWidth = frame->GetWidth();
mHeight = frame->GetHeight();
mBytesPerLine = mWidth;
mImageSize = mWidth*mHeight*3;
// create the formats
Format* yuv = new Format("YUYV", v4l2_fourcc('Y','U','Y','V'));
mFormats.push_back(yuv);
Format* rgb = new Format("RGB", v4l2_fourcc('R', 'G', 'B', 0));
mFormats.push_back(rgb);
setFormat(yuv);
// and the proper video-standards
mIsPal = frame->IsPAL();
if(mIsPal) {
VideoStandard* pal = new VideoStandard("PAL", VideoStandard::PAL);
mStandards.push_back(pal);
yuv->addResolution(720, 576);
rgb->addResolution(720, 576);
} else {
VideoStandard* ntsc = new VideoStandard("NTSC", VideoStandard::NTSC);
mStandards.push_back(ntsc);
yuv->addResolution(720, 480);
rgb->addResolution(720, 480);
}
// release the frame
reader->DoneWithFrame( frame );
}
// and stop capturing
reader->StopThread();
}
}