Mech-Eye API 2.5.0
API reference documentation for Mech-Eye Industrial 3D Camera
All Classes Functions Variables Typedefs Enumerations Enumerator Pages
Classes | Public Types | Static Public Member Functions | List of all members
mmind::eye::CameraEvent Class Reference

The camera event related. Use CameraEvent::getSupportedEvents to get supported events. Use CameraEvent::registerCameraEventCallback to register an event of interest. More...

#include <CameraEvent.h>

Classes

struct  EventInfo
 Describes the event information. More...
 
struct  PayloadMember
 Describes the data member of the event's payload. More...
 

Public Types

enum  Event { CAMERA_EVENT_NONE = 0x0000 , CAMERA_EVENT_DISCONNECTED = 0x0001 , CAMERA_EVENT_EXPOSURE_END , CAMERA_EVENT_ALL = 0xFFFF }
 The defined camera event. More...
 
using EventCallback = std::function< void(Event event, void *pUser)>
 
using CameraEventCallback = std::function< void(const EventData *eventData, const void *extraPayload)>
 callback function for a camera event.
 
using Payload = std::vector< PayloadMember >
 

Static Public Member Functions

static ErrorStatus registerCameraEventCallback (Camera &camera, EventCallback callback, void *pUser, unsigned int events)
 Registers a camera event of interest.
 
static ErrorStatus registerCameraEventCallback (Camera &camera, Event event, const CameraEventCallback &callback)
 Registers a callback function to be executed when the specified Event occurs on the specified Camera object.
 
static ErrorStatus unregisterCameraEventCallback (Camera &camera, Event event)
 Cancels the registration of a callback function for the specified event and Camera object.
 
static ErrorStatus getSupportedEvents (const Camera &camera, std::vector< EventInfo > &eventInfos)
 Get supported events by the camera.
 
static ErrorStatus registerCameraEventCallback (Camera &camera, uint16_t event, const CameraEventCallback &callback)
 Registers a callback function to be executed when the specified Event occurs on the specified Camera object.
 
static ErrorStatus unregisterCameraEventCallback (Camera &camera, uint16_t event)
 Cancels the registration of a callback function for the specified event and Camera object.
 

Detailed Description

The camera event related. Use CameraEvent::getSupportedEvents to get supported events. Use CameraEvent::registerCameraEventCallback to register an event of interest.

Definition at line 60 of file CameraEvent.h.

Member Typedef Documentation

◆ CameraEventCallback

using mmind::eye::CameraEvent::CameraEventCallback = std::function<void(const EventData* eventData, const void* extraPayload)>

callback function for a camera event.

Parameters
[in]eventDatashared data among events.
[in]extraPayloadevent-specific data.

Definition at line 116 of file CameraEvent.h.

◆ EventCallback

using mmind::eye::CameraEvent::EventCallback = std::function<void(Event event, void* pUser)>

Definition at line 86 of file CameraEvent.h.

◆ Payload

using mmind::eye::CameraEvent::Payload = std::vector<PayloadMember>

Definition at line 227 of file CameraEvent.h.

Member Enumeration Documentation

◆ Event

The defined camera event.

Deprecated:
This enum is deprecated since version 2.5.0. Please use the following method: getSupportedEvents(const Camera&, std::vector<EventInfo>&) to get supported events.
Enumerator
CAMERA_EVENT_NONE 

The default value.

CAMERA_EVENT_DISCONNECTED 

The camera has disconnected.

CAMERA_EVENT_EXPOSURE_END 

The camera has completed structured-light projection and exposure. Note: This event is sent after the structured-light projection has been completed. To ensure both 2D and 3D data have been acquired before the event is sent, check the following recommendations: If the flash exposure mode is used for acquiring the 2D data, and the scanning2d_setting::FlashAcquisitionMode parameter is set to "Fast", call Camera::capture3D before calling Camera::capture2D. Otherwise, call Camera::capture2D before calling Camera::capture3D. Alternatively, you can call Camera::capture2DAnd3D instead to avoid the timing issue.

CAMERA_EVENT_ALL 

All camera events.

Definition at line 68 of file CameraEvent.h.

Member Function Documentation

◆ getSupportedEvents()

