FreeImage加速保存图像
【摘要】
http://www.cppblog.com/gaimor/archive/2010/07/21/120984.html
FreeImage图形库函数一个
一直以来使用FreeImage保存图像总是采用下面的办法:
FIBITMAP
*
bitmap
=
FreeImage_Allocate(width,height...
http://www.cppblog.com/gaimor/archive/2010/07/21/120984.html
FreeImage图形库函数一个
FreeImage图形库函数一个
FIBITMAP * bitmap = FreeImage_Allocate(width,height, 24 );
const unsigned char * source = data;
for ( int y = 0 ; y < height; y ++ )
{
unsigned char * scanline = (unsigned char * )FreeImage_GetScanLine(bitmap, height - y - 1 );
memcpy(scanline,data, sizeof (source[ 0 ]) * width);
data += width;
}
const unsigned char * source = data;
for ( int y = 0 ; y < height; y ++ )
{
unsigned char * scanline = (unsigned char * )FreeImage_GetScanLine(bitmap, height - y - 1 );
memcpy(scanline,data, sizeof (source[ 0 ]) * width);
data += width;
}
FreeImage_Save(FIF_BMP,bitmap,file, 0 )
FreeImage_ConvertFromRawBits
FIBITMAP * bitmap = FreeImage_ConvertFromRawBits(data,width,height,pitch, 24 ,FI_RGBA_BLUE_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_RED_MASK,FALSE);
文章来源: blog.csdn.net,作者:网奇,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/jacke121/article/details/60146718
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)