文件IO-BMP格式结构体

位图文件头

typedef struct tagBITMAP_FILE_HEADER
{
        short        bfType;//文件标识
        int       bfSize;//文件大小
        short        bfReserved1;//保留字
        short       bfReserved2;//保留字
        int       bfOffBits;//文件指示器偏移量相较于文件开头
} bpFile_Header, *PbpFile_Header;

位图信息头

typedef struct tagBITMAPINFOHEADER
{
        int          bpSize;//图像描述信息块的大小
        int          bpWidth;//图像宽度
        int          bpHeight;//图像高度
        short        bpPlanes;//图像的plane总数(恒为1)
        short        bpBitCount;//记录颜色的位数取值1(双色),4,6,24,32
        int          bpCompression;//数据压缩方式(0:不压缩;1:8位压缩;2:4位压缩)
        int          bpSizeImage;//图像区数据的大小,必须是4的倍数
        int          bpXPelsPerMeter;//水平每米有多少像素,在设备无关位图中,填写00H
        int          bpYPelsPerMeter;//垂直每米有多少像素,在设备无关位图中,填写00H
        int          bpClrUsed;// 此图像所有的颜色数,不用,固定为0
        int          bpClrImportant;// 重要颜色数,不用,固定为0
} bpINFO_HEADER, *PbpINFO_HEADER;

调色板信息

// 调色板信息结构体
typedef struct tag_bitmap_palette
{
    unsigned char blue;
    unsigned char green;
    unsigned char red;
    unsigned char reserved;
}bitmap_palette;

存储格式:小端存储

来源链接:https://www.cnblogs.com/lradian/p/18831411

© 版权声明
THE END
支持一下吧
点赞6 分享
评论 抢沙发
头像
请文明发言!
提交
头像

昵称

取消
昵称表情代码快捷回复

    暂无评论内容