巴布亚新几内亚++读取像素颜色值
How do I read the pixel color values in a png with png++? I dont see any way of reading values in the documentation. I need to get all the values rgba seperately and append them to a char array.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
无法添加评论,所以这里:)
实际上,您应该想要
image[Y][X]
因为第一个[]
让您到达Y< /code> 第行,然后到该行中的第
X
列。顺便说一句,我是 PNG++ 的作者。如果您愿意,请随时在邮件列表或我的私人电子邮件或此处提出更具体的问题。 :)
can't add a comment, so here goes :)
Actually, you should want
image[Y][X]
since first[]
gets you toY
-th row, and then to theX
-th column in that row.Btw, I'm the author of PNG++. Feel free to ask more specific questions on the mailing list or at my private email, or here, if you like. :)
我从未使用过 png++,但通过阅读有关像素的文档 我认为您可以访问
png::image的像素 (X,Y) image
与 image[Y][X] ,然后通过访问image[Y][X].red
等来访问红色、绿色和蓝色值。I've never used png++, but from reading the documentation on pixel I think you can access a pixel (X,Y) of
png::image<T> image
withimage[Y][X]
and then access the red, green and blue values by accessingimage[Y][X].red
, etc.