IDS peak comfortC  v1.0.0
Camera

Data Structures

struct  peak_camera_descriptor
 peak Camera descriptor More...
 

Macros

#define PEAK_INVALID_CAMERA_ID
 peak Invalid camera ID value More...
 

Typedefs

typedef struct peak_camera * peak_camera_handle
 peak Camera handle More...
 
typedef uint64_t peak_camera_id
 peak Camera ID More...
 

Enumerations

enum  peak_camera_type {
  PEAK_CAMERA_TYPE_INVALID, PEAK_CAMERA_TYPE_UEYE_USB, PEAK_CAMERA_TYPE_UEYE_ETH, PEAK_CAMERA_TYPE_UEYE_PLUS_U3V,
  PEAK_CAMERA_TYPE_UEYE_PLUS_GEV
}
 peak Camera types More...
 

Functions

peak_status peak_CameraList_Update (size_t *cameraCount)
 Update the camera list. More...
 
peak_status peak_CameraList_Get (peak_camera_descriptor *cameraList, size_t *cameraCount)
 Query the current camera list. More...
 
peak_camera_id peak_Camera_ID_FromHandle (peak_camera_handle hCam)
 Query the camera id by the camera handle. More...
 
peak_camera_id peak_Camera_ID_FromSerialNumber (const char *serialNumber)
 Query the camera id by the serial number. More...
 
peak_camera_id peak_Camera_ID_FromMAC (peak_mac_address macAddress)
 Query the camera id by the mac address. More...
 
peak_access_status peak_Camera_GetAccessStatus (peak_camera_id cameraID)
 Query the camera access status. More...
 
peak_status peak_Camera_GetDescriptor (peak_camera_id cameraID, peak_camera_descriptor *cameraDescriptor)
 Query the camera descriptor. More...
 
peak_status peak_Camera_Open (peak_camera_id cameraID, peak_camera_handle *hCam)
 Open the camera by the Camera id. More...
 
peak_status peak_Camera_OpenFirstAvailable (peak_camera_handle *hCam)
 Open the first available camera. More...
 
peak_status peak_Camera_Close (peak_camera_handle hCam)
 Close the camera. More...
 
peak_status peak_Camera_ResetToDefaultSettings (peak_camera_handle hCam)
 Reset the camera configuration. More...
 

Detailed Description

Camera related functions and types.

Macro Definition Documentation

◆ PEAK_INVALID_CAMERA_ID

#define PEAK_INVALID_CAMERA_ID

peak Invalid camera ID value

Use this value for the initialization of variables of type peak_camera_id.

Typedef Documentation

◆ peak_camera_handle

typedef struct peak_camera* peak_camera_handle

peak Camera handle

The camera handle represents an opened camera.
The camera handle is provided by the peak_Camera_Open_Xxx functions and must be released by peak_Camera_Close.
The camera handle is required in every function which controls a camera of its features.

The value for an invalid camera handle is PEAK_INVALID_HANDLE.

◆ peak_camera_id

typedef uint64_t peak_camera_id

peak Camera ID

The camera id is a unique identifier for a camera.

The camera related functions which can be used without opening a camera require the camera id as identifier.
The id for a certain camera will not change over the session runtime as long as the camera is not re-connected. A re-connected camera will be assigned a new unique camera id on its re-appearance.
I.e. a once assigned camera id is considered as burnt and will not be reused for a later (re-)connected camera.

The value for an invalid camera id is PEAK_INVALID_CAMERA_ID.

Enumeration Type Documentation

◆ peak_camera_type

peak Camera types

The camera type defines the camera family and the bus interface / protocol.

Enumerator
PEAK_CAMERA_TYPE_INVALID 

Invalid camera type.

Use this value for the initialization of variables of type peak_camera_type.

PEAK_CAMERA_TYPE_UEYE_USB 

uEye USB camera

PEAK_CAMERA_TYPE_UEYE_ETH 

uEye Eth camera

PEAK_CAMERA_TYPE_UEYE_PLUS_U3V 

uEye+ USB3 Vision camera

PEAK_CAMERA_TYPE_UEYE_PLUS_GEV 

uEye+ GigE Vision camera

Function Documentation

◆ peak_Camera_Close()

peak_status peak_Camera_Close ( peak_camera_handle  hCam)

Close the camera.

Closes the specified camera.

Parameters
[in]hCamThe handle of the camera to close.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Note
The camera handle is no longer valid after the function has returned.

◆ peak_Camera_GetAccessStatus()

peak_access_status peak_Camera_GetAccessStatus ( peak_camera_id  cameraID)

Query the camera access status.

Provides the current access status for a camera which is specified by its camera id.

This function implements the Access Status Query principle.

Parameters
[in]cameraIDThe camera id.
Returns
PEAK_ACCESS_READWRITE The camera is available for read access and for write access and can be opened.
PEAK_ACCESS_NONE The camera is not available for opening.
PEAK_ACCESS_INVALID The function failed. Call peak_Library_GetLastError to get the error code and description.

If the function indicates an error by returning PEAK_ACCESS_INVALID, these are the possible errors:

◆ peak_Camera_GetDescriptor()

peak_status peak_Camera_GetDescriptor ( peak_camera_id  cameraID,
peak_camera_descriptor *  cameraDescriptor 
)

Query the camera descriptor.

Provides the camera descriptor for the camera which is specified by its camera id.

Parameters
[in]cameraIDThe camera id.
[out]cameraDescriptorThe camera descriptor.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_CAMERA_NOT_FOUND There is no camera with the specified id.
PEAK_STATUS_INVALID_PARAMETER cameraDescriptor an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_Camera_ID_FromHandle()

