title: How to convert OpenCascade Pixmap into OpenCV Mat format?
body: <p>I am working with the OpenCascade Sample Project and I need to extract an 2D Snapshot of the 3DViewer Scene and convert it into the Opencv Mat format. 
  I tried the code below and if I use imshow to display the snapshot, i'll get a complete black view. The PixMap is a 3-Channel RGB image by default. </p>
  
  <pre><code>Image_PixMap img;
  getViewer()-&gt;ActiveView()-&gt;ToPixMap(img, 1024, 1024);
  cv::Mat* mat_img = new cv::Mat(1024, 1024, CV_8UC3);
  img.InitWrapper(Image_Format_RGB, mat_img-&gt;ptr(), 1024, 1024);
  </code></pre>
  
  <pre><code>Standard_EXPORT virtual bool InitWrapper (Image_Format thePixelFormat,
                                              Standard_Byte*       theDataPtr,
                                              const Standard_Size  theSizeX,
                                              const Standard_Size  theSizeY,
                                              const Standard_Size  theSizeRowBytes = 0);
  </code></pre>
  
  <pre><code> Standard_Boolean ToPixMap (Image_PixMap&amp; theImage,
                               const Standard_Integer theWidth,
                               const Standard_Integer theHeight,
                               const Graphic3d_BufferType&amp; theBufferType     = Graphic3d_BT_RGB,
                               const Standard_Boolean      theToAdjustAspect = Standard_True,
                               const V3d_StereoDumpOptions theStereoOptions  = V3d_SDO_MONO)
  </code></pre>