0
我從Ogre渲染器獲取圖像。使用提升傳輸PixelBox數據
我得到的圖像的pixelbox:
Ogre::RenderTarget *rt = _window;
rt->update();
int width = rt->getWidth();
int height = rt->getHeight();
std::cout << "width=" << width << std::endl;
std::cout << "height=" << height << std::endl;
uchar *data = new uchar[width * height * 3];
PixelBox pb(width, height, 1, PF_BYTE_RGB, data);
rt->copyContentsToMemory(pb);
這樣做之後,我想獲得pb.data(這是食人魔:: UCHAR),它在一個緩衝區寫,並通過發送套接字使用boost。並沒有看到如何。
謝謝。