是否可以直接使用Qt内置的libpng库?

发布于 2024-12-15 00:49:09 字数 166 浏览 5 评论 0原文

我将 QImage 保存到 PNG 文件,而 QPNGHandler 的可定制性不够(我需要 png_set_filter),所以我需要编写自己的 PNG 处理程序。如果 Qt 配置为没有 -system-libpng,我是否可以直接访问 Qt 的捆绑版本?

现在我正在静态编译 Qt,但这可能会改变。

I'm saving a QImage to a PNG file and QPNGHandler isn't customizable enough (I need png_set_filter) so I need to write my own PNG handler. If Qt was configured without -system-libpng, is it possible for me to directly access Qt's bundled version?

Right now I'm statically compiling Qt, but that could change.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

把梦留给海 2024-12-22 00:49:09

是的,我想这应该是可能的。我看到符号位于 libQtGui.so 内:

arm-none-linux-gnueabi-nm libQtGui.so.4.7.2 | grep png_create_read_struct
0027b7c0 T png_create_read_struct
0027b3b4 T png_create_read_struct_2

我看到它包含来自 src/gui/image/qpnghandler.pri 的 libQtGui.so 内的所有源,除非在配置中指定了 system-png 。我想您必须手动获取 .pro 文件中指定的标头广告,因为我认为 Qt 在安装时不会导出这些标头。

Yes, I suppose it should be possible. I see the symbols are inside libQtGui.so:

arm-none-linux-gnueabi-nm libQtGui.so.4.7.2 | grep png_create_read_struct
0027b7c0 T png_create_read_struct
0027b3b4 T png_create_read_struct_2

I see it includes all the sources inside libQtGui.so from src/gui/image/qpnghandler.pri unless system-png is specified in configure. I guess you'll have to manually get the headers ad specify in your .pro file cause I don't think Qt is exporting those when installing.

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