Zivid C++ API  1.8.1+6967bc1b-1
Defining the Future of 3D Machine Vision
Public Types | Public Member Functions | List of all members
Zivid::Camera Class Reference

Interface to one Zivid camera More...

#include <Zivid/Camera.h>

Public Types

using FrameCallback = std::function< void(Frame)>
 Callback for frames More...
 
using StateCallback = std::function< void(CameraState)>
 Callback for state More...
 

Public Member Functions

ZIVID_API_EXPORT Camera ()
 Constructor More...
 
ZIVID_API_EXPORT ~Camera ()
 Destructor More...
 
ZIVID_API_EXPORT Camera (const Camera &other) noexcept
 Copy constructor More...
 
ZIVID_API_EXPORT Cameraoperator= (const Camera &other) noexcept
 Copy assignment More...
 
ZIVID_API_EXPORT Camera (Camera &&other) noexcept
 Move constructor More...
 
ZIVID_API_EXPORT Cameraoperator= (Camera &&other) noexcept
 Move assignment operator More...
 
ZIVID_API_EXPORT Cameraconnect ()
 Connect to the camera More...
 
ZIVID_API_EXPORT Cameraconnect (const Settings &settings)
 Connect to the camera More...
 
ZIVID_API_EXPORT void disconnect ()
 Disconnect from the camera and free all resources associated with it More...
 
ZIVID_API_EXPORT void setSettings (Settings settings)
 Update the camera settings More...
 
ZIVID_API_EXPORT Settings settings () const
 Get the current camera settings More...
 
ZIVID_API_EXPORT DeviceCloud allocateDeviceCloud ()
 Allocate a new point cloud on the Compute device More...
 
ZIVID_API_EXPORT CameraState state () const
 Get the current camera state More...
 
ZIVID_API_EXPORT void setComputeDevice (ComputeDevice device)
 Connect the camera to a given Compute device More...
 
ZIVID_API_EXPORT void setFrameCallback (FrameCallback callback)
 Set a callback that is executed every time a new frame is ready More...
 
ZIVID_API_EXPORT void startLive ()
 Start live (continuous) capturing of frames More...
 
ZIVID_API_EXPORT void stopLive ()
 Stop live (continuous) capturing of frames More...
 
ZIVID_API_EXPORT Frame capture ()
 Capture a single 3D frame More...
 
ZIVID_API_EXPORT Frame capture (DeviceCloud &deviceCloud)
 Capture a single frame using a device cloud that has been previously allocated More...
 
ZIVID_API_EXPORT Frame2D capture2D (const Settings2D &settings)
 Capture a single 2D frame More...
 
ZIVID_API_EXPORT ComputeDevice computeDevice ()
 Get Compute device More...
 
ZIVID_API_EXPORT std::string modelName () const
 Get the model name More...
 
ZIVID_API_EXPORT CameraRevision revision () const
 Get the camera revision More...
 
ZIVID_API_EXPORT SerialNumber serialNumber () const
 Get the serial number of the Zivid camera More...
 
ZIVID_API_EXPORT std::string firmwareVersion () const
 Get the camera's firmware version More...
 
ZIVID_API_EXPORT size_t userDataMaxSizeBytes () const
 Get the maximum number of bytes of user data that can be stored in the camera More...
 
ZIVID_API_EXPORT void writeUserData (const std::vector< uint8_t > &data)
 Write user data to camera. The total number of writes supported depends on camera model and size of data More...
 
ZIVID_API_EXPORT std::vector< uint8_t > userData () const
 Read user data from camera More...
 
ZIVID_API_EXPORT CameraIntrinsics intrinsics () const
 Get the intrinsic parameters of the camera More...
 
ZIVID_API_EXPORT std::string toString () const
 Get string representation of the camera info More...
 
ZIVID_API_EXPORT bool operator== (const Camera &other) const
 Check if two camera instances represent the same device More...
 
ZIVID_API_EXPORT bool operator!= (const Camera &other) const
 Check if two camera instances represent different devices More...
 

Detailed Description

Interface to one Zivid camera

See Settings for a list of settings that can be configured in the camera. Capture single frames by calling capture() or start continuous frame recording by using startLive.

Member Typedef Documentation

◆ FrameCallback

using Zivid::Camera::FrameCallback = std::function<void(Frame)>

Callback for frames

◆ StateCallback

using Zivid::Camera::StateCallback = std::function<void(CameraState)>

Callback for state

Constructor & Destructor Documentation

◆ Camera() [1/3]

ZIVID_API_EXPORT Zivid::Camera::Camera ( )

Constructor

◆ ~Camera()

ZIVID_API_EXPORT Zivid::Camera::~Camera ( )

Destructor

◆ Camera() [2/3]

ZIVID_API_EXPORT Zivid::Camera::Camera ( const Camera other)
noexcept

Copy constructor

◆ Camera() [3/3]

ZIVID_API_EXPORT Zivid::Camera::Camera ( Camera &&  other)
noexcept

Move constructor

Member Function Documentation

◆ allocateDeviceCloud()

ZIVID_API_EXPORT DeviceCloud Zivid::Camera::allocateDeviceCloud ( )

Allocate a new point cloud on the Compute device

Allocates a point cloud on the currently active ComputeDevice with dimensions that matches with the camera resolution.

