SmartSpectra C++ SDK
Measure human vitals from video with SmartSpectra C++ SDK.
Loading...
Searching...
No Matches
presage::smartspectra::video_source::VideoSource Class Referenceabstract

Abstract interface for camera/video input sources. More...

#include <video_source.hpp>

Inheritance diagram for presage::smartspectra::video_source::VideoSource:
presage::smartspectra::video_source::capture::CaptureCameraSource presage::smartspectra::video_source::capture::CaptureVideoFileSource presage::smartspectra::video_source::file_stream::FileStreamVideoSource presage::smartspectra::video_source::v4l2::V4l2CameraSource presage::smartspectra::video_source::capture::CaptureVideoAndTimeStampFile

Public Member Functions

VideoSourceoperator>> (cv::Mat &frame)
virtual absl::Status Initialize (const VideoSourceSettings &settings)
virtual bool SupportsExactFrameTimestamp () const =0
virtual int64_t GetFrameTimestamp () const =0
virtual absl::Status TurnOnAutoExposure ()
 Enable automatic exposure mode.
virtual absl::Status TurnOffAutoExposure ()
 Disable automatic exposure and switch to manual mode.
virtual absl::Status ToggleAutoExposure ()
 Toggle between automatic and manual exposure modes.
virtual absl::StatusOr< bool > IsAutoExposureOn ()
 Check if automatic exposure is currently enabled.
virtual absl::Status IncreaseExposure ()
 Increase exposure by a fixed hardware-specific step.
virtual absl::Status DecreaseExposure ()
 Decrease exposure by a fixed hardware-specific step.
virtual absl::Status SetExposure (double value)
 Set exposure to a normalized value.
virtual absl::StatusOr< double > GetExposure ()
 Get current exposure as a normalized value.
virtual bool SupportsExposureControls ()
 Check if this video source supports exposure controls.
virtual bool SupportsWhiteBalanceControls ()
 Check if this video source supports white balance controls.
virtual absl::Status TurnOnAutoWhiteBalance ()
 Enable automatic white balance mode.
virtual absl::Status TurnOffAutoWhiteBalance ()
 Disable automatic white balance and switch to manual mode.
virtual absl::Status ToggleAutoWhiteBalance ()
 Toggle between automatic and manual white balance modes.
virtual absl::StatusOr< bool > IsAutoWhiteBalanceOn ()
 Check if automatic white balance is currently enabled.
virtual absl::Status IncreaseWhiteBalance ()
 Increase white balance temperature by a fixed hardware-specific step.
virtual absl::Status DecreaseWhiteBalance ()
 Decrease white balance temperature by a fixed hardware-specific step.
virtual absl::Status SetWhiteBalance (double value)
 Set white balance temperature to a normalized value.
virtual absl::StatusOr< double > GetWhiteBalance ()
 Get current white balance temperature as a normalized value.
virtual bool SupportsGainControl ()
 Check if this video source supports gain controls.
virtual absl::Status IncreaseGain ()
 Increase gain by a fixed hardware-specific step.
virtual absl::Status DecreaseGain ()
 Decrease gain by a fixed hardware-specific step.
virtual absl::Status SetGain (double value)
 Set gain to a normalized value.
virtual absl::StatusOr< double > GetGain ()
 Get current gain as a normalized value.
virtual int GetWidth ()
virtual int GetHeight ()
virtual InputTransformMode GetDefaultInputTransformMode ()
bool HasFrameDimensions ()
virtual bool SupportsCompressedOutput ()
virtual bool ProduceCompressedFrame (std::vector< uint8_t > &jpeg_data)

Protected Member Functions

virtual void ProducePreTransformFrame (cv::Mat &frame)=0

Protected Attributes

InputTransformer input_transformer

Detailed Description

Abstract interface for camera/video input sources.

Member Function Documentation

◆ DecreaseExposure()

absl::Status presage::smartspectra::video_source::VideoSource::DecreaseExposure ( )
virtual

Decrease exposure by a fixed hardware-specific step.

Returns
Status indicating success or failure.
Note
Only works in manual exposure mode.

Reimplemented in presage::smartspectra::video_source::capture::CaptureCameraSource, and presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ DecreaseGain()

absl::Status presage::smartspectra::video_source::VideoSource::DecreaseGain ( )
virtual

Decrease gain by a fixed hardware-specific step.

Returns
Status indicating success or failure.

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ DecreaseWhiteBalance()

absl::Status presage::smartspectra::video_source::VideoSource::DecreaseWhiteBalance ( )
virtual

Decrease white balance temperature by a fixed hardware-specific step.

Returns
Status indicating success or failure.
Note
Only works in manual white balance mode.

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ GetExposure()

absl::StatusOr< double > presage::smartspectra::video_source::VideoSource::GetExposure ( )
virtual

Get current exposure as a normalized value.

Returns
StatusOr containing normalized exposure value in range [0.0, 1.0].
Note
Hardware values are automatically normalized for consistent API.

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ GetFrameTimestamp()

◆ GetGain()

absl::StatusOr< double > presage::smartspectra::video_source::VideoSource::GetGain ( )
virtual

Get current gain as a normalized value.

Returns
StatusOr containing normalized gain value in range [0.0, 1.0].
Note
Hardware gain values are automatically normalized for consistent API.

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ GetWhiteBalance()

absl::StatusOr< double > presage::smartspectra::video_source::VideoSource::GetWhiteBalance ( )
virtual

Get current white balance temperature as a normalized value.

Returns
StatusOr containing normalized white balance value in range [0.0, 1.0].
Note
Hardware temperature values are automatically normalized for consistent API.

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ HasFrameDimensions()

bool presage::smartspectra::video_source::VideoSource::HasFrameDimensions ( )

Check if the source has valid frame dimension information.

◆ IncreaseExposure()

absl::Status presage::smartspectra::video_source::VideoSource::IncreaseExposure ( )
virtual

Increase exposure by a fixed hardware-specific step.

Returns
Status indicating success or failure.
Note
Only works in manual exposure mode.

Reimplemented in presage::smartspectra::video_source::capture::CaptureCameraSource, and presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ IncreaseGain()

absl::Status presage::smartspectra::video_source::VideoSource::IncreaseGain ( )
virtual

Increase gain by a fixed hardware-specific step.

Returns
Status indicating success or failure.

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ IncreaseWhiteBalance()

absl::Status presage::smartspectra::video_source::VideoSource::IncreaseWhiteBalance ( )
virtual

Increase white balance temperature by a fixed hardware-specific step.

Returns
Status indicating success or failure.
Note
Only works in manual white balance mode.

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ Initialize()

◆ IsAutoExposureOn()

absl::StatusOr< bool > presage::smartspectra::video_source::VideoSource::IsAutoExposureOn ( )
virtual

Check if automatic exposure is currently enabled.

Returns
StatusOr containing true if auto exposure is on, false otherwise.

Reimplemented in presage::smartspectra::video_source::capture::CaptureCameraSource, and presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ IsAutoWhiteBalanceOn()

absl::StatusOr< bool > presage::smartspectra::video_source::VideoSource::IsAutoWhiteBalanceOn ( )
virtual

Check if automatic white balance is currently enabled.

Returns
StatusOr containing true if auto white balance is on, false otherwise.

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ operator>>()

VideoSource & presage::smartspectra::video_source::VideoSource::operator>> ( cv::Mat & frame)

Grab the next frame from the source.

◆ ProduceCompressedFrame()

bool presage::smartspectra::video_source::VideoSource::ProduceCompressedFrame ( std::vector< uint8_t > & jpeg_data)
virtual

Get the next frame as compressed JPEG data (if supported). Only call this if SupportsCompressedOutput() returns true.

Parameters
jpeg_dataOutput buffer for compressed JPEG data
Returns
true if a compressed frame was successfully retrieved

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ SetExposure()

absl::Status presage::smartspectra::video_source::VideoSource::SetExposure ( double value)
virtual

Set exposure to a normalized value.

Parameters
valueNormalized exposure value in range [0.0, 1.0] where 0.0 is minimum and 1.0 is maximum.
Returns
Status indicating success or failure.
Note
Values are automatically mapped to hardware-specific ranges.

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ SetGain()

absl::Status presage::smartspectra::video_source::VideoSource::SetGain ( double value)
virtual

Set gain to a normalized value.

Parameters
valueNormalized gain value in range [0.0, 1.0] where 0.0 is minimum and 1.0 is maximum.
Returns
Status indicating success or failure.
Note
Values are automatically mapped to hardware-specific gain ranges.

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ SetWhiteBalance()

absl::Status presage::smartspectra::video_source::VideoSource::SetWhiteBalance ( double value)
virtual

Set white balance temperature to a normalized value.

Parameters
valueNormalized white balance value in range [0.0, 1.0] where 0.0 is coolest and 1.0 is warmest.
Returns
Status indicating success or failure.
Note
Values are automatically mapped to hardware-specific temperature ranges (typically 2800K-6500K).

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ SupportsCompressedOutput()

bool presage::smartspectra::video_source::VideoSource::SupportsCompressedOutput ( )
virtual

Check if this video source can provide compressed JPEG frames directly. This allows bypassing recompression when the source already provides MJPEG.

Returns
true if ProduceCompressedFrame() is supported

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ SupportsExposureControls()

bool presage::smartspectra::video_source::VideoSource::SupportsExposureControls ( )
virtual

Check if this video source supports exposure controls.

Returns
true if exposure controls are available, false otherwise.

Reimplemented in presage::smartspectra::video_source::capture::CaptureCameraSource, and presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ SupportsGainControl()

bool presage::smartspectra::video_source::VideoSource::SupportsGainControl ( )
virtual

Check if this video source supports gain controls.

Returns
true if gain controls are available, false otherwise.

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ SupportsWhiteBalanceControls()

bool presage::smartspectra::video_source::VideoSource::SupportsWhiteBalanceControls ( )
virtual

Check if this video source supports white balance controls.

Returns
true if white balance controls are available, false otherwise.

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ ToggleAutoExposure()

absl::Status presage::smartspectra::video_source::VideoSource::ToggleAutoExposure ( )
virtual

Toggle between automatic and manual exposure modes.

Returns
Status indicating success or failure.

Reimplemented in presage::smartspectra::video_source::capture::CaptureCameraSource, and presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ ToggleAutoWhiteBalance()

absl::Status presage::smartspectra::video_source::VideoSource::ToggleAutoWhiteBalance ( )
virtual

Toggle between automatic and manual white balance modes.

Returns
Status indicating success or failure.

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ TurnOffAutoExposure()

absl::Status presage::smartspectra::video_source::VideoSource::TurnOffAutoExposure ( )
virtual

Disable automatic exposure and switch to manual mode.

Returns
Status indicating success or failure.

Reimplemented in presage::smartspectra::video_source::capture::CaptureCameraSource, and presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ TurnOffAutoWhiteBalance()

absl::Status presage::smartspectra::video_source::VideoSource::TurnOffAutoWhiteBalance ( )
virtual

Disable automatic white balance and switch to manual mode.

Returns
Status indicating success or failure.

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ TurnOnAutoExposure()

absl::Status presage::smartspectra::video_source::VideoSource::TurnOnAutoExposure ( )
virtual

Enable automatic exposure mode.

Returns
Status indicating success or failure.

Reimplemented in presage::smartspectra::video_source::capture::CaptureCameraSource, and presage::smartspectra::video_source::v4l2::V4l2CameraSource.

◆ TurnOnAutoWhiteBalance()

absl::Status presage::smartspectra::video_source::VideoSource::TurnOnAutoWhiteBalance ( )
virtual

Enable automatic white balance mode.

Returns
Status indicating success or failure.

Reimplemented in presage::smartspectra::video_source::v4l2::V4l2CameraSource.


The documentation for this class was generated from the following files:
  • smartspectra/video_source/video_source.hpp
  • smartspectra/video_source/video_source.cpp