Skip to content

Pylon::CDeviceSpecificInstantCameraT#

Implementation Detail: Header only implementation class for creating device specific Instant Camera classes. More…

#include <pylon/private/DeviceSpecificInstantCamera.h>

Inherits from Pylon::CInstantCamera, CameraParams_t, CameraTraitsT, Basler_InstantCameraParams::CInstantCameraParams_Params, Basler_InstantCameraParams::CInstantCameraParams_Params_v7_1_0

Public Types#

Name
typedef CameraTraitsT::InstantCamera_t InstantCamera_t
typedef CameraTraitsT::IPylonDevice_t IPylonDevice_t
typedef CameraTraitsT::DeviceInfo_t DeviceInfo_t
typedef CameraTraitsT::ConfigurationEventHandler_t ConfigurationEventHandler_t
typedef CameraTraitsT::ImageEventHandler_t ImageEventHandler_t
typedef CameraTraitsT::CameraEventHandler_t CameraEventHandler_t
typedef CameraTraitsT::GrabResultData_t GrabResultData_t
typedef CameraTraitsT::GrabResultPtr_t GrabResultPtr_t

Public Functions#

Name
CDeviceSpecificInstantCameraT()
Creates an Instant Camera object with no attached Pylon device.
CDeviceSpecificInstantCameraT(IPylonDevice * pDevice, ECleanup cleanupProcedure =Cleanup_Delete)
Creates an Instant Camera object and calls Attach().
virtual ~CDeviceSpecificInstantCameraT()
Destroys an Instant Camera object.
virtual void Attach(IPylonDevice * pDevice, ECleanup cleanupProcedure =Cleanup_Delete)
Attaches a Pylon device to the Instant Camera.
virtual void DestroyDevice()
Destroys the attached Pylon device.
virtual IPylonDevice * DetachDevice()
Detaches an attached Pylon device.
virtual void Open()
Opens the attached Pylon device.
virtual void Close()
Closes the attached Pylon device.
virtual bool RetrieveResult(unsigned int timeoutMs, typename CameraTraitsT::GrabResultPtr_t & grabResult, ETimeoutHandling timeoutHandling =TimeoutHandling_ThrowException)
Retrieves a grab result according to the strategy, waits if it is not yet available.
virtual bool GrabOne(unsigned int timeoutMs, typename CameraTraitsT::GrabResultPtr_t & grabResult, ETimeoutHandling timeoutHandling =TimeoutHandling_ThrowException)
Grabs one image.
virtual void RegisterConfiguration(typename CameraTraitsT::ConfigurationEventHandler_t * pConfigurator, ERegistrationMode mode, ECleanup cleanupProcedure)
Adds a configurator to the list of registered configurator objects.
virtual bool DeregisterConfiguration(typename CameraTraitsT::ConfigurationEventHandler_t * configurator)
Removes a configurator from the list of registered configurator objects.
virtual void RegisterImageEventHandler(typename CameraTraitsT::ImageEventHandler_t * pImageEventHandler, ERegistrationMode mode, ECleanup cleanupProcedure)
Adds an image event handler to the list of registered image event handler objects.
virtual bool DeregisterImageEventHandler(typename CameraTraitsT::ImageEventHandler_t * imageEventHandler)
Removes an image event handler from the list of registered image event handler objects.
virtual void RegisterCameraEventHandler(typename CameraTraitsT::CameraEventHandler_t * pCameraEventHandler, const String_t & nodeName, intptr_t userProvidedId, ERegistrationMode mode, ECleanup cleanupProcedure, ECameraEventAvailability availability =CameraEventAvailability_Mandatory)
Adds an camera event handler to the list of registered camera event handler objects.
virtual bool DeregisterCameraEventHandler(typename CameraTraitsT::CameraEventHandler_t * cameraEventHandler, const String_t & nodeName)
Removes a camera event handler from the list of registered camera event handler objects.
virtual const CameraTraitsT::DeviceInfo_t & GetDeviceInfo() const
Provides access to the device info object of the attached Pylon device or an empty one.
virtual CameraTraitsT::TlParams_t & GetTLParams()
Provides access to the transport layer parameters of the attached Pylon Device.
virtual CameraTraitsT::StreamGrabberParams_t & GetStreamGrabberParams()
Provides access to the stream grabber parameters of the attached Pylon Device.
virtual CameraTraitsT::EventGrabberParams_t & GetEventGrabberParams()
Provides access to the event grabber parameters of the attached Pylon Device.
virtual bool IsPylonDeviceAttached() const
Returns the Pylon device attached state of the Instant Camera object.
virtual bool IsCameraDeviceRemoved() const
Returns the connection state of the camera device.
virtual bool HasOwnership() const
Returns the ownership of the attached Pylon device.
virtual bool IsOpen() const
Returns the open state of the attached Pylon device object.
virtual void StartGrabbing(EGrabStrategy strategy =GrabStrategy_OneByOne, EGrabLoop grabLoopType =GrabLoop_ProvidedByUser)
Starts the grabbing of images.
virtual void StartGrabbing(size_t maxImages, EGrabStrategy strategy =GrabStrategy_OneByOne, EGrabLoop grabLoopType =GrabLoop_ProvidedByUser)
Starts the grabbing for a maximum number of images.
virtual bool RetrieveResult(unsigned int timeoutMs, CGrabResultPtr & grabResult, ETimeoutHandling timeoutHandling =TimeoutHandling_ThrowException)
Retrieves a grab result according to the strategy, waits if it is not yet available.
virtual void StopGrabbing()
Stops the grabbing of images.
virtual bool IsGrabbing() const
Returns state of grabbing.
virtual bool GrabOne(unsigned int timeoutMs, CGrabResultPtr & grabResult, ETimeoutHandling timeoutHandling =TimeoutHandling_ThrowException)
Grabs one image.
virtual size_t GetQueuedBufferCount()
Deprecated: This method has been deprecated.
virtual const WaitObject & GetGrabResultWaitObject()
Provides access to a wait object indicating available grab results.
virtual const WaitObject & GetGrabStopWaitObject()
Provides access to a wait object indicating that the grabbing has stopped.
virtual const WaitObject & GetCameraEventWaitObject()
Provides access to a wait object indicating available camera events.
virtual void RegisterConfiguration(CConfigurationEventHandler * pConfigurator, ERegistrationMode mode, ECleanup cleanupProcedure)
Adds a configurator to the list of registered configurator objects.
virtual bool DeregisterConfiguration(CConfigurationEventHandler * configurator)
Removes a configurator from the list of registered configurator objects.
virtual void RegisterImageEventHandler(CImageEventHandler * pImageEventHandler, ERegistrationMode mode, ECleanup cleanupProcedure)
Adds an image event handler to the list of registered image event handler objects.
virtual bool DeregisterImageEventHandler(CImageEventHandler * imageEventHandler)
Removes an image event handler from the list of registered image event handler objects.
virtual void RegisterCameraEventHandler(CCameraEventHandler * pCameraEventHandler, const String_t & nodeName, intptr_t userProvidedId, ERegistrationMode mode, ECleanup cleanupProcedure, ECameraEventAvailability availability =CameraEventAvailability_Mandatory)
Adds an camera event handler to the list of registered camera event handler objects.
virtual bool DeregisterCameraEventHandler(CCameraEventHandler * cameraEventHandler, const String_t & nodeName)
Removes a camera event handler from the list of registered camera event handler objects.
virtual bool WaitForFrameTriggerReady(unsigned int timeoutMs, ETimeoutHandling timeoutHandling =TimeoutHandling_ThrowException)
Actively waits until the the camera is ready to accept a frame trigger.
virtual bool CanWaitForFrameTriggerReady() const
Checks to see whether the camera device can be queried whether it is ready to accept the next frame trigger.
virtual void ExecuteSoftwareTrigger()
Executes the software trigger command.
virtual void SetCameraContext(intptr_t context)
Sets a context that is attached to each grab result of the camera object on RetrieveResult().
virtual intptr_t GetCameraContext() const
Returns the context that is attached to each grab result of the camera object.
virtual GenApi::INodeMap & GetNodeMap()
Provides access to the node map of the camera device.
virtual GenApi::INodeMap & GetTLNodeMap()
Provides access to the transport layer node map of the attached Pylon device.
virtual GenApi::INodeMap & GetStreamGrabberNodeMap()
Provides access to the stream grabber node map of the attached Pylon device.
virtual GenApi::INodeMap & GetEventGrabberNodeMap()
Provides access to the event grabber node map of the attached Pylon device.
virtual GenApi::INodeMap & GetInstantCameraNodeMap()
Provides access to the node map of the Instant Camera object.
virtual void SetBufferFactory(IBufferFactory * pFactory, ECleanup cleanupProcedure =Cleanup_Delete)
Sets an alternative buffer factory that is used for buffer allocation.
virtual bool Is1394() const
Returns true if an IEEE 1394 Pylon device is attached to the Instant Camera object.
virtual bool IsGigE() const
Returns true if a GigE Pylon device is attached to the Instant Camera object.
virtual bool IsUsb() const
Returns true if a USB Pylon device is attached to the Instant Camera object.
virtual bool IsCameraLink() const
Returns true if a Camera Link Pylon device is attached to the Instant Camera object.
virtual bool IsCxp() const
Returns true if a CoaXPress GenTL device is attached to the Instant Camera object.
VersionInfo GetSfncVersion() const
Returns the SFNC version read from the camera node map.
IInstantCameraExtensions & GetExtensionInterface()

