NxLib¶
nxLibInitialize¶
-
void
nxLibInitialize
(bool waitForInitialCameraRefresh = true)¶ 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.
- 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.
- Parameters
waitForInitialCameraRefresh
: Specifies whether to wait for all cameras to be enumerated or to return immediately.
-
void
nxLibInitialize
(int32_t *result, int32_t waitForInitialCameraRefresh)¶ 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.
- 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.
- Parameters
result
: The error code of the operation.waitForInitialCameraRefresh
: Specifies whether to wait for all cameras to be enumerated or to return immediately.
nxLibFinalize¶
-
void
nxLibFinalize
(int32_t *result)¶ Explicitly closes the library, terminating all internal threads and freeing allocated memory. It is important to explicitly call nxLibFinalize before unloading the NxLib library when your process is not terminating afterwards, because Windows doesn’t allow to cleanly exit threads during DLL unload.
- Note
After closing the library with nxLibFinalize, it will no longer be automatically initialized when you attempt to access the tree.You can call nxLibInitialize to explicitly initialize the library again.
- Parameters
result
: The error code of the operation.
-
void
nxLibFinalize
()¶ Explicitly closes the library, terminating all internal threads and freeing allocated memory. It is important to explicitly call nxLibFinalize before unloading the NxLib library when your process is not terminating afterwards, because Windows doesn’t allow to cleanly exit threads during DLL unload.
- Note
After closing the library with nxLibFinalize, it will no longer be automatically initialized when you attempt to access the tree.You can call nxLibInitialize to explicitly initialize the library again.
nxLibOpenTcpPort¶
-
void
nxLibOpenTcpPort
(int portNumber = 0, int *openedPort = 0)¶ Opens a TCP port on which NxLibRemote can connect to the current NxLib instance.
- Note
This function is only available in the NxLib Interface. NxLibRemote provides the corresponding functions nxLibConnect() and nxLibDisconnect().
- Parameters
portNumber
: The port to open. Specify 0 here to automatically choose a port in the range 24000 to 25000.openedPort
: A pointer to a variable receiving the opened port number.
-
void
nxLibOpenTcpPort
(int32_t *result, int32_t portNumber, int32_t *openedPort)¶
nxLibCloseTcpPort¶
-
void
nxLibCloseTcpPort
(int32_t *result)¶
-
void
nxLibCloseTcpPort
()¶ Disconnects all connected NxLibRemote instances and closes the opened TCP port, if any.
- Note
This function is only available in the NxLib Interface. NxLibRemote provides the corresponding functions nxLibConnect() and nxLibDisconnect().
nxLibWriteDebugMessage¶
-
void
nxLibWriteDebugMessage
(int32_t *result, const char *message)¶ Inserts a user defined debug message into the NxLib debug stream. The message will be output as specified under the Debug node.
- Parameters
result
: The error code of the operation.message
: The message to be written.
-
void
nxLibWriteDebugMessage
(std::string const &message)¶ Inserts a user defined debug message into the NxLib debug stream. The message will be output as specified under the Debug node.
- Parameters
message
: The message to be written.
nxLibOpenDebugBlock¶
-
void
nxLibOpenDebugBlock
(int32_t *result, const char *blockName, int32_t level)¶ Starts a debug block. This information is used by NxProfiler for its visualization. Open debug blocks can be closed with nxLibCloseDebugBlock(). enum NxLibDebugLevel below:
- Parameters
result
: The error code of operation.blockName
: Debug block name.level
: Debug level of this block.
nxdInherit 0 The block will inherit the debug level of its parent. When no parent debug level is given, this will equal “Info”.
nxdInfo 1 Debug level “Info”
nxdDebug 2 Debug level “Debug”
nxdTrace 3 Debug level “Trace”
nxLibCloseDebugBlock¶
-
void
nxLibCloseDebugBlock
(int32_t *result)¶ Closes the current debug block at the inner most nesting level. This information is used by the NxProfiler for its visualization. Debug blocks can be started with nxLibOpenDebugBlock().
- Parameters
result
: The error code of operation.
nxLibSetDebugThreadName¶
-
void
nxLibSetDebugThreadName
(int32_t *result, const char *threadName)¶ Sets the debug name of the current thread. This name is used by the NxProfiler for the visualization of the debug information. Multiple threads with the same name and no simultaneously open blocks will be grouped together to a common time line.
- Parameters
result
: The error code of operationthreadName
: Debug thread name.
-
void
nxLibSetDebugThreadName
(std::string const &threadName)¶ Sets the debug name of the current thread. This name is used by the NxProfiler for the visualization of the debug information. Multiple threads with the same name and no simultaneously open blocks will be grouped together to a common time line.
- Parameters
threadName
: Debug thread name.