Closed joreg closed 2 years ago
see also #54
Fixed in commit 35e18de. Awaiting release.
@ravazquez it seems to me this code is still fishy: 2 things:
what do you think?
@joreg
- I am not so familiar with bit-combine magic, I will just go for a string solution.
using strings is unfortunately a very bad idea, especially if this is used for change checks every frame... the string operation is a few hundred times more expensive than bit operations and it will allocate memory on every call.
a very simple way to combine two numbers is to multiply one with a factor of 10s, so for example
long sizeNumber = width * 100000 + height;
this will put the number of the width in front of the number with the height...
similar with bit shifts would be
long sizeNumber = (width << 16) | height;
this just moves the bits of width 16 places up and then merges it with the height bits.
Thanks for the pointer and the explanation @tebjan, I will try to implement this ASAP
calculation of the imageID fails in case of square images, because -w + h always results in 0. ie there is no change from the initial 1/1 size to any other square size.
therefore this else-if case is never hit: https://github.com/vvvv/VL.OpenCV/blob/b8291d55867822261d48654d1dd46c1e10e28bcc/src/Renderer.cs#L145
and subsequently this line throws an exception: https://github.com/vvvv/VL.OpenCV/blob/b8291d55867822261d48654d1dd46c1e10e28bcc/src/Renderer.cs#L152