Protected Functions#

Name
virtual IPylonDevice * GetDevice()
Provides access to the attached Pylon device.
CLock & GetLock()
Provides access to the lock used for synchronizing the access to the camera.
GenApi::INodeMap & GetEmptyNodeMap()
void InternalRegisterConfiguration(CConfigurationEventHandler * , ERegistrationMode , ECleanup , const long * )
void InternalRegisterImageEventHandler(CImageEventHandler * , ERegistrationMode , ECleanup , const long * )
void InternalRegisterCameraEventHandler(CCameraEventHandler * , const String_t & , intptr_t , ERegistrationMode , ECleanup , ECameraEventAvailability , const long * )
bool InternalDeregisterConfiguration(const long * )
bool InternalDeregisterImageEventHandler(const long * )
bool InternalDeregisterCameraEventHandler(const long * , const String_t & )
void InternalShutdownEventHandlers()
virtual CGrabResultData * CreateDeviceSpecificGrabResultData()

Public Attributes#

Name
Pylon::IBooleanEx & AcquisitionStartStopExecutionEnable
If set, this will automatically execute AcquisitionStart when calling StartGrabbing and AcquisitionStop when calling StopGrabbing This option is enabled by default - Applies to: InstantCamera.
Pylon::IBooleanEx & ChunkNodeMapsEnable
Enables/disables the use of a chunk node map for each grab result Grab result chunk node maps can be disabled to save resources - Applies to: InstantCamera.
Pylon::IBooleanEx & ClearBufferModeEnable
If set, all buffers will be cleared (set to 0) before grabbing an image Note that this requires additional processing time per frame - Applies to: InstantCamera.
Pylon::IBooleanEx & GrabCameraEvents
Enables/disables the grabbing of camera events while images are grabbed Is writable when the camera object is closed - Applies to: InstantCamera.
Pylon::IIntegerEx & MaxNumBuffer
The maximum number of buffers that are allocated and used for grabbing - Applies to: InstantCamera.
Pylon::IIntegerEx & MaxNumGrabResults
The maximum number of grab results available at any time during a grab session This value can be limited to save resources Furthermore, it can be used to check that the grab results are returned correctly - Applies to: InstantCamera.
Pylon::IIntegerEx & MaxNumQueuedBuffer
The maximum number of buffers that are queued in the stream grabber input queue - Applies to: InstantCamera.
Pylon::IBooleanEx & MigrationModeActive
The migration mode is set up according to this setting at defined points e g , when the camera is opened - Applies to: InstantCamera.
Pylon::IBooleanEx & MonitorModeActive
The camera object is set to monitor mode when enabled, e g when using the GigE multicast feature Is writable when the camera object is closed - Applies to: InstantCamera.
Pylon::IIntegerEx & NumEmptyBuffers
The number of empty buffers that are not used for grabbing yet - Applies to: InstantCamera.
Pylon::IIntegerEx & NumQueuedBuffers
The number of buffers queued at Low Level API stream grabber - Applies to: InstantCamera.
Pylon::IIntegerEx & NumReadyBuffers
The number of grab result buffers in the output queue that are ready for retrieval - Applies to: InstantCamera.
Pylon::IIntegerEx & OutputQueueSize
The size of the grab result buffer output queue - Applies to: InstantCamera.
Pylon::IIntegerEx & StaticChunkNodeMapPoolSize
If larger than 0, a static chunk node map pool is used instead of dynamic chunk node map creation - Applies to: InstantCamera.
Pylon::IBooleanEx & UseExtendedIdIfAvailable
Use Extended ID if available in the camera and supported by the driver - Applies to: InstantCamera.
Pylon::IIntegerEx & GrabLoopThreadPriority
The grab loop thread priority - Applies to: InstantCamera.
Pylon::IBooleanEx & GrabLoopThreadPriorityOverride
If enabled, the user can set a custom priority for the grab loop thread Otherwise, the priority of the newly created thread is not changed - Applies to: InstantCamera.
Pylon::IIntegerEx & GrabLoopThreadTimeout
A custom timeout for the grab loop thread's call to RetrieveResult RetrieveResult is configured to throw an exception on timeout, which will stop the grab session - Applies to: InstantCamera.
Pylon::IBooleanEx & GrabLoopThreadUseTimeout
If enabled, the user can set a custom timeout for the grab loop thread's call to RetrieveResult RetrieveResult is configured to throw an exception on timeout, which will stop the grab session - Applies to: InstantCamera.
Pylon::IIntegerEx & InternalGrabEngineThreadPriority
The internal grab engine thread priority - Applies to: InstantCamera.
Pylon::IBooleanEx & InternalGrabEngineThreadPriorityOverride
If enabled, the user can set a custom priority for the internal grab engine thread operating the stream grabber Otherwise the priority defaults to 25 - Applies to: InstantCamera.

Protected Attributes#

Name
CameraTraitsT::TlParams_t * m_pTlParams
CameraTraitsT::StreamGrabberParams_t * m_pStreamGrabberParams
CameraTraitsT::EventGrabberParams_t * m_pEventGrabberParams

Additional inherited members#

Public Functions inherited from Pylon::CInstantCamera

Name
CInstantCamera()
Creates an Instant Camera object with no attached Pylon device.
CInstantCamera(IPylonDevice * pDevice, ECleanup cleanupProcedure =Cleanup_Delete)
Creates an Instant Camera object and calls Attach().
virtual ~CInstantCamera()
Destroys an Instant Camera object.

Friends inherited from Pylon::CInstantCamera

Name
class CGrabResultDataFactory

Detailed Description#

template <typename CameraTraitsT>
class Pylon::CDeviceSpecificInstantCameraT;

Implementation Detail: Header only implementation class for creating device specific Instant Camera classes.

Public Types Documentation#

typedef InstantCamera_t#

typedef CameraTraitsT::InstantCamera_t Pylon::CDeviceSpecificInstantCameraT< CameraTraitsT >::InstantCamera_t;

typedef IPylonDevice_t#

typedef CameraTraitsT::IPylonDevice_t Pylon::CDeviceSpecificInstantCameraT< CameraTraitsT >::IPylonDevice_t;

typedef DeviceInfo_t#

typedef CameraTraitsT::DeviceInfo_t Pylon::CDeviceSpecificInstantCameraT< CameraTraitsT >::DeviceInfo_t;

typedef ConfigurationEventHandler_t#

typedef CameraTraitsT::ConfigurationEventHandler_t Pylon::CDeviceSpecificInstantCameraT< CameraTraitsT >::ConfigurationEventHandler_t;

typedef ImageEventHandler_t#

typedef CameraTraitsT::ImageEventHandler_t Pylon::CDeviceSpecificInstantCameraT< CameraTraitsT >::ImageEventHandler_t;

typedef CameraEventHandler_t#

typedef CameraTraitsT::CameraEventHandler_t Pylon::CDeviceSpecificInstantCameraT< CameraTraitsT >::CameraEventHandler_t;

typedef GrabResultData_t#

typedef CameraTraitsT::GrabResultData_t Pylon::CDeviceSpecificInstantCameraT< CameraTraitsT >::GrabResultData_t;

typedef GrabResultPtr_t#

typedef CameraTraitsT::GrabResultPtr_t Pylon::CDeviceSpecificInstantCameraT< CameraTraitsT >::GrabResultPtr_t;

Public Functions Documentation#

CDeviceSpecificInstantCameraT#

CDeviceSpecificInstantCameraT()

Creates an Instant Camera object with no attached Pylon device.

Error Safety:

Does not throw C++ exceptions.

CDeviceSpecificInstantCameraT#

CDeviceSpecificInstantCameraT(
    IPylonDevice * pDevice,
    ECleanup cleanupProcedure =Cleanup_Delete
)

Creates an Instant Camera object and calls Attach().

Parameters:

  • pDevice The Pylon device to attach.
  • cleanupProcedure If cleanupProcedure equals Cleanup_Delete, the Pylon device is destroyed when the Instant Camera object is destroyed.

Error Safety:

May throw an exception if the passed Pylon device is open. Does not throw C++ exceptions if the passed Pylon device is closed or NULL.

See Attach() for more information.

~CDeviceSpecificInstantCameraT#

virtual ~CDeviceSpecificInstantCameraT()

Destroys an Instant Camera object.

Error Safety:

Does not throw C++ exceptions.

Calls Attach( NULL) for destroying or removing a Pylon device depending on the passed cleanup procedure.

Attach#

virtual void Attach(
    IPylonDevice * pDevice,
    ECleanup cleanupProcedure =Cleanup_Delete
)

Attaches a Pylon device to the Instant Camera.

Parameters:

  • pDevice The Pylon device to attach.
  • cleanupProcedure If cleanupProcedure equals Cleanup_Delete, the Pylon device is destroyed when the Instant Camera object is destroyed.

Postcondition:

  • If the passed pointer to the Pylon device is NULL, the Instant Camera object is in the "no device attached" state.
  • If the passed pointer to the Pylon device is not NULL, the passed Pylon device is attached.
  • If the set cleanup procedure equals Cleanup_Delete, the Pylon device is destroyed when the Instant Camera object is destroyed or a new device is attached.
  • If the passed Pylon device is open and the registration of callbacks fails, the Instant Camera object is in the "no device attached" state.
  • The opened-by-user flag is set, preventing closing of the Pylon device on StopGrabbing() when the attached Pylon device is already open.

Error Safety:

May throw an exception if the passed Pylon device is open. Does not throw C++ exceptions if the passed Pylon device is closed or NULL.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

Reimplements: Pylon::CInstantCamera::Attach

  • If a Pylon device is currently attached, it is destroyed (DestroyDevice()) or removed (DetachDevice()) depending on the previously set cleanup procedure value.
  • If the pDevice parameter is NULL, nothing more is done.
  • The OnAttach configuration event is fired. Possible C++ exceptions from event calls are caught and ignored. All event handlers are notified.
  • The new Pylon device is attached.
  • The instant camera migration mode setting is applied to the Pylon device transport layer node map.
  • If the passed Pylon device is open, callbacks for camera events are registered at the camera node map. (This may fail)
  • If the passed Pylon device is open, a device removal call back is registered. (This may fail)
  • If the passed Pylon device is open, access modifiers (see IPylonDevice::Open()) are carried over as camera parameters.
  • The OnAttached configuration event is fired. Possible C++ exceptions from event calls are caught and ignored. All event handlers are notified.

DestroyDevice#

virtual void DestroyDevice()

Destroys the attached Pylon device.

Postcondition: No Pylon device is attached.

Attention: The node maps, e.g. the camera node map, of the attached Pylon device must not be accessed anymore while destroying the Pylon device.

Error Safety:

Does not throw C++ exceptions. Possible C++ exceptions are caught and ignored.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

Reimplements: Pylon::CInstantCamera::DestroyDevice

  • If no Pylon device is attached, nothing is done.
  • If the Pylon device is open, it is closed by calling Close().
  • The configuration event OnDestroy is fired. Possible C++ exceptions from event calls are caught and ignored. All event handlers are notified.
  • The Pylon device is destroyed even if the cleanup procedure Cleanup_None has been passed when calling Attach() before.
  • The configuration event OnDestroyed is fired. Possible C++ exceptions from event calls are caught and ignored. All event handlers are notified.

DetachDevice#

virtual IPylonDevice * DetachDevice()

Detaches an attached Pylon device.

Return: The attached Pylon device or NULL if nothing has been attached before.

Postcondition:

  • No Pylon device is attached.
  • The ownership of the Pylon device goes to the caller who is responsible for destroying the Pylon device.

Error Safety:

Does not throw C++ exceptions. Possible C++ exceptions are caught and ignored.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

Reimplements: Pylon::CInstantCamera::DetachDevice

  • If no Pylon device is attached, nothing is done.
  • If a grab is in progress, it is stopped by calling StopGrabbing().
  • The configuration event OnDetach is fired. Possible C++ exceptions from event calls are caught and ignored. All event handlers are notified.
  • The Pylon device is detached.
  • The configuration event OnDetached is fired. Possible C++ exceptions from event calls are caught and ignored. All event handlers are notified.

Open#

virtual void Open()

Opens the attached Pylon device.

Precondition: A Pylon device is attached.

Postcondition:

  • The Pylon device is open and a connection to the camera device has been established.
  • Opened by user flag is set, preventing closing of the Pylon device on StopGrabbing().

Error Safety:

The Instant Camera object is still valid after error. The Pylon device open may throw. Configuration event calls may throw. Callback registrations may throw. The Pylon device is closed with Close() if the OnOpened event call triggers an exception.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

Reimplements: Pylon::CInstantCamera::Open

  • Opened by user flag is set, preventing closing of the device on StopGrabbing().
  • If the Pylon device is already open, nothing more is done.
  • The OnOpen configuration event is fired. The notification of event handlers stops when an event call triggers an exception.
  • The Pylon device is opened and a connection to the camera device is established.
  • The instant camera migration mode setting is applied to the Pylon device transport layer node map.
  • A device removal call back is registered at the Pylon device.
  • Callbacks for camera events are registered at the camera node map.
  • The OnOpened configuration event is fired if the Pylon device has been opened successfully. The notification of event handlers stops when an event call triggers an exception.

Close#

virtual void Close()

Closes the attached Pylon device.

Postcondition: The connection to the camera device is closed and the Pylon device is closed.

Error Safety:

Does not throw C++ exceptions. Possible C++ exceptions are caught and ignored.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

Reimplements: Pylon::CInstantCamera::Close

  • If no Pylon device is attached, nothing is done.
  • If the Pylon device is already closed, nothing is done.
  • If a grab is in progress, it is stopped by calling StopGrabbing().
  • The configuration event OnClose is fired. Possible C++ exceptions from event calls are caught and ignored. All event handlers are notified.
  • The connection to the camera device is closed and the Pylon device is closed.
  • The configuration event OnClosed is fired if the Pylon device has been closed successfully. Possible C++ exceptions from event calls are caught and ignored. All event handlers are notified.

RetrieveResult#

virtual bool RetrieveResult(
    unsigned int timeoutMs,
    typename CameraTraitsT::GrabResultPtr_t & grabResult,
    ETimeoutHandling timeoutHandling =TimeoutHandling_ThrowException
)

Retrieves a grab result according to the strategy, waits if it is not yet available.

Parameters:

  • timeoutMs A timeout value in ms for waiting for a grab result, or the INFINITE value.
  • grabResult Receives the grab result.
  • timeoutHandling If timeoutHandling equals TimeoutHandling_ThrowException, a timeout exception is thrown on timeout.

Return: True if the call successfully retrieved a grab result, false otherwise.

Precondition:

  • There is no other thread waiting for a result. This will be the case when the Instant Camera grab loop thread is used.

Postcondition:

  • If a grab result has been retrieved, one image is removed from the output queue and is returned in the grabResult parameter.
  • If no grab result has been retrieved, an empty grab result is returned in the grabResult parameter.
  • If the maximum number of images has been grabbed, the grabbing is stopped.
  • If camera event handling is enabled and camera events were received, at least one or more camera event messages have been processed.

Error Safety:

The Instant Camera object is still valid after error. The grabbing is stopped if an exception is thrown.

Thread Safety:

This method is synchronized using the lock provided by GetLock() while not waiting.

  • The content of the passed grab result is released.
  • If no Pylon device is attached or the grabbing is not started, the method returns immediately "false".
  • Wait for a grab result if it is not yet available. The access to the camera is not locked during waiting. Camera events are handled.
  • Only if camera events are used: Incoming camera events are handled.
  • One grab result is retrieved per call according to the strategy applied.
  • Only if chunk mode is used: The chunk data parsing is performed. The grab result data is updated using chunk data.
  • The image event OnImagesSkipped is fired if grab results have been skipped according to the strategy. The notification of event handlers stops when an event call triggers an exception.
  • The image event OnImageGrabbed is fired if a grab result becomes available. The notification of event handlers stops when an event call triggers an exception.
  • Stops the grabbing by calling StopGrabbing() if the maximum number of images has been grabbed. It needs to be checked whether the grab represented by the grab result has been successful, see CGrabResultData::GrabSucceeded().

GrabOne#

virtual bool GrabOne(
    unsigned int timeoutMs,
    typename CameraTraitsT::GrabResultPtr_t & grabResult,
    ETimeoutHandling timeoutHandling =TimeoutHandling_ThrowException
)

Grabs one image.

Parameters:

  • timeoutMs A timeout value in ms for waiting for a grab result, or the INFINITE value.
  • grabResult Receives the grab result.
  • timeoutHandling If timeoutHandling equals TimeoutHandling_ThrowException, a timeout exception is thrown on timeout.

Return: Returns true if the call successfully retrieved a grab result and the grab succeeded (CGrabResultData::GrabSucceeded()).

Note:

Precondition: Must meet the preconditions of start grabbing.

Postcondition: Meets the postconditions of stop grabbing.

Error Safety:

The Instant Camera object is still valid after error. See StartGrabbing(), RetrieveResult(), and StopGrabbing() . In the case of exceptions after StartGrabbing() the grabbing is stopped using StopGrabbing().

The following code shows a simplified version of what is done (happy path):

//grab one image
StartGrabbing( 1, GrabStrategy_OneByOne, GrabLoop_ProvidedByUser);

//grab is stopped automatically due to maxImages = 1
return RetrieveResult( timeoutMs, grabResult, timeoutHandling) && grabResult->GrabSucceeded();

GrabOne() can be used to together with the CAcquireSingleFrameConfiguration.

RegisterConfiguration#

virtual void RegisterConfiguration(
    typename CameraTraitsT::ConfigurationEventHandler_t * pConfigurator,
    ERegistrationMode mode,
    ECleanup cleanupProcedure
)

Adds a configurator to the list of registered configurator objects.

Parameters:

  • pConfigurator The receiver of configuration events.
  • mode Indicates how to register the new configurator.
  • cleanupProcedure If cleanupProcedure equals Cleanup_Delete, the passed event handler is deleted when no longer needed.

Postcondition: The configurator is registered and called on configuration events.

Error Safety:

Does not throw C++ exceptions, except when memory allocation fails.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

  • If mode equals RegistrationMode_ReplaceAll, the list of registered configurators is cleared.
  • If pointer pConfigurator is not NULL, it is appended to the list of configurators.

DeregisterConfiguration#

virtual bool DeregisterConfiguration(
    typename CameraTraitsT::ConfigurationEventHandler_t * configurator
)

Removes a configurator from the list of registered configurator objects.

Parameters:

  • configurator The registered receiver of configuration events.

Return: True if successful

Postcondition:

  • The configurator is deregistered.
  • If the configuration has been registered by passing a pointer and the cleanup procedure is Cleanup_Delete, the event handler is deleted.

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

If the configurator is not found, nothing is done.

RegisterImageEventHandler#

virtual void RegisterImageEventHandler(
    typename CameraTraitsT::ImageEventHandler_t * pImageEventHandler,
    ERegistrationMode mode,
    ECleanup cleanupProcedure
)

Adds an image event handler to the list of registered image event handler objects.

Parameters:

  • pImageEventHandler The receiver of image events.
  • mode Indicates how to register the new imageEventHandler.
  • cleanupProcedure If cleanupProcedure equals Cleanup_Delete, the passed event handler is deleted when no longer needed.

Postcondition: The imageEventHandler is registered and called on image related events.

Error Safety:

Does not throw C++ exceptions, except when memory allocation fails.

Thread Safety:

This method is synchronized using the internal image event handler registry lock.

  • If mode equals RegistrationMode_ReplaceAll, the list of registered image event handlers is cleared.
  • If pointer pImageEventHandler is not NULL, it is appended to the list of image event handlers.

DeregisterImageEventHandler#

virtual bool DeregisterImageEventHandler(
    typename CameraTraitsT::ImageEventHandler_t * imageEventHandler
)

Removes an image event handler from the list of registered image event handler objects.

Parameters:

  • imageEventHandler The registered receiver of configuration events.

Return: True if successful

Postcondition:

  • The imageEventHandler is deregistered.
  • If the image event handler has been registered by passing a pointer and the cleanup procedure is Cleanup_Delete, the event handler is deleted.

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the internal image event handler registry lock.

If the image event handler is not found, nothing is done.

RegisterCameraEventHandler#

virtual void RegisterCameraEventHandler(
    typename CameraTraitsT::CameraEventHandler_t * pCameraEventHandler,
    const String_t & nodeName,
    intptr_t userProvidedId,
    ERegistrationMode mode,
    ECleanup cleanupProcedure,
    ECameraEventAvailability availability =CameraEventAvailability_Mandatory
)

Adds an camera event handler to the list of registered camera event handler objects.

Parameters:

  • pCameraEventHandler The receiver of camera events.
  • nodeName The name of the event data node updated on camera event, e.g. "ExposureEndEventTimestamp" for exposure end event.
  • userProvidedId This ID is passed as a parameter in CCameraEventHandler::OnCameraEvent and can be used to distinguish between different events. It is recommended to create an own application specific enum and use it's values as IDs.
  • mode Indicates how to register the new cameraEventHandler.
  • cleanupProcedure If cleanupProcedure equals Cleanup_Delete, the passed event handler is deleted when no longer needed.
  • availability If availability equals CameraEventAvailability_Mandatory, the camera must support the data node specified by node name. If not, an exception is thrown when the Instant Camera is open, the Instant Camera is opened, or an open Pylon device is attached.

Postcondition: The cameraEventHandler is registered and called on camera events.

Error Safety:

Throws an exception if the availability is set to CameraEventAvailability_Mandatory and the node with the name nodeName is not available in the camera node map (see GetNodeMap()). Throws an exception fail if the node callback registration fails. The event handler is not registered when an C++ exception is thrown.

Thread Safety:

This method is synchronized using the camera event handler lock. If the camera is open, the lock provided by GetLock() and the camera node map lock are also used for synchronization.

  • If mode equals RegistrationMode_ReplaceAll, the list of registered camera event handlers is cleared.
  • If the pointer pCameraEventHandler is not NULL, it is appended to the list of camera event handlers.

Internally, a GenApi node call back is registered for the node identified by nodeName. This callback triggers a call to the CCameraEventHandler::OnCameraEvent() method. That's why a Camera Event Handler can be registered for any node of the camera node map to get informed about changes.

DeregisterCameraEventHandler#

virtual bool DeregisterCameraEventHandler(
    typename CameraTraitsT::CameraEventHandler_t * cameraEventHandler,
    const String_t & nodeName
)

Removes a camera event handler from the list of registered camera event handler objects.

Parameters:

  • cameraEventHandler The registered receiver of camera events.
  • nodeName The name of the event data node updated on camera event, e.g. "ExposureEndEventTimestamp" for exposure end event.

Return: True if successful

Postcondition:

  • The cameraEventHandler is deregistered.
  • If the camera event handler has been registered by passing a pointer and the cleanup procedure is Cleanup_Delete, the event handler is deleted.

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the camera event handler lock. If the camera is open, the camera node map lock is also used for synchronization.

If the camera event handler is not found, nothing is done.

GetDeviceInfo#

virtual const CameraTraitsT::DeviceInfo_t & GetDeviceInfo() const

Provides access to the device info object of the attached Pylon device or an empty one.

Return: The info object of the attached Pylon device or an empty one.

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

Reimplements: Pylon::CInstantCamera::GetDeviceInfo

GetTLParams#

virtual CameraTraitsT::TlParams_t & GetTLParams()

Provides access to the transport layer parameters of the attached Pylon Device.

Return: Reference to the transport layer parameters.

Precondition: A Pylon Device is attached.

Error Safety:

The Instant Camera object is still valid after error.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

GetStreamGrabberParams#

virtual CameraTraitsT::StreamGrabberParams_t & GetStreamGrabberParams()

Provides access to the stream grabber parameters of the attached Pylon Device.

Return: Reference to the stream grabber parameters.

Precondition:

  • A Pylon Device is attached.
  • The Pylon Device is open.

Error Safety:

The Instant Camera object is still valid after error.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

GetEventGrabberParams#

virtual CameraTraitsT::EventGrabberParams_t & GetEventGrabberParams()

Provides access to the event grabber parameters of the attached Pylon Device.

Return: Reference to the event grabber parameters.

Precondition:

  • A Pylon Device is attached.
  • The Pylon Device is open.

Error Safety:

The Instant Camera object is still valid after error.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

IsPylonDeviceAttached#

virtual bool IsPylonDeviceAttached() const

Returns the Pylon device attached state of the Instant Camera object.

Return: True if a Pylon device is attached.

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

IsCameraDeviceRemoved#

virtual bool IsCameraDeviceRemoved() const

Returns the connection state of the camera device.

Return: True if the camera device removal from the PC has been detected.

Attention: Due to technical reasons, the IsCameraDeviceRemoved() property may not be updated immediately after the first error caused by a device removal occurs.

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

The device removal is only detected while the Instant Camera and therefore the attached Pylon device are open.

The attached Pylon device is not operable anymore if the camera device has been removed from the PC. After it is made sure that no access to the Pylon device or any of its node maps is made anymore the Pylon device should be destroyed using CInstantCamera::DeviceDestroy(). The access to the Pylon device can be protected using the lock provided by GetLock(), e.g. when accessing parameters.

HasOwnership#

virtual bool HasOwnership() const

Returns the ownership of the attached Pylon device.

Return: True if a Pylon device is attached and the Instant Camera object has been given the ownership by passing the cleanup procedure Cleanup_Delete when calling Attach().

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

IsOpen#

virtual bool IsOpen() const

Returns the open state of the attached Pylon device object.

Return: Returns true if a Pylon device is attached and it is open.

Note: This method still returns true if the camera device has been physically removed from the PC while the attached Pylon device object is open. The Pylon device object will not automatically close itself on device removal. It must be closed by calling CInstantCamera::Close(). The IsCameraDeviceRemoved() method can be used to check if the connection to the camera device has been lost while the attached Pylon device object is open.

Error Safety: Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

StartGrabbing#

virtual void StartGrabbing(
    EGrabStrategy strategy =GrabStrategy_OneByOne,
    EGrabLoop grabLoopType =GrabLoop_ProvidedByUser
)

Starts the grabbing of images.

Parameters:

  • strategy The grab strategy. See Pylon::EGrabStrategy for more information
  • grabLoopType If grabLoopType equals GrabLoop_ProvidedByInstantCamera, an additional grab loop thread is used to run the grab loop.

Precondition:

  • A Pylon device is attached.
  • The stream grabber of the Pylon device is closed.
  • The grabbing is stopped.
  • The attached Pylon device supports grabbing.
  • Must not be called while holding the lock provided by GetLock() when using the grab loop thread.

Postcondition:

  • The grabbing is started.
  • Grab-specific parameters of the camera object are locked, e.g. MaxNumBuffers.
  • If grabLoopType equals GrabLoop_ProvidedByInstantCamera, an additional grab loop thread is running that calls RetrieveResult( GrabLoopThreadTimeout, grabResult) in a loop. Images are processed by registered image event handlers.
  • Operating the stream grabber from outside the camera object will result in undefined behavior.

Error Safety:

The Instant Camera object is still valid after error. Open() may throw. Configuration event calls may throw. The grab implementation may throw. The grabbing is stopped with StopGrabbing() if the OnGrabStarted event call triggers an exception. Throws a C++ exception, if Upcoming Image grab strategy is used together with USB camera devices.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

  • If a grab loop thread has been used in the last grab session, the grab loop thread context is joined with the caller's context.
  • If the Pylon device is not already open, it is opened by calling Open().
  • The configuration event OnGrabStart is fired. The notification of event handlers stops when an event call triggers an exception.
  • Grab-specific parameters of the camera object are locked, e.g. MaxNumBuffers.
  • If the camera device parameter ChunkModeActive is enabled, the Instant Camera chunk parsing support is initialized.
  • If the Instant Camera parameter GrabCameraEvents is enabled, the Instant Camera event grabbing support is initialized.
  • The grabbing is started.
  • The AcquisitionStart command of the camera device is executed.
  • The configuration event OnGrabStarted is fired if the grab has been started successfully. The notification of event handlers stops when an event call triggers an exception.
  • If grabLoopType equals GrabLoop_ProvidedByInstantCamera, an additional grab loop thread is started calling RetrieveResult( GrabLoopThreadTimeout, grabResult) in a loop.

StartGrabbing#

virtual void StartGrabbing(
    size_t maxImages,
    EGrabStrategy strategy =GrabStrategy_OneByOne,
    EGrabLoop grabLoopType =GrabLoop_ProvidedByUser
)

Starts the grabbing for a maximum number of images.

Parameters:

  • maxImages The count of images to grab. This value must be larger than zero.
  • strategy The grab strategy. See Pylon::InstantCamera::EStrategy for more information.
  • grabLoopType If grabLoopType equals GrabLoop_ProvidedByInstantCamera, an additional grab loop thread is used to run the grab loop.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

Extends the StartGrabbing(EStrategy, EGrabLoop) by a number of images to grab. If the passed count of images has been reached, StopGrabbing is called automatically. The images are counted according to the grab strategy. Skipped images are not taken into account.

The amount of allocated buffers is reduced to maxImages when grabbing fewer images than according to the value of the MaxNumBuffer parameter and the grab strategy is GrabStrategy_OneByOne.

RetrieveResult#

virtual bool RetrieveResult(
    unsigned int timeoutMs,
    CGrabResultPtr & grabResult,
    ETimeoutHandling timeoutHandling =TimeoutHandling_ThrowException
)

Retrieves a grab result according to the strategy, waits if it is not yet available.

Parameters:

  • timeoutMs A timeout value in ms for waiting for a grab result, or the INFINITE value.
  • grabResult Receives the grab result.
  • timeoutHandling If timeoutHandling equals TimeoutHandling_ThrowException, a timeout exception is thrown on timeout.

Return: True if the call successfully retrieved a grab result, false otherwise.

Precondition:

  • There is no other thread waiting for a result. This will be the case when the Instant Camera grab loop thread is used.

Postcondition:

  • If a grab result has been retrieved, one image is removed from the output queue and is returned in the grabResult parameter.
  • If no grab result has been retrieved, an empty grab result is returned in the grabResult parameter.
  • If the maximum number of images has been grabbed, the grabbing is stopped.
  • If camera event handling is enabled and camera events were received, at least one or more camera event messages have been processed.

Error Safety:

The Instant Camera object is still valid after error. The grabbing is stopped if an exception is thrown.

Thread Safety:

This method is synchronized using the lock provided by GetLock() while not waiting.

  • The content of the passed grab result is released.
  • If no Pylon device is attached or the grabbing is not started, the method returns immediately "false".
  • Wait for a grab result if it is not yet available. The access to the camera is not locked during waiting. Camera events are handled.
  • Only if camera events are used: Incoming camera events are handled.
  • One grab result is retrieved per call according to the strategy applied.
  • Only if chunk mode is used: The chunk data parsing is performed. The grab result data is updated using chunk data.
  • The image event OnImagesSkipped is fired if grab results have been skipped according to the strategy. The notification of event handlers stops when an event call triggers an exception.
  • The image event OnImageGrabbed is fired if a grab result becomes available. The notification of event handlers stops when an event call triggers an exception.
  • Stops the grabbing by calling StopGrabbing() if the maximum number of images has been grabbed. It needs to be checked whether the grab represented by the grab result has been successful, see CGrabResultData::GrabSucceeded().

StopGrabbing#

virtual void StopGrabbing()

Stops the grabbing of images.

Postcondition:

  • The grabbing is stopped.
  • If the Pylon device has been opened by StartGrabbing and no other camera object service requires it to be open, it is closed.
  • Grab specific parameters of the camera object are unlocked, e.g. MaxNumBuffers.

Error Safety:

Does not throw C++ exceptions. Possible C++ exceptions are caught and ignored.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

  • Nothing is done if the Instant Camera is not currently grabbing.
  • The configuration event OnGrabStop is fired. Possible C++ exceptions from event calls are caught and ignored. All event handlers are notified.
  • The AcquisitionStop command of the camera device is executed.
  • The grabbing is stopped.
  • All buffer queues of the Instant Camera are cleared.
  • The OnGrabStopped configuration event is fired if the grab has been stopped successfully. Possible C++ exceptions from event calls are caught and ignored. All event handlers are notified.
  • If the Instant Camera has been opened by StartGrabbing, it is closed by calling Close().
  • Grab-specific parameters of the camera object are unlocked, e.g. MaxNumBuffers.

IsGrabbing#

virtual bool IsGrabbing() const

Returns state of grabbing.

Return: Returns true if still grabbing.

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

The camera object is grabbing after a successful call to StartGrabbing() until StopGrabbing() is called.

GrabOne#

virtual bool GrabOne(
    unsigned int timeoutMs,
    CGrabResultPtr & grabResult,
    ETimeoutHandling timeoutHandling =TimeoutHandling_ThrowException
)

Grabs one image.

Parameters:

  • timeoutMs A timeout value in ms for waiting for a grab result, or the INFINITE value.
  • grabResult Receives the grab result.
  • timeoutHandling If timeoutHandling equals TimeoutHandling_ThrowException, a timeout exception is thrown on timeout.

Return: Returns true if the call successfully retrieved a grab result and the grab succeeded (CGrabResultData::GrabSucceeded()).

Note:

Precondition: Must meet the preconditions of start grabbing.

Postcondition: Meets the postconditions of stop grabbing.

Error Safety:

The Instant Camera object is still valid after error. See StartGrabbing(), RetrieveResult(), and StopGrabbing() . In the case of exceptions after StartGrabbing() the grabbing is stopped using StopGrabbing().

The following code shows a simplified version of what is done (happy path):

//grab one image
StartGrabbing( 1, GrabStrategy_OneByOne, GrabLoop_ProvidedByUser);

//grab is stopped automatically due to maxImages = 1
return RetrieveResult( timeoutMs, grabResult, timeoutHandling) && grabResult->GrabSucceeded();

GrabOne() can be used to together with the CAcquireSingleFrameConfiguration.

GetQueuedBufferCount#

virtual size_t GetQueuedBufferCount()

Deprecated: This method has been deprecated.

Return: The number of buffers that are queued for grabbing.

Use the NumQueuedBuffers parameter instead.

GetGrabResultWaitObject#

virtual const WaitObject & GetGrabResultWaitObject()

Provides access to a wait object indicating available grab results.

Return: A wait object indicating available grab results.

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

GetGrabStopWaitObject#

virtual const WaitObject & GetGrabStopWaitObject()

Provides access to a wait object indicating that the grabbing has stopped.

Return: A wait object indicating that the grabbing has stopped.

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

GetCameraEventWaitObject#

virtual const WaitObject & GetCameraEventWaitObject()

Provides access to a wait object indicating available camera events.

Return: A wait object indicating available camera events.

Precondition:

  • A Pylon device is attached.
  • The Pylon device is open.

Error Safety:

The Instant Camera object is still valid after error.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

This wait object is Pylon device specific and changes when a new Pylon device is attached to the camera.

RegisterConfiguration#

virtual void RegisterConfiguration(
    CConfigurationEventHandler * pConfigurator,
    ERegistrationMode mode,
    ECleanup cleanupProcedure
)

Adds a configurator to the list of registered configurator objects.

Parameters:

  • pConfigurator The receiver of configuration events.
  • mode Indicates how to register the new configurator.
  • cleanupProcedure If cleanupProcedure equals Cleanup_Delete, the passed event handler is deleted when no longer needed.

Postcondition: The configurator is registered and called on configuration events.

Error Safety:

Does not throw C++ exceptions, except when memory allocation fails.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

  • If mode equals RegistrationMode_ReplaceAll, the list of registered configurators is cleared.
  • If pointer pConfigurator is not NULL, it is appended to the list of configurators.

DeregisterConfiguration#

virtual bool DeregisterConfiguration(
    CConfigurationEventHandler * configurator
)

Removes a configurator from the list of registered configurator objects.

Parameters:

  • configurator The registered receiver of configuration events.

Return: True if successful

Postcondition:

  • The configurator is deregistered.
  • If the configuration has been registered by passing a pointer and the cleanup procedure is Cleanup_Delete, the event handler is deleted.

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

If the configurator is not found, nothing is done.

RegisterImageEventHandler#

virtual void RegisterImageEventHandler(
    CImageEventHandler * pImageEventHandler,
    ERegistrationMode mode,
    ECleanup cleanupProcedure
)

Adds an image event handler to the list of registered image event handler objects.

Parameters:

  • pImageEventHandler The receiver of image events.
  • mode Indicates how to register the new imageEventHandler.
  • cleanupProcedure If cleanupProcedure equals Cleanup_Delete, the passed event handler is deleted when no longer needed.

Postcondition: The imageEventHandler is registered and called on image related events.

Error Safety:

Does not throw C++ exceptions, except when memory allocation fails.

Thread Safety:

This method is synchronized using the internal image event handler registry lock.

  • If mode equals RegistrationMode_ReplaceAll, the list of registered image event handlers is cleared.
  • If pointer pImageEventHandler is not NULL, it is appended to the list of image event handlers.

DeregisterImageEventHandler#

virtual bool DeregisterImageEventHandler(
    CImageEventHandler * imageEventHandler
)

Removes an image event handler from the list of registered image event handler objects.

Parameters:

  • imageEventHandler The registered receiver of configuration events.

Return: True if successful

Postcondition:

  • The imageEventHandler is deregistered.
  • If the image event handler has been registered by passing a pointer and the cleanup procedure is Cleanup_Delete, the event handler is deleted.

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the internal image event handler registry lock.

If the image event handler is not found, nothing is done.

RegisterCameraEventHandler#

virtual void RegisterCameraEventHandler(
    CCameraEventHandler * pCameraEventHandler,
    const String_t & nodeName,
    intptr_t userProvidedId,
    ERegistrationMode mode,
    ECleanup cleanupProcedure,
    ECameraEventAvailability availability =CameraEventAvailability_Mandatory
)

Adds an camera event handler to the list of registered camera event handler objects.

Parameters:

  • pCameraEventHandler The receiver of camera events.
  • nodeName The name of the event data node updated on camera event, e.g. "ExposureEndEventTimestamp" for exposure end event.
  • userProvidedId This ID is passed as a parameter in CCameraEventHandler::OnCameraEvent and can be used to distinguish between different events. It is recommended to create an own application specific enum and use it's values as IDs.
  • mode Indicates how to register the new cameraEventHandler.
  • cleanupProcedure If cleanupProcedure equals Cleanup_Delete, the passed event handler is deleted when no longer needed.
  • availability If availability equals CameraEventAvailability_Mandatory, the camera must support the data node specified by node name. If not, an exception is thrown when the Instant Camera is open, the Instant Camera is opened, or an open Pylon device is attached.

Postcondition: The cameraEventHandler is registered and called on camera events.

Error Safety:

Throws an exception if the availability is set to CameraEventAvailability_Mandatory and the node with the name nodeName is not available in the camera node map (see GetNodeMap()). Throws an exception fail if the node callback registration fails. The event handler is not registered when an C++ exception is thrown.

Thread Safety:

This method is synchronized using the camera event handler lock. If the camera is open, the lock provided by GetLock() and the camera node map lock are also used for synchronization.

  • If mode equals RegistrationMode_ReplaceAll, the list of registered camera event handlers is cleared.
  • If the pointer pCameraEventHandler is not NULL, it is appended to the list of camera event handlers.

Internally, a GenApi node call back is registered for the node identified by nodeName. This callback triggers a call to the CCameraEventHandler::OnCameraEvent() method. That's why a Camera Event Handler can be registered for any node of the camera node map to get informed about changes.

DeregisterCameraEventHandler#

virtual bool DeregisterCameraEventHandler(
    CCameraEventHandler * cameraEventHandler,
    const String_t & nodeName
)

Removes a camera event handler from the list of registered camera event handler objects.

Parameters:

  • cameraEventHandler The registered receiver of camera events.
  • nodeName The name of the event data node updated on camera event, e.g. "ExposureEndEventTimestamp" for exposure end event.

Return: True if successful

Postcondition:

  • The cameraEventHandler is deregistered.
  • If the camera event handler has been registered by passing a pointer and the cleanup procedure is Cleanup_Delete, the event handler is deleted.

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the camera event handler lock. If the camera is open, the camera node map lock is also used for synchronization.

If the camera event handler is not found, nothing is done.

WaitForFrameTriggerReady#

virtual bool WaitForFrameTriggerReady(
    unsigned int timeoutMs,
    ETimeoutHandling timeoutHandling =TimeoutHandling_ThrowException
)

Actively waits until the the camera is ready to accept a frame trigger.

Parameters:

  • timeoutMs The timeout in ms for active waiting.
  • timeoutHandling If timeoutHandling equals TimeoutHandling_ThrowException, a timeout exception is thrown on timeout.

Return: True if the camera can execute a frame trigger.

Precondition: The 'AcquisitionStatusSelector' node is writable and the 'AcquisitionStatus' node is readable or the 'SoftwareTrigger' node is readable. This depends on the used camera model.

Error Safety:

Accessing the camera registers may fail.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

The implementation selects 'FrameTriggerWait' for the 'AcquisitionStatusSelector' and waits until the 'AcquisitionStatus' is true. If the above mentioned nodes are not available and the 'SoftwareTrigger' node is readable, the implementation waits for SoftwareTrigger.IsDone().

The WaitForFrameTriggerReady method does not work for A600 Firewire cameras.

CanWaitForFrameTriggerReady#

virtual bool CanWaitForFrameTriggerReady() const

Checks to see whether the camera device can be queried whether it is ready to accept the next frame trigger.

Return: Returns true if the camera is open and the camera device can be queried whether it is ready to accept the next frame trigger.

Note: If a camera device can't be queried whether it is ready to accept the next frame trigger, the camera device is ready to accept the next trigger after the last image triggered has been grabbed, e.g. after you have retrieved the last image triggered using RetrieveResult(). Camera devices that can be queried whether they are ready to accept the next frame trigger, may not be ready for the next frame trigger after the last image triggered has been grabbed.

Postcondition: The 'AcquisitionStatusSelector' is set to 'FrameTriggerWait' if writable.

Error Safety:

Accessing the camera registers may fail.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

If 'FrameTriggerWait' can be selected for 'AcquisitionStatusSelector' and 'AcquisitionStatus' is readable, the camera device can be queried whether it is ready to accept the next frame trigger.

If the nodes mentioned above are not available and the 'SoftwareTrigger' node is readable, the camera device can be queried whether it is ready to accept the next frame trigger.

ExecuteSoftwareTrigger#

virtual void ExecuteSoftwareTrigger()

Executes the software trigger command.

Note: The application has to make sure that the correct trigger is selected before calling ExecuteSoftwareTrigger(). This can be done via the camera's TriggerSelector node. The Pylon::CSoftwareTriggerConfiguration selects the correct trigger when the Instant Camera is opened.

Precondition:

  • The grabbing is started.
  • The camera device supports software trigger.
  • The software trigger is available. This depends on the configuration of the camera device.

Error Safety:

Accessing the camera registers may fail. Throws an exception on timeout if timeoutHandling is TimeoutHandling_ThrowException.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

The camera needs to be configured for software trigger mode. Additionally, the camera needs to be ready to accept triggers. When triggering a frame this can be checked using the WaitForFrameTriggerReady() method;

SetCameraContext#

virtual void SetCameraContext(
    intptr_t context
)

Sets a context that is attached to each grab result of the camera object on RetrieveResult().

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

This is useful when handling multiple cameras. It has nothing in common with the context passed to the stream grabber when queuing a buffer.

GetCameraContext#

virtual intptr_t GetCameraContext() const

Returns the context that is attached to each grab result of the camera object.

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

GetNodeMap#

virtual GenApi::INodeMap & GetNodeMap()

Provides access to the node map of the camera device.

Return: Reference to the node map of the camera device.

Precondition: A Pylon device is attached.

Error Safety:

The Instant Camera object is still valid after error.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

The Pylon device must be opened before reading ore writing any parameters of the camera device. This can be done using the Open() method of the Instant Camera class.

GetTLNodeMap#

virtual GenApi::INodeMap & GetTLNodeMap()

Provides access to the transport layer node map of the attached Pylon device.

Return: Reference to the transport layer node map of the attached Pylon device or the reference to the empty node map if a transport layer node map is not supported. The GenApi::INodeMap::GetNumNodes() method can be used to check whether the node map is empty.

Precondition: A Pylon device is attached.

Error Safety:

The Instant Camera object is still valid after error.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

GetStreamGrabberNodeMap#

virtual GenApi::INodeMap & GetStreamGrabberNodeMap()

Provides access to the stream grabber node map of the attached Pylon device.

Return: Reference to the stream grabber node map of the attached Pylon device or the reference to the empty node map if grabbing is not supported. The GenApi::INodeMap::GetNumNodes() method can be used to check whether the node map is empty.

Precondition:

  • A Pylon device is attached.
  • The Pylon device is open.

Error Safety:

The Instant Camera object is still valid after error.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

GetEventGrabberNodeMap#

virtual GenApi::INodeMap & GetEventGrabberNodeMap()

Provides access to the event grabber node map of the attached Pylon device.

Return: Reference to the event grabber node map of the attached Pylon device or a reference to the empty node map if event grabbing is not supported. The GenApi::INodeMap::GetNumNodes() method can be used to check whether the node map is empty.

Precondition:

  • A Pylon device is attached.
  • The Pylon device is open.

Error Safety:

The Instant Camera object is still valid after error.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

GetInstantCameraNodeMap#

virtual GenApi::INodeMap & GetInstantCameraNodeMap()

Provides access to the node map of the Instant Camera object.

Return: Reference to the node map of the Instant Camera object.

Error Safety:

Does not throw C++ exceptions.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

The node map of the camera device is made available by the GetNodeMap() method.

SetBufferFactory#

virtual void SetBufferFactory(
    IBufferFactory * pFactory,
    ECleanup cleanupProcedure =Cleanup_Delete
)

Sets an alternative buffer factory that is used for buffer allocation.

Parameters:

  • pFactory A pointer to a buffer factory.
  • cleanupProcedure If ownership is cleanupProcedure Cleanup_Delete, the passed factory is destroyed when no longer needed.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

This use of this method is optional and intended for advanced use cases only.

If NULL is passed as buffer factory then the default buffer factory is used. Buffers are allocated when StartGrabbing is called. A buffer factory must not be deleted while it is attached to the camera object and it must not be deleted until the last buffer is freed. To free all buffers the grab needs to be stopped and all grab results must be released or destroyed.

Is1394#

virtual bool Is1394() const

Returns true if an IEEE 1394 Pylon device is attached to the Instant Camera object.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

This method is provided for convenience only. The device type can also be determined as shown in the following example.

#include <pylon/DeviceClass.h>
...
if (camera.GetDeviceInfo().GetDeviceClass() == Basler1394DeviceClass)
{
    ...
}

IsGigE#

virtual bool IsGigE() const

Returns true if a GigE Pylon device is attached to the Instant Camera object.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

This method is provided for convenience only. The device type can also be determined as shown in the following example.

#include <pylon/DeviceClass.h>
...
if (camera.GetDeviceInfo().GetDeviceClass() == BaslerGigEDeviceClass)
{
...
}

IsUsb#

virtual bool IsUsb() const

Returns true if a USB Pylon device is attached to the Instant Camera object.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

This method is provided for convenience only. The device type can also be determined as shown in the following example.

#include <pylon/DeviceClass.h>
...
if (camera.GetDeviceInfo().GetDeviceClass() == BaslerUsbDeviceClass)
{
...
}
virtual bool IsCameraLink() const

Returns true if a Camera Link Pylon device is attached to the Instant Camera object.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

This method is provided for convenience only. The device type can also be determined as shown in the following example.

#include <pylon/DeviceClass.h>
...
if (camera.GetDeviceInfo().GetDeviceClass() == BaslerCameraLinkDeviceClass)
{
...
}

IsCxp#

virtual bool IsCxp() const

Returns true if a CoaXPress GenTL device is attached to the Instant Camera object.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

This method is provided for convenience only.

GetSfncVersion#

VersionInfo GetSfncVersion() const

Returns the SFNC version read from the camera node map.

Return: The SFNC version used by the camera device. The returned SFNC version is 0.0.0 (Pylon::Sfnc_VersionUndefined) if no SFNC version information is provided by the camera device.

Precondition: A Pylon device is attached.

Error Safety:

The Instant Camera object is still valid after error.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

The SFNC version is read from the camera node map using the integer nodes DeviceSFNCVersionMajor, DeviceSFNCVersionMinor, and DeviceSFNCVersionSubMinor.

