void Camera::setWhiteBalance(unsigned int blue, unsigned int red, AutoSetting isauto) { if (PvAttrIsAvailable(handle_, "WhitebalMode") == ePvErrSuccess) { CHECK_ERR( PvAttrEnumSet(handle_, "WhitebalMode", autoValues[isauto]), "Couldn't set white balance mode" ); } if (isauto == Manual && PvAttrIsAvailable(handle_, "WhitebalValueBlue")) { CHECK_ERR( PvAttrUint32Set(handle_, "WhitebalValueBlue", blue), "Couldn't set white balance blue value" ); CHECK_ERR( PvAttrUint32Set(handle_, "WhitebalValueRed", red), "Couldn't set white balance red value" ); } }
void Camera::setGain(unsigned int val, AutoSetting isauto) { /// @todo Here and in setWhiteBalance, would be better to split off setGainMode etc. /// I didn't take into account there are cameras that don't support auto gain, auto white balance. if (PvAttrIsAvailable(handle_, "GainMode") == ePvErrSuccess) { CHECK_ERR( PvAttrEnumSet(handle_, "GainMode", autoValues[isauto]), "Couldn't set gain mode" ); } if (isauto == Manual) CHECK_ERR( PvAttrUint32Set(handle_, "GainValue", val), "Couldn't set gain value" ); }
// // idlPvAttrIsAvailable // // Determine if the attribute is available for a specified camera // // command line arguments // argv[0]: IN/FLAG debug // argv[1]: IN index of camera // argv[2]: IN name of attribute int idlPvAttrIsAvailable (int argc, char *argv[]) { unsigned long n; IDL_STRING *attribute; unsigned long err; debug = *(IDL_INT *) argv[0]; n = *(unsigned long *) argv[1]; attribute = (IDL_STRING *) argv[2]; CHECKINDEX(n); err = PvAttrIsAvailable(camera[n], IDL_STRING_STR(attribute)); return idlPvErrCode(err); }
bool Camera::hasAttribute(const std::string &name) { return (PvAttrIsAvailable(handle_, name.c_str()) == ePvErrSuccess); }