Zivid C++ API 2.11.1+de9b5dae-1
Public Member Functions | List of all members
Zivid::Application Class Reference

Manager class for Zivid. More...

#include <Zivid/Application.h>

Public Member Functions

 Application ()
 Constructor.
 
ZIVID_CORE_EXPORT Camera connectCamera ()
 Connect to the next available Zivid camera.
 
ZIVID_CORE_EXPORT Camera connectCamera (const CameraInfo::SerialNumber &serialNumber)
 Connect to the Zivid camera with the specified serial number.
 
ZIVID_CORE_EXPORT Camera createFileCamera (const std::string &cameraFile)
 Create a virtual camera to simulate Zivid measurements by reading data from a file.
 
ZIVID_CORE_EXPORT std::vector< Cameracameras ()
 Get a list of all cameras.
 
ZIVID_CORE_EXPORT ComputeDevice computeDevice () const
 The default compute device, used when connecting to new cameras.
 
ZIVID_CORE_EXPORT std::string toString () const
 Get string representation of the application.
 

Detailed Description

Manager class for Zivid.

The Application class manages resources used by the Zivid SDK. It is required to have one instance of this class alive while using the SDK. Using any part of the SDK without a live Application is undefined behavior.

It is not possible to have more than one Application instance at a time. Creating a second Application instance before the first Application instance has been destroyed will trigger an exception. All objects (cameras, frames, etc.) from the previous Application instance must destroyed before a new instance can be created.

Constructor & Destructor Documentation

◆ Application()

Zivid::Application::Application ( )
inline

Constructor.

Member Function Documentation

◆ cameras()

ZIVID_CORE_EXPORT std::vector< Camera > Zivid::Application::cameras ( )

Get a list of all cameras.

Returns
A list of cameras including all physical cameras as well as virtual ones (e.g. cameras created by createFileCamera())

This method will return all discovered cameras that are connected to your PC or local network. This may include cameras that are not connectable from the SDK, because of misconfigured camera/PC network settings, etc. Check the CameraState Status enum to determine the state of a particular camera.

◆ computeDevice()

ZIVID_CORE_EXPORT ComputeDevice Zivid::Application::computeDevice ( ) const

The default compute device, used when connecting to new cameras.

Returns
A compute device

◆ connectCamera() [1/2]

ZIVID_CORE_EXPORT Camera Zivid::Application::connectCamera ( )

Connect to the next available Zivid camera.

Returns
Zivid camera instance

This method will throw an exception if no camera is currently in Available state.

◆ connectCamera() [2/2]

ZIVID_CORE_EXPORT Camera Zivid::Application::connectCamera ( const CameraInfo::SerialNumber serialNumber)

Connect to the Zivid camera with the specified serial number.

Parameters
serialNumberConnect to the camera with this serial number
Returns
Zivid camera instance

◆ createFileCamera()

ZIVID_CORE_EXPORT Camera Zivid::Application::createFileCamera ( const std::string &  cameraFile)

Create a virtual camera to simulate Zivid measurements by reading data from a file.

Parameters
cameraFileData file in ZFC format containing a Zivid File Camera
Returns
Zivid virtual camera instance

An example file camera may be found at zivid.com/downloads

◆ toString()

ZIVID_CORE_EXPORT std::string Zivid::Application::toString ( ) const

Get string representation of the application.

Returns
Application info as string

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