static ErrorStatus mmind::eye::CameraEvent::getSupportedEvents ( const Camera camera,
std::vector< EventInfo > &  eventInfos 
)
static

Get supported events by the camera.

Parameters
cameraThe camera for which to get supported events.
eventInfosThe information of the events supported.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.

◆ registerCameraEventCallback() [1/3]

static ErrorStatus mmind::eye::CameraEvent::registerCameraEventCallback ( Camera camera,
Event  event,
const CameraEventCallback callback 
)
static

Registers a callback function to be executed when the specified Event occurs on the specified Camera object.

Deprecated:
This method is deprecated since version 2.5.0. Please use the following method instead: registerCameraEventCallback(Camera&, uint16_t, const CameraEventCallback&).
Parameters
cameraThe camera for which the callback function is registered.
eventThe event for which the callback function is registered.
callbackThe callback function to be executed when the specified event occurs.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported camera model or firmware version.
ErrorStatus::MMIND_STATUS_INVALID_CALLBACKFUNC The registered callback function is invalid.
ErrorStatus.MMIND_STATUS_DUPLICATED_REGISTRATION A callback function for this event has already been registered.
ErrorStatus::MMIND_STATUS_MESSAGE_CHANNEL_ERROR Failed to establish the channel for delivering the event occurrence.

◆ registerCameraEventCallback() [2/3]

static ErrorStatus mmind::eye::CameraEvent::registerCameraEventCallback ( Camera camera,
EventCallback  callback,
void *  pUser,
unsigned int  events 
)
static

Registers a camera event of interest.

Deprecated:
This method is deprecated since version 2.4.0. Please use the following method instead: registerCameraEventCallback(Camera& camera, uint16_t event, const CameraEventCallback& callback).
Parameters
[in]cameraThe camera handle.
[in]callbackThe callback functions for responding to camera events.
[in]pUserPointer used by the user.
[in]eventsThe camera event. See CameraEvent::Event for details.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Not supported camera model or firmware version.

◆ registerCameraEventCallback() [3/3]

static ErrorStatus mmind::eye::CameraEvent::registerCameraEventCallback ( Camera camera,
uint16_t  event,
const CameraEventCallback callback 
)
static

Registers a callback function to be executed when the specified Event occurs on the specified Camera object.

Parameters
cameraThe camera for which the callback function is registered.
eventThe event for which the callback function is registered.
callbackThe callback function to be executed when the specified event occurs.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported camera model or firmware version.
ErrorStatus::MMIND_STATUS_INVALID_CALLBACKFUNC The registered callback function is invalid.
ErrorStatus.MMIND_STATUS_DUPLICATED_REGISTRATION A callback function for this event has already been registered.
ErrorStatus::MMIND_STATUS_MESSAGE_CHANNEL_ERROR Failed to establish the channel for delivering the event occurrence.

◆ unregisterCameraEventCallback() [1/2]

static ErrorStatus mmind::eye::CameraEvent::unregisterCameraEventCallback ( Camera camera,
Event  event 
)
static

Cancels the registration of a callback function for the specified event and Camera object.

Deprecated:
This method is deprecated since version 2.5.0. Please use the following method instead: unregisterCameraEvent(Camera&, uint16_t).
Parameters
cameraThe camera for which to cancel the registration of the callback function.
eventThe event for which to cancel the registration of the callback function.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported camera model or firmware version.
ErrorStatus::MMIND_STATUS_INVALID_CALLBACKFUNC The registered callback function is invalid.
ErrorStatus::MMIND_STATUS_MESSAGE_CHANNEL_ERROR Failed to close the channel for delivering the event occurrence.

◆ unregisterCameraEventCallback() [2/2]

static ErrorStatus mmind::eye::CameraEvent::unregisterCameraEventCallback ( Camera camera,
uint16_t  event 
)
static

Cancels the registration of a callback function for the specified event and Camera object.

Parameters
cameraThe camera for which to cancel the registration of the callback function.
eventThe event for which to cancel the registration of the callback function.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported camera model or firmware version.
ErrorStatus::MMIND_STATUS_INVALID_CALLBACKFUNC The registered callback function is invalid.
ErrorStatus::MMIND_STATUS_MESSAGE_CHANNEL_ERROR Failed to close the channel for delivering the event occurrence.

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