巴布亚新几内亚++读取像素颜色值

发布于 2024-10-06 16:25:37 字数 210 浏览 0 评论 0原文

如何使用 png++ 读取 png 中的像素颜色值?我在文档中没有看到任何读取值的方法。我需要单独获取所有 rgba 值并将它们附加到 char 数组中。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

叫思念不要吵 2024-10-13 16:25:37

无法添加评论,所以这里:)

实际上,您应该想要 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 to Y-th row, and then to the X-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. :)

冬天旳寂寞 2024-10-13 16:25:37

我从未使用过 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 with image[Y][X] and then access the red, green and blue values by accessing image[Y][X].red, etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文