Xavia SDK c++ API 2.1.0
API description of the xavia library
Loading...
Searching...
No Matches
ICamera Class Referenceabstract

Camera object interface. More...

Public Member Functions

virtual std::string GetCameraId () const =0
 Get the camera identifier.
virtual std::wstring GetCameraIdW () const =0
 Get the camera identifier, wide format.
virtual std::uint32_t GetExposureTimeUs () const =0
 Get the current camera exposure time.
virtual bool HasWriteAccess ()=0
 Check if we have write access to the camera configuration.
virtual bool IsStreaming () const =0
 Check if camera is currently streaming.
virtual void ResetConfiguration ()=0
 Reset camera configuration to default (factory) values.
virtual void SetExposureTimeUs (const std::uint32_t exposureTimeUs)=0
 Set the camera exposure time.
virtual void Start (const std::size_t &timeoutMS=DEFAULT_CAMERA_TIMEOUT_MS)=0
 Starts the camera streaming.
virtual void Stop (const std::size_t &timeoutMS=DEFAULT_CAMERA_TIMEOUT_MS)=0
 Stop the camera streaming.

Detailed Description

Camera object interface.

This class defines the interface for a camera. It provides methods to start, stop, and control the camera independently from the lidar sensor.

Access the camera via ISensor::GetCamera() which returns nullptr if no camera was configured during sensor build.

See also
ISensor::GetCamera()
SensorFactory for configuring camera during sensor creation

Member Function Documentation

◆ GetCameraId()

virtual std::string GetCameraId ( ) const
pure virtual

Get the camera identifier.

Returns
String identifying the camera (e.g., serial number, model)

Returns a string that uniquely identifies this camera, typically the serial number or model name from the camera hardware.

◆ GetCameraIdW()

virtual std::wstring GetCameraIdW ( ) const
pure virtual

Get the camera identifier, wide format.

Returns
String identifying the camera (e.g., serial number, model)

Returns a string that uniquely identifies this camera, typically the serial number or model name from the camera hardware.

◆ GetExposureTimeUs()

virtual std::uint32_t GetExposureTimeUs ( ) const
pure virtual

Get the current camera exposure time.

Returns
Current exposure time in microseconds

Returns the currently configured exposure time. This reflects the value set by SetExposureTimeUs or the default if never changed.

◆ HasWriteAccess()

virtual bool HasWriteAccess ( )
pure virtual

Check if we have write access to the camera configuration.

Returns
true if we have write access, false if not.

Without write access the SDK cannot change any camera settings or start and stop the stream. Write access is provided only to the first client that connects to the camera.

◆ IsStreaming()

virtual bool IsStreaming ( ) const
pure virtual

Check if camera is currently streaming.

Returns
true if camera is streaming, false otherwise

◆ ResetConfiguration()

virtual void ResetConfiguration ( )
pure virtual

Reset camera configuration to default (factory) values.

Warning, this will overwrite any configuration settings for: Exposure, gain, triggering, framerate, PixelFormat

◆ SetExposureTimeUs()

virtual void SetExposureTimeUs ( const std::uint32_t exposureTimeUs)
pure virtual

Set the camera exposure time.

Parameters
exposureTimeUsExposure time in microseconds
Exceptions
sdk::exceptionobject if exposure time cannot be set or is out of valid range.

Sets the exposure time for the camera. The camera will use this exposure time for all subsequent frames. This can be called while the camera is streaming.

Valid range depends on camera hardware. Typical range: 20us - 1000000us (1 second).

◆ Start()

virtual void Start ( const std::size_t & timeoutMS = DEFAULT_CAMERA_TIMEOUT_MS)
pure virtual

Starts the camera streaming.

Parameters
timeoutMSTimeout in milliseconds for camera to start (optional, default is 5 sec)
Exceptions
sdk::exceptionobject if camera fails to start within timeout.

Start means that the camera begins streaming images which will be delivered via the image callback registered on SensorFactory.

It is only valid to call this function if the camera is not already streaming. An exception is thrown if the camera fails to start.

◆ Stop()

virtual void Stop ( const std::size_t & timeoutMS = DEFAULT_CAMERA_TIMEOUT_MS)
pure virtual

Stop the camera streaming.

Parameters
timeoutMSTimeout in milliseconds for camera to stop (optional, default is 5 sec)
Exceptions
sdk::exceptionobject if camera fails to stop within timeout.

Stop means that the camera stops streaming images and no further callbacks will occur.

It is only valid to call this function if the camera is currently streaming. An exception is thrown if the camera fails to stop.