Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Bitshift operations on Mat (in Java)

The Java bindings have Core.bitshift_and(), Core.bitshift_or(), and Core.bitshift_xor(), but what about bitshifting? Is it possible to bitshift a Mat without iterating through its entries?

I've seen C code before that looks like:

Mat mat8uc4 = merge((mat32sc1 >> 16) & 0xFF, (mat32sc1 >> 8) & 0xFF, (mat32sc1 >> 0) & 0xFF,(mat32sc1 >> 24) & 0xFF);

and I want to do the same thing in Java.

Bitshift operations on Mat (in Java)

The Java bindings have Core.bitshift_and(), Core.bitshift_or(), and Core.bitshift_xor(), but what about bitshifting? Is it possible to bitshift a Mat without iterating through its entries?

I've seen C C++ code before that looks like:

Mat mat8uc4 = merge((mat32sc1 >> 16) & 0xFF, (mat32sc1 >> 8) & 0xFF, (mat32sc1 >> 0) & 0xFF,(mat32sc1 >> 24) & 0xFF);

and I want to do the same thing in Java.

click to hide/show revision 3
No.3 Revision

Bitshift operations on Mat (in Java)

The Java bindings have Core.bitshift_and(), Core.bitshift_or(), Core.bitwise_and(), Core.bitwise_or(), and Core.bitshift_xor(), Core.bitwise_xor(), but what about bitshifting? bit-shifting? Is it possible to bitshift a Mat without iterating through its entries?

I've seen C++ code before that looks like:

Mat mat8uc4 = merge((mat32sc1 >> 16) & 0xFF, (mat32sc1 >> 8) & 0xFF, (mat32sc1 >> 0) & 0xFF,(mat32sc1 >> 24) & 0xFF);

and I want to do the same thing in Java.