title: How to change RGB values in SDL surface?
body: <p>In my application, once I load an image into an SDL_Surface object, I need to go through each RGB value in the image and replace it with another RGB value from a lookup function.</p>
  
  <pre><code> (rNew, gNew, bNew) = lookup(rCur, gCur, bCur);
  </code></pre>
  
  <p>It seems surface->pixels gets me the pixels. I would appreciate it if someone can explain to me how to obtain R, G, and B values from the pixel and replace it with the new RGB value.</p>