nxLibInitialize

<< Click to Display Table of Contents >>

Navigation:  NxLib API > C Interface > Other > NxLib >

nxLibInitialize

Explicitly initializes the library and starts to enumerate the connected cameras. When omitting this function call, the library is initialized on first access to the tree.

Signatures

Variants throwing exceptions on errors:

static void nxLibInitialize(bool waitForInitialCameraRefresh = true)

Variants returning an error code in an int* parameter:

void nxLibInitialize(NXLIBERR* result, NXLIBBOOL waitForInitialCameraRefresh)

Parameters

result

The error code of the operation.

waitForInitialCameraRefresh

Specifies whether to wait for all cameras to be enumerated or to return immediately.

Return Value

none

Initialization Details

Initialization method

Tree state in first access

Runtime behavior / State of camera listing after initialization

Directly access the tree, without calling nxLibInitialize

NxLib will be initialized and all tree items will be created. The camera list will only contain information about cached cameras, other cameras will be listed as monocular cameras. The camera's link nodes  are not yet created. The user cannot be sure which cameras are actually stereo cameras, and which are monocular cameras.

Initialization will complete within a few milliseconds (usually <10ms).

The tree can be accessed before the final listing of cameras is complete; only cached cameras will be listed immediately. The camera's Link nodes will not be available after initialization.

Call nxLibInitialize with waitForInitialCameraRefresh == false, then access the tree

NxLib will be initialize and the camera listing will populate the camera list with cached camera information. If cameras are connected to the system that are not yet contained in the cache file, the eeprom contents of these cameras will be read as well, before nxLibInitialize returns. With this method the identification of stereo and monocular cameras is guaranteed, but the camera's link nodes are not yet created for cached cameras.

Initialization will complete within a few milliseconds (usually < 10ms) if all connected cameras are in the cache file. This is the case if they have already been seen by a previous camera listing of an NxLib instance on this system. If uncached cameras are present, the listing will open them to read their eeprom contents. In this case initialization can take several seconds to complete, especially if network cameras are present.

After nxLibInitialize returns the camera list is final, except that link information is not available for cached cameras.

Call nxLibInitialize with waitForInitialCameraRefresh == true, then access the tree

NxLib will be initialize and the camera listing will populate the camera list completely. All camera eeprom contents will be read and the camera's link nodes will be created and populated before nxLibInitialize returns.

Initialization will complete within a few seconds. All connected cameras will be opened and their eeprom contents will be read.

After nxLibInitialize returns the camera listing is complete and all link nodes are populated with the information from each camera's eeprom.

Note: After nxLibFinalize was called, the library will no longer be initialized automatically when you access the tree. You can reinitialize it by explicitly calling nxLibInitialize.

Note: All initialization methods will eventually fully populate the camera list, also including full link information. The initialization methods only allow the user to access the tree at earlier points in time if his application does not need guarantees on the completeness of the listing. NxView for example uses the fastest "direct access" initialization to present the user with a preliminary camera listing as fast as possible, and then the listing is completed while the user already has time to choose from existing cached cameras.