Mech-Eye API 2.4.0
API reference documentation for Mech-Eye Industrial 3D Camera
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
mmind::eye::CameraEvent Class Reference

The camera event related. Use CameraEvent::registerCameraEventCallback to register an event of interest. More...

#include <CameraEvent.h>

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
 callback function for a camera event.
 

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.
 

Detailed Description

The camera event related. Use CameraEvent::registerCameraEventCallback to register an event of interest.

Definition at line 58 of file CameraEvent.h.

Member Typedef Documentation

◆ CameraEventCallback

Initial value:
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 110 of file CameraEvent.h.

◆ EventCallback

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

Definition at line 81 of file CameraEvent.h.

Member Enumeration Documentation

◆ Event

The defined camera event.

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-ligh 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 64 of file CameraEvent.h.

Member Function Documentation

◆ registerCameraEventCallback() [1/2]

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.

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/2]

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, Event 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.

◆ unregisterCameraEventCallback()

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.

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: