Hi! I came across decode_opencv_mat and figured it might be useful to have a function that decodes into an existing matrix.
I sketched out the idea against the 0.10 branch (I failed to get senpai to work) with decode_into_opencv_mat. This function takes a mutable destination matrix, and either creates a new matrix if the destination was zero-sized or copies the decoded bytes to the existing buffer.
This behavior is different from decode_opencv_mat in that the original buffer is not shared between the decoded image and the Mat.
Now caveat emptor: I could not test it thoroughly because I'm getting a ton of OpenCV build errors, but you might have a working test suite?
Hi! I came across
decode_opencv_mat
and figured it might be useful to have a function that decodes into an existing matrix.I sketched out the idea against the
0.10
branch (I failed to getsenpai
to work) withdecode_into_opencv_mat
. This function takes a mutable destination matrix, and either creates a new matrix if the destination was zero-sized or copies the decoded bytes to the existing buffer.This behavior is different from
decode_opencv_mat
in that the original buffer is not shared between the decoded image and theMat
.Now caveat emptor: I could not test it thoroughly because I'm getting a ton of OpenCV build errors, but you might have a working test suite?