NxLib¶
nxLibInitialize¶
-
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.
-
static void nxLibInitialize(bool waitForInitialCameraRefresh = true)¶
-
Note
C++ only This function is an overload accessible only in C++. Instead of returning the result code as an output parameter like its C counterpart, it throws an NxLibException in case of an error.
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.
-
static void nxLibFinalize()¶
-
Note
C++ only This function is an overload accessible only in C++. Instead of returning the result code as an output parameter like its C counterpart, it throws an NxLibException in case of an error.
nxLibOpenTcpPort¶
-
void nxLibOpenTcpPort(int32_t *result, int32_t portNumber, int32_t *openedPort)¶
Opens a TCP port through 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
result – The error code of the operation.
portNumber – The port to open. Specify 0 here to automatically select a port in the range 24000 to 25000.
openedPort – A pointer to a variable that gets the number of the opened port.
-
static void nxLibOpenTcpPort(int portNumber = 0, int *openedPort = 0)¶
-
Note
C++ only This function is an overload accessible only in C++. Instead of returning the result code as an output parameter like its C counterpart, it throws an NxLibException in case of an error.
nxLibCloseTcpPort¶
-
void nxLibCloseTcpPort(int32_t *result)¶
Disconnects all connected NxLibRemote instances and closes the open TCP port, if any.
Note
This function is only available in the NxLib interface. NxLibRemote provides the corresponding functions nxLibConnect() and nxLibDisconnect().
- Parameters
result – The error code of the operation.
-
static void nxLibCloseTcpPort()¶
-
Note
C++ only This function is an overload accessible only in C++. Instead of returning the result code as an output parameter like its C counterpart, it throws an NxLibException in case of an error.
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.
-
static void nxLibWriteDebugMessage(std::string const &message)¶
-
Note
C++ only This function is an overload accessible only in C++. Instead of returning the result code as an output parameter like its C counterpart, it throws an NxLibException in case of an error.
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()
.- Possible Debug Levels
nxdInherit
: The block will inherit the debug level of its parent. When the block does not have a parent, this will correspond to the debug level"Info"
.nxdInfo
: Corresponds to the debug level"Info"
.nxdDebug
: Corresponds to the debug level"Debug"
.nxdTrace
: Corresponds to the debug level"Trace"
.
- Parameters
result – The error code of operation.
blockName – Debug block name.
level – Debug level of this block.
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 operation
threadName – Debug thread name.
-
static void nxLibSetDebugThreadName(std::string const &threadName)¶
-
Note
C++ only This function is an overload accessible only in C++. Instead of returning the result code as an output parameter like its C counterpart, it throws an NxLibException in case of an error.