![]() |
Zivid C++ API
1.8.1+6967bc1b-1
Defining the Future of 3D Machine Vision
|
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 Camera & | operator= (const Camera &other) noexcept |
Copy assignment More... | |
ZIVID_API_EXPORT | Camera (Camera &&other) noexcept |
Move constructor More... | |
ZIVID_API_EXPORT Camera & | operator= (Camera &&other) noexcept |
Move assignment operator More... | |
ZIVID_API_EXPORT Camera & | connect () |
Connect to the camera More... | |
ZIVID_API_EXPORT Camera & | connect (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... | |
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.
using Zivid::Camera::FrameCallback = std::function<void(Frame)> |
Callback for frames
using Zivid::Camera::StateCallback = std::function<void(CameraState)> |
Callback for state
ZIVID_API_EXPORT Zivid::Camera::Camera | ( | ) |
Constructor
ZIVID_API_EXPORT Zivid::Camera::~Camera | ( | ) |
Destructor
|
noexcept |
Copy constructor
|
noexcept |
Move constructor
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.
ZIVID_API_EXPORT Frame Zivid::Camera::capture | ( | ) |
Capture a single 3D frame
ZIVID_API_EXPORT Frame Zivid::Camera::capture | ( | DeviceCloud & | deviceCloud | ) |
Capture a single frame using a device cloud that has been previously allocated
deviceCloud | A pre-allocated device cloud to capture into |
ZIVID_API_EXPORT Frame2D Zivid::Camera::capture2D | ( | const Settings2D & | settings | ) |
Capture a single 2D frame
settings | Settings to use for the capture |
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().
ZIVID_API_EXPORT ComputeDevice Zivid::Camera::computeDevice | ( | ) |
Get Compute device
ZIVID_API_EXPORT Camera& Zivid::Camera::connect | ( | ) |
Connect to the camera
ZIVID_API_EXPORT Camera& Zivid::Camera::connect | ( | const Settings & | settings | ) |
Connect to the camera
settings | New settings for the camera |
ZIVID_API_EXPORT void Zivid::Camera::disconnect | ( | ) |
Disconnect from the camera and free all resources associated with it
ZIVID_API_EXPORT std::string Zivid::Camera::firmwareVersion | ( | ) | const |
Get the camera's firmware version
ZIVID_API_EXPORT CameraIntrinsics Zivid::Camera::intrinsics | ( | ) | const |
Get the intrinsic parameters of the camera
ZIVID_API_EXPORT std::string Zivid::Camera::modelName | ( | ) | const |
Get the model name
ZIVID_API_EXPORT bool Zivid::Camera::operator!= | ( | const Camera & | other | ) | const |
Check if two camera instances represent different devices
|
noexcept |
Move assignment operator
|
noexcept |
Copy assignment
ZIVID_API_EXPORT bool Zivid::Camera::operator== | ( | const Camera & | other | ) | const |
Check if two camera instances represent the same device
ZIVID_API_EXPORT CameraRevision Zivid::Camera::revision | ( | ) | const |
Get the camera revision
ZIVID_API_EXPORT SerialNumber Zivid::Camera::serialNumber | ( | ) | const |
Get the serial number of the Zivid camera
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.
device | A Compute device |
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
callback | New frame callback |
ZIVID_API_EXPORT void Zivid::Camera::setSettings | ( | Settings | settings | ) |
Update the camera settings
settings | New settings for the camera |
ZIVID_API_EXPORT Settings Zivid::Camera::settings | ( | ) | const |
Get the current camera settings
ZIVID_API_EXPORT void Zivid::Camera::startLive | ( | ) |
Start live (continuous) capturing of frames
The system will capture frames continuously until stopped
ZIVID_API_EXPORT CameraState Zivid::Camera::state | ( | ) | const |
Get the current camera state
ZIVID_API_EXPORT void Zivid::Camera::stopLive | ( | ) |
Stop live (continuous) capturing of frames
This call will block until live mode stops
ZIVID_API_EXPORT std::string Zivid::Camera::toString | ( | ) | const |
Get string representation of the camera info
ZIVID_API_EXPORT std::vector<uint8_t> Zivid::Camera::userData | ( | ) | const |
Read user data from camera
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
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