convert index of raw image data to RGB

I want to get RGB values from a 24 bit BGR data. This data is from a raw image without a header.
I don't know how to convert the index of the buffer to its corresponding RGB values.
here is what I have done:

I want to get RGB values from a 24 bit BGR data. This data is from a raw image without a header. I don't know how to convert the index of the buffer to its corresponding RGB values. here is what I have done: