gpt4 book ai didi

c++ - 使用 libpng 调整(双三次)图像列表的大小

转载 作者:搜寻专家 更新时间:2023-10-31 01:54:28 25 4
gpt4 key购买 nike

有人可以指点我一个教程,其中解释了如何使用 libpng 和 png++ 对图像应用双三次调整大小吗?我花了将近三个小时找东西,但找不到。可能是因为我不知道去哪里找。

图像 ( 48 bit image ) 是用 libpng 读取的然后读入一个QImage用于输出。如果我使用 QImage::scaled在图像上,像素信息丢失,图像无法满足我的需要。

我使用 png::rgba_pixel_16 像素读取和操作图像 - 像这样读取它:

png::image< png::rgba_pixel_16 > myImage(myFile.toAscii());

引用另一个答案:

there is no 16 bits per component format in QImage. The most you can get is QImage::Format_ARGB32 at 8 bits per component. Even if you used 8 bits indexed mode, the color tables do not support more than 8 bits per component. Moreover, the QImageIOHandler class works in terms of QImage, so you cannot create a custom image format plug-in to work with 16 bits per color component, unfortunately.

最后一句话解释了为什么我不能为此使用 QImage。

最佳答案

如果您只想以编程方式调整图像大小,请查看 imagemagick .

关于c++ - 使用 libpng 调整(双三次)图像列表的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9597289/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com