11#define PROGRAM_NAME "camera-feature-demo"
27 auto mode = cam.
getParam<std::string>(
"AcquisitionMode");
30 auto fpsEnable = cam.
getParam<
bool>(
"AcquisitionFrameRateEnable");
31 auto fps = cam.
getParam<
double>(
"AcquisitionFrameRate");
40 auto newExposure = std::chrono::microseconds(15000);
41 auto actualNewExposure = cam.
setExposure(newExposure);
43 "New exposure set to: {}, actual value now: {}",
48 auto newAcquisitionFrameRateEnable =
true;
49 auto actualAcquisitionFrameRateEnable =
50 cam.
setParam(
"AcquisitionFrameRateEnable", newAcquisitionFrameRateEnable);
52 "New acquisition frame rate enablement set to: {}, actual value now: {}",
53 newAcquisitionFrameRateEnable,
54 actualAcquisitionFrameRateEnable);
55 auto newAcquisitionFrameRate = 12.5;
56 auto actualAcquisitionFrameRate = cam.
setParam(
"AcquisitionFrameRate", newAcquisitionFrameRate);
58 "New acquisition frame rate set to: {}, actual value now: {}",
59 newAcquisitionFrameRate,
60 actualAcquisitionFrameRate);
63 cam.
setParam(
"AcquisitionMode",
"SingleFrame");
80 "Captured image: {}x{} ({} bytes)", image.GetHeight(), image.GetWidth(), image.GetSize());
High-level wrapper around the NeoAPI camera for synchronized access.
std::string cameraStatusAsString() const
Get current camera status.
image_t captureImage(std::optional< irsol::types::duration_t > timeout=std::nullopt)
Capture a single image from the camera.
static Interface HalfResolution()
Factory method to create a camera interface using half sensor resolution.
T setParam(const std::string ¶m, T value)
Set a camera parameter of arbitrary type T.
T getParam(const std::string ¶m) const
Retrieve a camera parameter of arbitrary type T.
irsol::types::duration_t setExposure(irsol::types::duration_t exposure)
Set the exposure time of the camera.
void setMultiParam(const std::unordered_map< std::string, camera_param_t > ¶ms)
Set multiple parameters in one call.
irsol::types::duration_t getExposure() const
Get the current exposure time from the camera.
const std::string getProgramName()
Returns the program name, typically used for logging. If PROGRAM_NAME is not defined at compile time,...
void demoCameraFeatures(irsol::camera::Interface &cam)
Initializes camera and logs various feature values.
void initAssertHandler()
Initializes the assertion handler system.
#define IRSOL_ASSERT_FATAL
Fatal-level assertion macro.
#define IRSOL_LOG_INFO(...)
Logs an info-level message using the default logger.
#define IRSOL_LOG_WARN(...)
Logs a warning-level message using the default logger.
void initLogging(const char *fileSinkFilename="logs/irsol.log", std::optional< spdlog::level::level_enum > minLogLevel=std::nullopt)
Initializes the irsol logging system.
std::string discoverCameraFeatures(Interface &cam)
Discovers all camera features and their permissions.
std::string durationToString(irsol::types::duration_t dr)
Converts a duration to a human-readable string.