图像读写

四大图像库:OpenCV/FreeImage/CImg/CxImage: http://blog.youkuaiyun.com/wangji163163/article/details/3895896

 

FreeImage:http://freeimage.sourceforge.net/index.html

FreeImage开源图像库在VC++中的简易使用教程:http://hi.baidu.com/yuanzb/blog/item/d2a30317fb10d80c4a90a79b.html

#include "FreeImage.h"

int main(int argc,char** argv)
{
      FIBITMAP *img = FreeImage_Load(FIF_BMP,"1.bmp",BMP_DEFAULT);

      FREE_IMAGE_TYPE img_type = FreeImage_GetImageType(img);
      unsigned img_width = FreeImage_GetWidth(img);
      unsigned img_height = FreeImage_GetHeight(img);
      unsigned pitch = FreeImage_GetPitch (img);

      BYTE *img_pixel = (BYTE*)FreeImage_GetBits(img) ;
      for(unsigned i = 0 ; i < img_height ; ++i)
      {
             BYTE *pixel = (BYTE*)img_pixel;
             for(unsigned j = 0 ; j < img_width ; ++j)
             {

             }
             img_pixel += pitch;
       }

      if(img) FreeImage_Unload(img);
}

FreeImage纹理:http://school.ogdev.net/ArticleShow.asp?id=6209&categoryid=8http://blog.youkuaiyun.com/aquathinker/article/details/6625698,还可以看FreeImage提供的例子:TextureManager

转载于:https://www.cnblogs.com/USTC-fuxm/archive/2012/08/22/2650400.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值