title: pass the pointer of image buffer to OpenCV and change the saturation?
body: <p>I want to pass the pointer of my image buffer, change the saturation and see the result immediately. But the change is not applying in my buffer and it is not changing.</p>
  
  <pre><code>void changeSaturation(void* buffer,int width, int height)
  {
    Mat matObject(width, height, CV_8UC4, buffer);
    m_matSource = matObject;
    Mat newMat = m_matSource.clone();
  
    // BGR to HSV
    cvtColor(matSource, matSource, CV_BGR2HSV);
    for(int i = 0; i &lt; newMat.rows; ++i)
     {
       for(int j = 0; j &lt; newMat.cols; ++j)
       {
          newMat.at&lt;cv::Vec3b&gt;(i, j)[1] = 255; //saturationValue;
       }
     }
  
  // HSV back to BGR
   cvtColor(newMat, m_matSource, CV_HSV2BGR); // here m_matSource-&gt;data change
  </code></pre>
  
  <p>}</p>
  
  <p>How can I apply the change on my buffer?</p>