SSCMA-Micro CPP SDK  v2.0.0
SSCMA-Micro is a cross-platform machine learning inference framework designed for embedded devices.
ma::Camera Class Referenceabstract

#include <ma_camera.h>

Inheritance diagram for ma::Camera:
Collaboration diagram for ma::Camera:

Classes

struct  CtrlValue
 

Public Types

enum  StreamMode : int { kUnknown , kRefreshOnReturn , kRefreshOnRetrieve }
 
enum  CtrlType : int {
  kWindow , kExposure , kGain , kWhiteBalance ,
  kFocus , kZoom , kPan , kTilt ,
  kIris , kShutter , kBrightness , kContrast ,
  kSaturation , kHue , kSharpness , kGamma ,
  kColorTemperature , kBacklightCompensation , kRotate , kFormat ,
  kChannel , kFps , kRegister
}
 
enum  CtrlMode : int { kRead , kWrite }
 
- Public Types inherited from ma::Sensor
enum class  Type : int { kUnknown = 0 , kCamera = 1 , kMicrophone = 2 , kIMU = 3 }
 
using Presets = std::vector< Preset >
 

Public Member Functions

 Camera (size_t id) noexcept
 
virtual ~Camera ()=default
 
virtual ma_err_t startStream (StreamMode mode) noexcept=0
 
virtual void stopStream () noexcept=0
 
virtual ma_err_t commandCtrl (CtrlType ctrl, CtrlMode mode, CtrlValue &value) noexcept=0
 
virtual ma_err_t retrieveFrame (ma_img_t &frame, ma_pixel_format_t format) noexcept=0
 
virtual void returnFrame (ma_img_t &frame) noexcept=0
 
bool isStreaming () const noexcept
 
- Public Member Functions inherited from ma::Sensor
 Sensor (size_t id, Type type) noexcept
 
virtual ~Sensor ()=default
 
virtual ma_err_t init (size_t preset_idx) noexcept=0
 
virtual void deInit () noexcept=0
 
 operator bool () const noexcept
 
size_t getID () const noexcept
 
Type getType () const noexcept
 
const PresetsavailablePresets () const noexcept
 
const PresetcurrentPreset () const noexcept
 
const size_t currentPresetIdx () const noexcept
 

Static Public Member Functions

static std::string __repr__ (StreamMode mode) noexcept
 
- Static Public Member Functions inherited from ma::Sensor
static std::string __repr__ (Type type) noexcept
 

Protected Attributes

bool m_streaming
 
StreamMode m_stream_mode
 
- Protected Attributes inherited from ma::Sensor
const size_t m_id
 
const Type m_type
 
bool m_initialized
 
size_t m_preset_idx
 
Presets m_presets
 

Member Enumeration Documentation

◆ CtrlMode

Enumerator
kRead 
kWrite 

◆ CtrlType

Enumerator
kWindow 
kExposure 
kGain 
kWhiteBalance 
kFocus 
kZoom 
kPan 
kTilt 
kIris 
kShutter 
kBrightness 
kContrast 
kSaturation 
kHue 
kSharpness 
kGamma 
kColorTemperature 
kBacklightCompensation 
kRotate 
kFormat 
kChannel 
kFps 
kRegister 

◆ StreamMode

Enumerator
kUnknown 
kRefreshOnReturn 
kRefreshOnRetrieve 

Constructor & Destructor Documentation

◆ Camera()

ma::Camera::Camera ( size_t  id)
inlinenoexcept

◆ ~Camera()

virtual ma::Camera::~Camera ( )
virtualdefault

Member Function Documentation

◆ __repr__()

static std::string ma::Camera::__repr__ ( StreamMode  mode)
inlinestaticnoexcept

◆ commandCtrl()

virtual ma_err_t ma::Camera::commandCtrl ( CtrlType  ctrl,
CtrlMode  mode,
CtrlValue value 
)
pure virtualnoexcept

◆ isStreaming()

bool ma::Camera::isStreaming ( ) const
inlinenoexcept

◆ retrieveFrame()

virtual ma_err_t ma::Camera::retrieveFrame ( ma_img_t frame,
ma_pixel_format_t  format 
)
pure virtualnoexcept

◆ returnFrame()

virtual void ma::Camera::returnFrame ( ma_img_t frame)
pure virtualnoexcept

◆ startStream()

virtual ma_err_t ma::Camera::startStream ( StreamMode  mode)
pure virtualnoexcept

◆ stopStream()

virtual void ma::Camera::stopStream ( )
pure virtualnoexcept

Member Data Documentation

◆ m_stream_mode

StreamMode ma::Camera::m_stream_mode
protected

◆ m_streaming

bool ma::Camera::m_streaming
protected