GetExtensionInterface#

IInstantCameraExtensions & GetExtensionInterface()

Protected Functions Documentation#

GetDevice#

virtual IPylonDevice * GetDevice()

Provides access to the attached Pylon device.

Return: Pointer to the attached Pylon device.

Precondition: A Pylon device is attached.

Error Safety:

The Instant Camera object is still valid after error.

Thread Safety:

This method is synchronized using the lock provided by GetLock().

GetLock#

CLock & GetLock()

Provides access to the lock used for synchronizing the access to the camera.

Error Safety:

Does not throw C++ exceptions.

This lock can be used when extending the Instant Camera class.

Example:

class CMyInstantCamera : public CInstantCamera
{
    // Method extending the Instant Camera class
    void Foo()
    {
        // Scoped Lock.
        AutoLock lock( CInstantCamera::GetLock());

        //...
    }
 };

GetEmptyNodeMap#

GenApi::INodeMap & GetEmptyNodeMap()

InternalRegisterConfiguration#

void InternalRegisterConfiguration(
    CConfigurationEventHandler * ,
    ERegistrationMode ,
    ECleanup ,
    const long * 
)

InternalRegisterImageEventHandler#

void InternalRegisterImageEventHandler(
    CImageEventHandler * ,
    ERegistrationMode ,
    ECleanup ,
    const long * 
)

InternalRegisterCameraEventHandler#

void InternalRegisterCameraEventHandler(
    CCameraEventHandler * ,
    const String_t & ,
    intptr_t ,
    ERegistrationMode ,
    ECleanup ,
    ECameraEventAvailability ,
    const long * 
)

InternalDeregisterConfiguration#

bool InternalDeregisterConfiguration(
    const long * 
)

InternalDeregisterImageEventHandler#

bool InternalDeregisterImageEventHandler(
    const long * 
)

InternalDeregisterCameraEventHandler#

bool InternalDeregisterCameraEventHandler(
    const long * ,
    const String_t & 
)

InternalShutdownEventHandlers#

void InternalShutdownEventHandlers()

CreateDeviceSpecificGrabResultData#

virtual CGrabResultData * CreateDeviceSpecificGrabResultData()

Reimplemented by: Pylon::CBaslerUniversalInstantCamera::CreateDeviceSpecificGrabResultData

Public Attributes Documentation#

AcquisitionStartStopExecutionEnable#

Pylon::IBooleanEx & AcquisitionStartStopExecutionEnable;

If set, this will automatically execute AcquisitionStart when calling StartGrabbing and AcquisitionStop when calling StopGrabbing This option is enabled by default - Applies to: InstantCamera.

Visibility: Guru

ChunkNodeMapsEnable#

Pylon::IBooleanEx & ChunkNodeMapsEnable;

Enables/disables the use of a chunk node map for each grab result Grab result chunk node maps can be disabled to save resources - Applies to: InstantCamera.

Visibility: Guru

ClearBufferModeEnable#

Pylon::IBooleanEx & ClearBufferModeEnable;

If set, all buffers will be cleared (set to 0) before grabbing an image Note that this requires additional processing time per frame - Applies to: InstantCamera.

Visibility: Guru

GrabCameraEvents#

Pylon::IBooleanEx & GrabCameraEvents;

Enables/disables the grabbing of camera events while images are grabbed Is writable when the camera object is closed - Applies to: InstantCamera.

Visibility: Expert

MaxNumBuffer#

Pylon::IIntegerEx & MaxNumBuffer;

The maximum number of buffers that are allocated and used for grabbing - Applies to: InstantCamera.

Visibility: Beginner

MaxNumGrabResults#

Pylon::IIntegerEx & MaxNumGrabResults;

The maximum number of grab results available at any time during a grab session This value can be limited to save resources Furthermore, it can be used to check that the grab results are returned correctly - Applies to: InstantCamera.

Visibility: Beginner

MaxNumQueuedBuffer#

Pylon::IIntegerEx & MaxNumQueuedBuffer;

The maximum number of buffers that are queued in the stream grabber input queue - Applies to: InstantCamera.

Visibility: Beginner

MigrationModeActive#

Pylon::IBooleanEx & MigrationModeActive;

The migration mode is set up according to this setting at defined points e g , when the camera is opened - Applies to: InstantCamera.

Visibility: Guru

MonitorModeActive#

Pylon::IBooleanEx & MonitorModeActive;

The camera object is set to monitor mode when enabled, e g when using the GigE multicast feature Is writable when the camera object is closed - Applies to: InstantCamera.

Visibility: Guru

NumEmptyBuffers#

Pylon::IIntegerEx & NumEmptyBuffers;

The number of empty buffers that are not used for grabbing yet - Applies to: InstantCamera.

Visibility: Expert

NumQueuedBuffers#

Pylon::IIntegerEx & NumQueuedBuffers;

The number of buffers queued at Low Level API stream grabber - Applies to: InstantCamera.

This is the number of buffers that are queued for grabbing in the stream grabber. The number is influenced by the number of available free buffers and the maximum number of buffers that can be queued. See also the MaxNumBuffer and MaxNumQueuedBuffer parameters.

This parameter can be used to check whether the number of buffers ready for grabbing is stable, which means that the image processing is fast enough to keep up with the rate of incoming images when using the GrabStrategy_OneByOne grab strategy.

Visibility: Expert

NumReadyBuffers#

Pylon::IIntegerEx & NumReadyBuffers;

The number of grab result buffers in the output queue that are ready for retrieval - Applies to: InstantCamera.

Visibility: Expert

OutputQueueSize#

Pylon::IIntegerEx & OutputQueueSize;

The size of the grab result buffer output queue - Applies to: InstantCamera.

Visibility: Expert

StaticChunkNodeMapPoolSize#

Pylon::IIntegerEx & StaticChunkNodeMapPoolSize;

If larger than 0, a static chunk node map pool is used instead of dynamic chunk node map creation - Applies to: InstantCamera.

Visibility: Guru

UseExtendedIdIfAvailable#

Pylon::IBooleanEx & UseExtendedIdIfAvailable;

Use Extended ID if available in the camera and supported by the driver - Applies to: InstantCamera.

Enabling this setting will use Extended ID if it is supported by the camera and driver. If it is not supported, it will not be used and this setting has no negative side effects.

Visibility: Guru

GrabLoopThreadPriority#

Pylon::IIntegerEx & GrabLoopThreadPriority;

The grab loop thread priority - Applies to: InstantCamera.

This value sets the absolute thread priority for the grab loop thread.

Visibility: Guru

GrabLoopThreadPriorityOverride#

Pylon::IBooleanEx & GrabLoopThreadPriorityOverride;

If enabled, the user can set a custom priority for the grab loop thread Otherwise, the priority of the newly created thread is not changed - Applies to: InstantCamera.

Visibility: Guru

GrabLoopThreadTimeout#

Pylon::IIntegerEx & GrabLoopThreadTimeout;

A custom timeout for the grab loop thread's call to RetrieveResult RetrieveResult is configured to throw an exception on timeout, which will stop the grab session - Applies to: InstantCamera.

Visibility: Beginner

GrabLoopThreadUseTimeout#

Pylon::IBooleanEx & GrabLoopThreadUseTimeout;

If enabled, the user can set a custom timeout for the grab loop thread's call to RetrieveResult RetrieveResult is configured to throw an exception on timeout, which will stop the grab session - Applies to: InstantCamera.

Visibility: Guru

InternalGrabEngineThreadPriority#

Pylon::IIntegerEx & InternalGrabEngineThreadPriority;

The internal grab engine thread priority - Applies to: InstantCamera.

This value sets the absolute thread priority for the internal grab engine thread operating the stream grabber.

Visibility: Guru

InternalGrabEngineThreadPriorityOverride#

Pylon::IBooleanEx & InternalGrabEngineThreadPriorityOverride;

If enabled, the user can set a custom priority for the internal grab engine thread operating the stream grabber Otherwise the priority defaults to 25 - Applies to: InstantCamera.

Visibility: Guru

Protected Attributes Documentation#

m_pTlParams#

CameraTraitsT::TlParams_t * m_pTlParams;

m_pStreamGrabberParams#

CameraTraitsT::StreamGrabberParams_t * m_pStreamGrabberParams;

m_pEventGrabberParams#

CameraTraitsT::EventGrabberParams_t * m_pEventGrabberParams;

Updated on 5 July 2022 at 15:30:00