I have 16 indexes going from 0 to 255 (8 bits each) stored in a big uint4 and another into a ulong[2].
How can I convert them so I can have access to each of their individual 8-bit (uchar) values?
right now I'm doing convertion like this for uint4:
index1 = myUint4Val.s0 & 0xff;
index2 = (myUint4Val.s0 >>8) & 0xff;
...
index16 =(myUint4Val.s3 >>24) & 0xff;
then I can use them like:
value = dataAt[index1]; ....
I would prefer not using those >>
, & 0xff
, since these are extra operations I wish to avoid.
instead, accessing them as uchar8.s0
.. uchar8.s7
, seems to be okay,
but I'm stucked in converting types to the one I want...