本文整理汇总了C++中flycapture2::Error::GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ Error::GetType方法的具体用法?C++ Error::GetType怎么用?C++ Error::GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flycapture2::Error
的用法示例。
在下文中一共展示了Error::GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleError
void PointGreyCamera::handleError(const std::string &prefix, const FlyCapture2::Error &error)
{
if(error == PGRERROR_TIMEOUT)
{
throw CameraTimeoutException("PointGreyCamera: Failed to retrieve buffer within timeout.");
}
else if(error != PGRERROR_OK) // If there is actually an error (PGRERROR_OK means the function worked as intended...)
{
std::string start(" | FlyCapture2::ErrorType ");
std::stringstream out;
out << error.GetType();
std::string desc(error.GetDescription());
throw std::runtime_error(prefix + start + out.str() + " " + desc);
}
}
示例2: CCflycap_get_camera_property_info
void CCflycap_get_camera_property_info(CCflycap *ccntxt,
int property_number,
CameraPropertyInfo *info) {
CHECK_CC(ccntxt);
FlyCapture2::Camera *cam = (FlyCapture2::Camera *)ccntxt->inherited.cam;
if (info==NULL) {
CAM_IFACE_THROW_ERROR("no info argument specified (NULL argument)");
}
if ((property_number<0) || (property_number>=NUM_CAM_PROPS)) {
BACKEND_GLOBAL(cam_iface_error) = CAM_IFACE_GENERIC_ERROR;
CAM_IFACE_ERROR_FORMAT("property invalid");
}
FlyCapture2::Property prop;
FlyCapture2::PropertyInfo propinfo;
prop.type = propno2prop(property_number);
propinfo.type = prop.type;
switch(prop.type) {
case FlyCapture2::BRIGHTNESS: info->name = "brightness"; break;
case FlyCapture2::AUTO_EXPOSURE: info->name = "auto exposure"; break;
case FlyCapture2::SHARPNESS: info->name = "sharpness"; break;
case FlyCapture2::WHITE_BALANCE: info->name = "white balance"; break;
case FlyCapture2::HUE: info->name = "hue"; break;
case FlyCapture2::SATURATION: info->name = "saturation"; break;
case FlyCapture2::GAMMA: info->name = "gamma"; break;
case FlyCapture2::IRIS: info->name = "iris"; break;
case FlyCapture2::FOCUS: info->name = "focus"; break;
case FlyCapture2::ZOOM: info->name = "zoom"; break;
case FlyCapture2::PAN: info->name = "pan"; break;
case FlyCapture2::TILT: info->name = "tilt"; break;
case FlyCapture2::SHUTTER: info->name = "shutter"; break;
case FlyCapture2::GAIN: info->name = "gain"; break;
case FlyCapture2::TRIGGER_MODE: info->name = "trigger mode"; break;
case FlyCapture2::TRIGGER_DELAY: info->name = "trigger delay"; break;
case FlyCapture2::FRAME_RATE: info->name = "frame rate"; break;
case FlyCapture2::TEMPERATURE: info->name = "temperature"; break;
}
FlyCapture2::Error error = cam->GetProperty( &prop );
if (error.GetType()==FlyCapture2::PGRERROR_PROPERTY_FAILED) {
info->is_present = 0;
return;
}
CIPGRCHK(error);
CIPGRCHK(cam->GetPropertyInfo( &propinfo ));
info->is_present = prop.present;
info->min_value = propinfo.min;
info->max_value = propinfo.max;
info->has_auto_mode = propinfo.autoSupported;
info->has_manual_mode = propinfo.manualSupported;
info->is_scaled_quantity = 0;
info->original_value = 0; // XXX FIXME
info->available = prop.present;
info->readout_capable = propinfo.readOutSupported;
info->on_off_capable = propinfo.onOffSupported;
info->absolute_capable = propinfo.absValSupported;
info->absolute_control_mode = 0;
info->absolute_min_value = propinfo.absMin;
info->absolute_max_value = propinfo.absMax;
return;
}