Small improvements#3
Open
andresh3 wants to merge 2 commits into
Open
Conversation
added 2 commits
March 25, 2026 09:06
The prior implementation of the getNextNumPyFrame method used the "frame.size" method to determine the buffer size; however the value of interest is not the size itself but the number of bytes. The consequence of this was that the datatype of the array had to be specifically a 1-byte datatype (i.e., uint8). If data in question is 16 bit for example, the user would need to supply one view of the buffer to the Pixielink Wrapper API using an 8-bit datatype, and use another view (with `dtype='>u2'` for example) to view or manipulate the data. Doing this may be useful for unpacking 12-bit packed, it is not always helpful.
The prior behavior looked for the `libPxLApi.so` shared object in proper install directories using the `CDLL` method (i.e., `/usr/lib`). This file itself is a Symlink, so the find command was also used to lookup the full file path in the $PIXELINK_SDK_LIB directory. Since we are already looking it up, I added support for directly importing the DLL file from the result of the find command if it is not found by the `CDLL` method first. This means that the SDK need not be "properly" installed, but simply placed in a directory labelled with $PIXELINK_SDK_LIB for the library to work. Since standalone files are not offered for the windows version, but simply a bundled installer I left the windows behavior in tact as there is not a strong use case for this functionality on windows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modified two functions for some quality of life improvements:
Modified
getNextNumPyFrame(...)methodThe prior implementation of the getNextNumPyFrame method used the
"frame.size" method to determine the buffer size; however the value of
interest is not the size itself but the number of bytes.
The consequence of this was that the datatype of the array had to be
specifically a 1-byte datatype (i.e., uint8). If data in question is
16 bit for example, the user would need to supply one view of the buffer
to the Pixielink Wrapper API using an 8-bit datatype, and use another
view (with
dtype='>u2'for example) to view or manipulate the data.Doing this may be useful for unpacking 12-bit packed, but it is not
always helpful.
Modified
__init__(...)of PxLApi ClassThe prior behavior looked for the
libPxLApi.soshared object inproper install directories using the
CDLLmethod (i.e.,/usr/lib).This file itself is a Symlink, so the find command was also used to
lookup the full file path in the $PIXELINK_SDK_LIB directory.
Since we are already looking it up, I added support for directly
importing the DLL file from the result of the find command if it
is not found by the
CDLLmethod first. This means that the SDKneed not be "properly" installed, but simply placed in a directory
labelled with $PIXELINK_SDK_LIB for the library to work.
Since standalone files are not offered for the windows version, but
simply a bundled installer I left the windows behavior in tact as
there is not a strong use case for this functionality on windows.