Zivid  1.0.1+3607.8a7510c4
Zivid API
Public Types | Public Member Functions | List of all members
Zivid::Camera Class Reference

Interface to one Zivid camera More...

#include <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 Camera ()
 Constructor More...
 
ZIVID_API ~Camera ()
 Destructor More...
 
ZIVID_API Camera (const Camera &other) noexcept
 Copy constructor More...
 
ZIVID_API Cameraoperator= (const Camera &other) noexcept
 Copy assignment More...
 
ZIVID_API Camera (Camera &&other) noexcept
 Move constructor More...
 
ZIVID_API Cameraoperator= (Camera &&other) noexcept
 Move assignment operator More...
 
ZIVID_API Cameraconnect ()
 Connect to the camera More...
 
ZIVID_API Cameraconnect (const Settings &settings)
 Connect to the camera More...
 
ZIVID_API void disconnect ()
 Disconnect from the camera and free all resources associated with it More...
 
ZIVID_API void setSettings (Settings settings)
 Update the camera settings More...
 
ZIVID_API Settings settings () const
 Get the current camera settings More...
 
ZIVID_API DeviceCloud allocateDeviceCloud ()
 Allocate a new point cloud on the Compute device More...
 
ZIVID_API CameraState state () const
 Get the current camera state More...
 
ZIVID_API void setComputeDevice (ComputeDevice device)
 Connect the camera to a given Compute device More...
 
ZIVID_API void setFrameCallback (FrameCallback callback)
 Set a callback that is executed every time a new frame is ready More...
 
ZIVID_API void startLive ()
 Start live (continuous) capturing of frames More...
 
ZIVID_API void stopLive ()
 Stop live (continuous) capturing of frames More...
 
ZIVID_API Frame capture ()
 Capture a single frame More...
 
ZIVID_API Frame capture (DeviceCloud &deviceCloud)
 Capture a single frame using a device cloud that has been previously allocated More...
 
ZIVID_API ComputeDevice computeDevice ()
 Get Compute device More...
 
ZIVID_API std::string modelName () const
 Get the model name More...
 
ZIVID_API CameraRevision revision () const
 Get the camera revision More...
 
ZIVID_API SerialNumber serialNumber () const
 Get the serial number of the Zivid camera More...
 
ZIVID_API std::string firmwareVersion () const
 Get the camera's firmware version More...
 
ZIVID_API std::string toString () const
 Get string representation of the camera info More...
 
ZIVID_API bool operator== (const Camera &other) const
 check if two camera instances represent the same device More...
 
ZIVID_API bool operator!= (const Camera &other) const
 check if two camera instances represent the 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 snapshots 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 Zivid::Camera::Camera ( )

Constructor

◆ ~Camera()

ZIVID_API Zivid::Camera::~Camera ( )

Destructor

◆ Camera() [2/3]

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

Copy constructor

◆ Camera() [3/3]

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

Move constructor

Member Function Documentation

◆ allocateDeviceCloud()

ZIVID_API 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 Frame Zivid::Camera::capture ( )

Capture a single frame

Returns
A frame containing a 3D image and metadata

◆ capture() [2/2]

ZIVID_API 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

◆ computeDevice()

ZIVID_API ComputeDevice Zivid::Camera::computeDevice ( )

Get Compute device

Returns
The Compute device connected to the camera

◆ connect() [1/2]

ZIVID_API Camera& Zivid::Camera::connect ( )

Connect to the camera

◆ connect() [2/2]

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

Connect to the camera

◆ disconnect()

ZIVID_API void Zivid::Camera::disconnect ( )

Disconnect from the camera and free all resources associated with it

◆ firmwareVersion()

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

Get the camera's firmware version

◆ modelName()

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

Get the model name

◆ operator!=()

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

check if two camera instances represent the different devices

◆ operator=() [1/2]

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

Copy assignment

◆ operator=() [2/2]

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

Move assignment operator

◆ operator==()

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

check if two camera instances represent the same device

◆ revision()

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

Get the camera revision

◆ serialNumber()

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

Get the serial number of the Zivid camera

◆ setComputeDevice()

ZIVID_API 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 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 void Zivid::Camera::setSettings ( Settings  settings)

Update the camera settings

Parameters
settingsNew settings for the camera

◆ settings()

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

Get the current camera settings

Returns
Current settings

◆ startLive()

ZIVID_API void Zivid::Camera::startLive ( )

Start live (continuous) capturing of frames

The system will capture frames continuously until stopped

See also
stopLive

◆ state()

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

Get the current camera state

Returns
The current camera state

◆ stopLive()

ZIVID_API void Zivid::Camera::stopLive ( )

Stop live (continuous) capturing of frames

This call will block until live mode stops

See also
startLive

◆ toString()

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

Get string representation of the camera info

Returns
Camera info as string

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