Skip to content

Small improvements#3

Open
andresh3 wants to merge 2 commits into
pixelink-support:masterfrom
andresh3:master
Open

Small improvements#3
andresh3 wants to merge 2 commits into
pixelink-support:masterfrom
andresh3:master

Conversation

@andresh3

Copy link
Copy Markdown

Modified two functions for some quality of life improvements:

Modified getNextNumPyFrame(...) method

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, but it is not
always helpful.

Modified __init__(...) of PxLApi Class

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.

Andrew Humphreys 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant