技术博客

基于QEMU搭建内核调试环境

 Linux  Kernel  QEMU  GDB 󰈭 3557字

iie夏令营记

 杂谈 󰈭 2158字

ECNU夏令营记

 杂谈 󰈭 2494字

BUAA夏令营记

 杂谈 󰈭 1627字

BMP-FS

 BMP 󰈭 1892字
BMP文件格式初探 实现BMP文件的放缩 搜索资料时找到,笑死。 此为课程设计的第四题,这道题体现了大作业的精髓:在抄中知道,在抄中学习,在抄中苟且。 BMP 文件结构 一般的情况如下所示,摘自 wiki Structure name Optional Size Purpose Comments Bitmap file header No 14 bytes To store general information about the bitmap image file Not needed after the file is loaded in memory DIB header No Fixed-size (7 different versions exist) To store detailed information about the bitmap image and define the pixel format Immediately follows the Bitmap file header Extra bit masks Yes 3 or 4 DWORDs[ 6] (12 or 16 bytes) To define the pixel format Present only in case the DIB header is the BITMAPINFOHEADER and the Compression Method member is set to either BI_BITFIELDS or BI_ALPHABITFIELDS Color table Semi-optional Variable size To define colors used by the bitmap image data (Pixel array) Mandatory for color depths ≤ 8 bits Gap1 Yes Variable size Structure alignment An artifact of the File offset to Pixel array in the Bitmap file header Pixel array No Variable size To define the actual values of the pixels The pixel format is defined by the DIB header or Extra bit masks. Each row in the Pixel array is padded to a multiple of 4 bytes in size Gap2 Yes Variable size Structure alignment An artifact of the ICC profile data offset field in the DIB header ICC color profile Yes Variable size To define the color profile for color management Can also contain a path to an external file containing the color profile. When loaded in memory as “non-packed DIB”, it is located between the color table and Gap1.[ 7] 一般来说,现在获取到的BMP文件的DIB头都是第五代(BITMAPV5HEADER),长124字节;但是针对本实验而言,只需要极少的一些信息,因而只保留40字节,剩余84字节读进来不与使用。 ...