20#include <neoapi/neoapi.hpp>
24#include <unordered_map>
67 using camera_param_t = std::variant<bool, int, int64_t, double, std::string, const char*>;
139 return m_cam.IsConnected();
182 std::is_integral_v<T> || std::is_floating_point_v<T> || std::is_same_v<std::string, T>,
194 std::string
getParam(
const std::string& param)
const;
215 std::is_integral_v<std::decay_t<T>> || std::is_floating_point_v<std::decay_t<T>> ||
216 std::is_same_v<std::decay_t<T>, std::string>,
228 template<
typename T, std::enable_if_t<std::is_same_v<std::decay_t<T>, const
char*>,
int> = 0>
240 void setMultiParam(
const std::unordered_map<std::string, camera_param_t>& params);
247 void trigger(
const std::string& param);
282 std::is_integral_v<std::decay_t<T>> || std::is_floating_point_v<std::decay_t<T>> ||
283 std::is_same_v<std::decay_t<T>, std::string> ||
284 std::is_same_v<std::decay_t<T>,
const char*>,
Assertion macros and utilities based on the PPK_ASSERT library.
High-level wrapper around the NeoAPI camera for synchronized access.
std::variant< bool, int, int64_t, double, std::string, const char * > camera_param_t
Union of all supported types for camera parameters.
std::string cameraStatusAsString() const
Get current camera status.
void setParamNonThreadSafe(const std::string ¶m, T value)
Internal, non-thread-safe parameter setter used by setParam.
image_t captureImage(std::optional< irsol::types::duration_t > timeout=std::nullopt)
Capture a single image from the camera.
std::string setParam(const std::string ¶m, T value)
Specialization for setting const char* values as strings.
std::mutex m_camMutex
Mutex to protect access to camera parameters and image acquisition.
void trigger(const std::string ¶m)
Trigger a camera feature (e.g., software trigger).
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.
NeoAPI::Image image_t
Alias for the image type returned by the NeoAPI.
NeoAPI::Cam & getNeoCam()
Access the underlying NeoAPI camera instance.
std::string cameraInfoAsString() const
Get human-readable camera information.
irsol::types::duration_t setExposure(irsol::types::duration_t exposure)
Set the exposure time of the camera.
static constexpr irsol::types::duration_t DEFAULT_EXPOSURE_TIME
Default exposure time (2 milliseconds) used to initialize the camera.
bool isConnected() const
Check if the camera is currently connected.
Interface & operator=(Interface &&other)
Move assignment operator.
void resetSensorArea()
Reset the sensor area to the full sensor dimensions.
void setMultiParam(const std::unordered_map< std::string, camera_param_t > ¶ms)
Set multiple parameters in one call.
static Interface FullResolution()
Factory method to create a camera interface using full sensor resolution.
NeoAPI::Cam m_cam
Internal camera instance from NeoAPI.
irsol::types::duration_t getExposure() const
Get the current exposure time from the camera.
irsol::types::duration_t m_CachedExposureTime
clock_t::duration duration_t
Alias for a duration of time as defined by clock_t.
NeoAPI::Cam loadDefaultCamera()
Loads the default camera device.
Core type definitions for networking, time handling, and protocol values used throughout the irsol li...
General utility functions used throughout the irsol library.