translating shifts from Java (Processing) to C++ (arduino)

Thanks lloyddean .. but I don't quite understand the code you provided. Is this another way to decode the 2 byte RGB?

Thanks
Robert