Question:
How to convert 2 bytes from string to integer or how to convert them directly to R,G,B without performance lost? Maybe the question should be: how to read the string to get R,G,B from 2 byte substring...
I have 16bit bitmap, which I am reading by two bytes and need to extract the RGB values. No problem here, I know how to do it. But before I can do it I need to convert the two byte number to integer. I have read the image buffer so it is kept under pBitmap pointer and it is processed with p pointer and p+=2 increment. But now I don't know how to convert the two bytes to number. It seems to me odd convert to be able convert (two conversions? This looks like waste of time / ineffective way of reading string/buffer). The image is 4096x4096 so you can imaginate I can do it as fast as possible.