使用 boost 传输 PixelBox 数据
我从 Ogre rendertaget 获取图像。
我得到了图像的像素框:
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 (即 Ogre::uchar),将其写入缓冲区,并使用 boost 通过套接字发送它。并且不知道如何做。
谢谢。
I get an image from an Ogre rendertaget.
I get the pixelbox of the image :
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);
After doing that, i want to get the pb.data (that's Ogre::uchar), write it in a buffer, and send it via a socket using boost. And don't see how to.
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 http 同步客户端< /a> 为例。您想要的代码将如下所示:
Look at the http sync client for an example. The code you want is going to look like: