上个周老师让我们用C++读取一张BMP图片(并显示),本文主要介绍的是读取BMP文件,至于显示,是一些其他知识,就不在这里展开。
首先BMP文件的主要结构:
- file header - all BMP images starts with a five elements file header. This has information about the file type, file size and location of the pixel data.
- bitmap header - also named the info header. This has information about the width/height of the image, bits depth and so on.
- color header - contains informations about the color space and bit masks
- pixel data.
至于每个结构体里面的各个参数,这里贴上另外一篇博客:
资料链接:https://blog.csdn.net/xiajun07061225/article/details/5813726
最近看到了一篇博客介绍的内容很好:
资料链接:https://blog.csdn.net/lcalqf/article/details/42076169
一、存储格式
2