peak_camera_id peak_Camera_ID_FromHandle ( peak_camera_handle  hCam)

Query the camera id by the camera handle.

Provides the camera id of the camera which the specified camera handle.

This function implements the Camera ID Query principle.

Parameters
[in]hCamThe camera handle.
Returns
The camera id of the camera with the handle hCam.
PEAK_INVALID_CAMERA_ID The function failed. Call peak_Library_GetLastError to get the error code and description.

If the function indicates an error by returning PEAK_INVALID_CAMERA_ID, these are the possible errors:

◆ peak_Camera_ID_FromMAC()

peak_camera_id peak_Camera_ID_FromMAC ( peak_mac_address  macAddress)

Query the camera id by the mac address.

Provides the camera id of the camera which the specified mac address.

This function implements the Camera ID Query principle.

Parameters
[in]macAddressThe macAddress of the camera.
Returns
The camera id of the camera with the mac address macAddress.
PEAK_INVALID_CAMERA_ID The function failed. Call peak_Library_GetLastError to get the error code and description.

If the function indicates an error by returning PEAK_INVALID_CAMERA_ID, these are the possible errors:

◆ peak_Camera_ID_FromSerialNumber()

peak_camera_id peak_Camera_ID_FromSerialNumber ( const char *  serialNumber)

Query the camera id by the serial number.

Provides the camera id of the camera which the specified serial number.

This function implements the Camera ID Query principle.

Parameters
[in]serialNumberThe serial number of the camera. Zero-terminated C string.
Returns
The camera id of the camera with the serial number serialNumber.
PEAK_INVALID_CAMERA_ID The function failed. Call peak_Library_GetLastError to get the error code and description.

If the function indicates an error by returning PEAK_INVALID_CAMERA_ID, these are the possible errors:

◆ peak_Camera_Open()

peak_status peak_Camera_Open ( peak_camera_id  cameraID,
peak_camera_handle *  hCam 
)

Open the camera by the Camera id.

Opens the camera with the specified camera id.

Parameters
[in]cameraIDThe camera id of the camera to open.
[out]hCamThe camera handle.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_CAMERA_NOT_FOUND There is no camera with the specified camera id.
PEAK_STATUS_CAMERA_NOT_AVAILABLE The specified camera is currently not available.
PEAK_STATUS_INVALID_PARAMETER hCam is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Note
If the function fails it will set * hCam to PEAK_STATUS_INVALID_HANDLE.

◆ peak_Camera_OpenFirstAvailable()

peak_status peak_Camera_OpenFirstAvailable ( peak_camera_handle *  hCam)

Open the first available camera.

Opens the first available camera. The implementation selects a camera with the access status PEAK_ACCESS_READWRITE and opens it.

Parameters
[out]hCamThe camera handle.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_CAMERA_NOT_AVAILABLE There is currently no available camera.
PEAK_STATUS_INVALID_PARAMETER hCam is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Note
If the function fails it will set * hCam to PEAK_STATUS_INVALID_HANDLE.

◆ peak_Camera_ResetToDefaultSettings()

peak_status peak_Camera_ResetToDefaultSettings ( peak_camera_handle  hCam)

Reset the camera configuration.

Resets the specified camera to its default configuration.

Parameters
[in]hCamThe handle of the camera to reset.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_INVALID_HANDLE hCam is an invalid camera handle.
PEAK_STATUS_ACCESS_DENIED The feature is currently not accessible. Check for a running acquisition.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.

◆ peak_CameraList_Get()

peak_status peak_CameraList_Get ( peak_camera_descriptor *  cameraList,
size_t *  cameraCount 
)

Query the current camera list.

Provides the current list of detected cameras.

This function implements the Two Staged Data Query principle.

Parameters
[out]cameraListPointer to a user allocated array buffer to receive the camera list. If this parameter is NULL, cameraCount will contain the current number of cameras.
The needed size of cameraList in bytes is cameraCount x sizeof(peak_camera_descriptor).
[in,out]cameraCount
  • cameraList equal NULL:
    out: minimal number of cameras cameraList must be large enough to hold
  • cameraList unequal NULL:
    in: number of cameras cameraList can hold
    out: number of cameras filled by the function
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_BUFFER_TOO_SMALL cameraList is not NULL and the value of *cameraCount is too small to receive the expected amount of data.
PEAK_STATUS_INVALID_PARAMETER cameraCount is an invalid pointer.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Note
Consider that the camera list might change between the size query call and the list query call. This may be the case if peak_CameraList_Update is called and cameras have been attached or detached in the time between the two function calls. To eliminate this issue you may want to use an array for cameraList which is large enough to hold all possibly connected cameras and to spare the size query call.

◆ peak_CameraList_Update()

peak_status peak_CameraList_Update ( size_t *  cameraCount)

Update the camera list.

Initiates a camera discovery and an update of the camera list.

This function is required to be called to create or update the camera list. The camera list does not change unless this function is called again.

Parameters
[out]cameraCountThe number of connected cameras. NULL if not required.
Returns
PEAK_STATUS_SUCCESS Operation was successful; no error occurred.
PEAK_STATUS_NOT_INITIALIZED The library is not initialized.
PEAK_STATUS_ERROR An unexpected internal error occurred.
Note
Depending on the installed transport layers the camera list may take some hundred milliseconds. This is because the discovery of cameras via so called connectionless network protocols like ethernet requires a timeout controlled procedure.