GlreadPixels如何获得像素值
我使用此功能返回这样的值。我希望获得每个像素的RGB值,即0到255,而不是0到1。我该怎么办
data = glReadPixels(0,0, w, h, GL_RGB,GL_UNSIGNED_BYTE)
print(data)
<
\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad\xd1\x9e\xad
a href =“ https://i.sstatic.net/jiio6.png” rel =“ nofollow noreferrer“>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用将字符串转换为字节阵列:
或使用
Use
numpy.frombuffer
to convert the string to a byte array:Or use
ctypes.from_buffer_copy