The pixel array is a block of 32-bit DWORDs, that describes the image pixel by pixel.
Padding bytes (not necessarily 0) must be appended to the end of the rows in order to bring up the length of the rows to a multiple of four bytes.
When the pixel array is loaded into memory, each row must begin at a memory address that is a multiple of 4.
This address/offset restriction is mandatory only for Pixel Arrays loaded in memory.
For file storage purposes, only the size of each row must be a multiple of 4 bytes while the file offset can be arbitrary.
(出于存储目的,行的大小必须为4的倍数,而偏移量则可以为任意值。)
Reference: http://en.wikipedia.org/wiki/BMP_file_format#cite_note-DIBhelp-5
本文详细介绍了位图(BMP)文件格式中像素数组的组织方式。为了确保内存地址对齐和文件存储效率,每行像素数据需填充至4字节的整数倍,并且在内存加载时每个像素行的起始地址也必须是4字节的倍数。这些规定对于理解BMP文件的内部结构至关重要。
1397

被折叠的 条评论
为什么被折叠?



