1 Star 0 Fork 25

Admin / hnr

forked from tboox / hnr 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
imageconvector.cpp 854 Bytes
AI 代码解读
一键复制 编辑 原始数据 按行查看 历史
ruki 提交于 2013-07-02 14:09 . ...
#include "imageconvector.h"
ImageConvector::ImageConvector()
{
}
image_type ImageConvector::convect(QImage const& qimage)
{
image_type image(qimage.width(), qimage.height());
for (int px = 0; px < qimage.width(); ++px)
{
for (int py = 0; py < qimage.height(); ++py)
{
QRgb qrgb = qimage.pixel(px, py);
image.at(px, py).red(qRed(qrgb));
image.at(px, py).green(qGreen(qrgb));
image.at(px, py).blue(qBlue(qrgb));
}
}
return image;
}
QImage ImageConvector::convect(image_type const& image)
{
QImage qimage(image.width(), image.height(), QImage::Format_RGB32);
for (int px = 0; px < image.width(); ++px)
{
for (int py = 0; py < image.height(); ++py)
{
qimage.setPixel(px, py, qRgb(image.at(px, py).red(), image.at(px, py).green(), image.at(px, py).blue()));
}
}
return qimage;
}
C
1
https://gitee.com/randt_cn_zuodongjie/hnr.git
git@gitee.com:randt_cn_zuodongjie/hnr.git
randt_cn_zuodongjie
hnr
hnr
master

搜索帮助