Returns
A point cloud on the Compute device

◆ capture() [1/2]

ZIVID_API_EXPORT Frame Zivid::Camera::capture ( )

Capture a single 3D frame

Returns
A frame containing a 3D point cloud and metadata

◆ capture() [2/2]

ZIVID_API_EXPORT Frame Zivid::Camera::capture ( DeviceCloud deviceCloud)

Capture a single frame using a device cloud that has been previously allocated

Parameters
deviceCloudA pre-allocated device cloud to capture into
Returns
A frame containing a 3D image and metadata
See also
allocateDeviceCloud

◆ capture2D()

ZIVID_API_EXPORT Frame2D Zivid::Camera::capture2D ( const Settings2D settings)

Capture a single 2D frame

Parameters
settingsSettings to use for the capture
Returns
A frame containing a 2D image and metadata

Note that the provided settings will only apply to this current 2D capture, and not future 3D captures invoked via capture(), capture(DeviceCloud &deviceCloud) or startLive().

◆ computeDevice()

ZIVID_API_EXPORT ComputeDevice Zivid::Camera::computeDevice ( )

Get Compute device

Returns
The Compute device connected to the camera

◆ connect() [1/2]

ZIVID_API_EXPORT Camera& Zivid::Camera::connect ( )

Connect to the camera

◆ connect() [2/2]

ZIVID_API_EXPORT Camera& Zivid::Camera::connect ( const Settings settings)

Connect to the camera

Parameters
settingsNew settings for the camera

◆ disconnect()

ZIVID_API_EXPORT void Zivid::Camera::disconnect ( )

Disconnect from the camera and free all resources associated with it

◆ firmwareVersion()

ZIVID_API_EXPORT std::string Zivid::Camera::firmwareVersion ( ) const

Get the camera's firmware version

◆ intrinsics()

ZIVID_API_EXPORT CameraIntrinsics Zivid::Camera::intrinsics ( ) const

Get the intrinsic parameters of the camera

◆ modelName()

ZIVID_API_EXPORT std::string Zivid::Camera::modelName ( ) const

Get the model name

◆ operator!=()

ZIVID_API_EXPORT bool Zivid::Camera::operator!= ( const Camera other) const

Check if two camera instances represent different devices

◆ operator=() [1/2]

ZIVID_API_EXPORT Camera& Zivid::Camera::operator= ( Camera &&  other)
noexcept

Move assignment operator

◆ operator=() [2/2]

ZIVID_API_EXPORT Camera& Zivid::Camera::operator= ( const Camera other)
noexcept

Copy assignment

◆ operator==()

ZIVID_API_EXPORT bool Zivid::Camera::operator== ( const Camera other) const

Check if two camera instances represent the same device

◆ revision()

ZIVID_API_EXPORT CameraRevision Zivid::Camera::revision ( ) const

Get the camera revision

◆ serialNumber()

ZIVID_API_EXPORT SerialNumber Zivid::Camera::serialNumber ( ) const

Get the serial number of the Zivid camera

◆ setComputeDevice()

ZIVID_API_EXPORT void Zivid::Camera::setComputeDevice ( ComputeDevice  device)

Connect the camera to a given Compute device

The camera will produce point clouds on the supplied Compute device. In order to enable fast visualization of point clouds on the Compute device, a Compute device that supports visualization is typically created by CloudVisualizer.

Parameters
deviceA Compute device

◆ setFrameCallback()

ZIVID_API_EXPORT void Zivid::Camera::setFrameCallback ( FrameCallback  callback)

Set a callback that is executed every time a new frame is ready

See also startLive which triggers live grabbing and executes the supplied callback function for every new frame

Parameters
callbackNew frame callback

◆ setSettings()

ZIVID_API_EXPORT void Zivid::Camera::setSettings ( Settings  settings)

Update the camera settings

Parameters
settingsNew settings for the camera

◆ settings()

ZIVID_API_EXPORT Settings Zivid::Camera::settings ( ) const

Get the current camera settings

Returns
Current settings

◆ startLive()

ZIVID_API_EXPORT void Zivid::Camera::startLive ( )

Start live (continuous) capturing of frames

The system will capture frames continuously until stopped

See also
stopLive

◆ state()

ZIVID_API_EXPORT CameraState Zivid::Camera::state ( ) const

Get the current camera state

Returns
The current camera state

◆ stopLive()

ZIVID_API_EXPORT void Zivid::Camera::stopLive ( )

Stop live (continuous) capturing of frames

This call will block until live mode stops

See also
startLive

◆ toString()

ZIVID_API_EXPORT std::string Zivid::Camera::toString ( ) const

Get string representation of the camera info

Returns
Camera info as string

◆ userData()

ZIVID_API_EXPORT std::vector<uint8_t> Zivid::Camera::userData ( ) const

Read user data from camera

◆ userDataMaxSizeBytes()

ZIVID_API_EXPORT size_t Zivid::Camera::userDataMaxSizeBytes ( ) const

Get the maximum number of bytes of user data that can be stored in the camera

◆ writeUserData()

ZIVID_API_EXPORT void Zivid::Camera::writeUserData ( const std::vector< uint8_t > &  data)

Write user data to camera. The total number of writes supported depends on camera model and size of data


The documentation for this class was generated from the following file: