Retrieves data of a Binary item.
Note: This function has variants taking a std::vector as buffer. These variants will conveniently query the item's data size first and resize the std::vector accordingly to fit the data. If the binary data size is not divisible the the vector element size an error will be returned. The variants with OpenCV matrices provide an even more convenient interface. They will also be allocated with the correct element type, dimensions and channel count.
Variants throwing exceptions on API errors:
void getBinaryData(void* bufferPointer, int bufferSize, int* numBytesCopied, double* timestamp) const
template <typename T> void getBinaryData(std::vector<T>& bufferVector, double* timestamp) const
void getBinaryData(cv::Mat& cvMat, double* timestamp) const
Variants returning API errors as int* parameter:
void getBinaryData(int* returnCode, void* bufferPointer, int bufferSize, int* numBytesCopied, double* timestamp) const
template <typename T> void getBinaryData(int* returnCode, std::vector<T>& bufferVector, double* timestamp) const
void getBinaryData(int* returnCode, cv::Mat& cvMat, double* timestamp) const
returnCode |
The error code returned when accessing the item. |
bufferPointer |
Pointer to a buffer where the binary data will be copied to. The buffer must have been allocated by the caller. |
bufferSize |
Size of the allocated buffer in bytes. |
numBytesCopied |
Pointer to an integer, can be 0. If non-zero the value will be set to the number of bytes actually copied to the user's buffer. |
bufferVector |
A std::vector that should be filled with the binary data. |
timestamp |
Timestamp when the binary blob was generated. This pointer can be set to zero when the time stamp should not be retrieved. |
cvMat |
An OpenCV matrix into which the binary node content should be copied. OpenCV interface functions are only available when CV_MAJOR_VERSION is defined while compiling the nxLibFunctions.h header file. |
none