title: Efficient C++ code (no libs) for image transformation into custom RGB pixel greyscale
body: <p>Currently working on C++ implementation of ToGreyscale method and I want to ask what is the most efficient way to transform "unsigned char* source" using custom RGB input params.</p>
  
  <p>Below is a current idea, but maybe using a Vector would be better?</p>
  
  <pre><code>uint8_t* pixel = source;
  for (int i = 0; i &lt; sourceInfo.height; ++i) {
      for (int j = 0; j &lt; sourceInfo.width; ++j, pixel += pixelSize) {
          float r = pixel[0];
          float g = pixel[1];
          float b = pixel[2];
          // Do something with r, g, b
      }
  }
  </code></pre>